[comp.sys.mac.programmer] Quickdraw ovals

lippin@russet.berkeley.edu (The Apathist) (12/15/88)

In article <18216@agate.BERKELEY.EDU> I wrote:
>(While we're at the wishing well, how about fixing FrameOval so that
>it doesn't leave gaps?)

Recently parent@Apple.COM (Shean Parent) wrote:
>The way that QuickDraw draws an oval is to strike an oval inside the
>given rectangle then inset by the pen size and strike a second oval.
>The area between the two strikes is filled with the current pen
>pattern and color. If you think of it like this then it is clear why
>the ovals fall apart. The area between the two strikes closes to less
>the one pixel.

I can understand how one might mistake this for a correct algorithm at
first, but I think that it's clear now that it isn't correct.  The
ovals should be separated by the pen size, not just the bounding
rectangles.

(This leads me to wonder: does FrameRgn have the same problem?)

>It is not a bug. It was designed that way.

Regardless of how it was designed, it doesn't produce the specified
result, that is, frames of ovals.  Thus, it's a bug.

					--Tom Lippincott
					  lippin@math.berkeley.edu

	"If you call a tail a leg, how many legs does a dog have?"

mystone@caen.engin.umich.edu (Dean Yu) (12/15/88)

In article <18307@agate.BERKELEY.EDU> lippin@math.berkeley.edu writes:
>Recently parent@Apple.COM (Shean Parent) wrote:
>>The way that QuickDraw draws an oval is to strike an oval inside the
>>given rectangle then inset by the pen size and strike a second oval.
>>[.....]

>I can understand how one might mistake this for a correct algorithm at
>first, but I think that it's clear now that it isn't correct.  The
>ovals should be separated by the pen size, not just the bounding
>rectangles.
>
   Isn't that what Shean said?  Look at what he said and what you said...
 

______________________________________________________________________________
Dean Yu                            |  E-mail:    mystone@caen.engin.umich.edu
University of Michigan             |  Real-mail: Dean Yu
Computer Aided Engineering Network |             2413 Kelsey House
===================================|             600 E Madison
"These are MY opinions." (My       |             Ann Arbor, MI 48109
 employer doesn't want them.       |==========================================
 Actually, they don't really care  | 
 what I think.  But President      |   This space intentionally left blank.  
 Duderstadt does...)               | 
------------------------------------------------------------------------------  

parent@Apple.COM (Sean Parent) (12/16/88)

In article <4041f351.1285f@maize.engin.umich.edu>, mystone@caen.engin.umich.edu (Dean Yu) writes:
> In article <18307@agate.BERKELEY.EDU> lippin@math.berkeley.edu writes:
> >Recently parent@Apple.COM (Shean Parent) wrote:
> >>The way that QuickDraw draws an oval is to strike an oval inside the
> >>given rectangle then inset by the pen size and strike a second oval.
> 
> >I can understand how one might mistake this for a correct algorithm at
> >first, but I think that it's clear now that it isn't correct.  The
> >ovals should be separated by the pen size, not just the bounding
> >rectangles.
> >
>    Isn't that what Shean said?  Look at what he said and what you said...

First my name is Sean. (my finger was misspelled and I didn't realize it).
If what was meant by the "ovals should be separated by the pen size" meant
that they should be seperated by the pen size at all points on the oval as if
you drug the pen around the oval then that is not what I said. If QD did this
, however, then the results would be very bad. You would get ovals whose lines
got fatter as they neared the diagnals of the bounding rectangle. This is
because QD uses a square pen.

It could be argued that QD should not use a square pen but rather one that
behaved like a line that oriented itself to be perpendiculare to the tangent
of the line or arc being drawn (I belive this is how a PostScript pen behaves)
But then you would have to change the entire QD model. This is not very likely
to happen.

Please, no discussion about why Apple should adobt Display PostScript. DPS has
pleanty of things that it can't do that QD does very nicely.

Sean

parent@Apple.COM (Sean Parent) (12/16/88)

In article <18307@agate.BERKELEY.EDU>, lippin@russet.berkeley.edu (The Apathist) writes:
> In article <18216@agate.BERKELEY.EDU> I wrote:
> >(While we're at the wishing well, how about fixing FrameOval so that
> >it doesn't leave gaps?)
> 
> Recently parent@Apple.COM (Shean Parent) wrote:
> >The way that QuickDraw draws an oval is to strike an oval inside the
> >given rectangle then inset by the pen size and strike a second oval.
> >The area between the two strikes is filled with the current pen
> >pattern and color. If you think of it like this then it is clear why
> 
> >It is not a bug. It was designed that way.
> 
> Regardless of how it was designed, it doesn't produce the specified
> result, that is, frames of ovals.  Thus, it's a bug.

It does frame the oval it is just that the frame of an oval with a 1,1 pen size
gets so thin that it cannot be rendered. It also has some very nice affects
when it comes to nesting consentric (sp) ovals.

Again it is part of the QD model. If you have a better way to draw an oval that
fits well in the QD model I would like to hear of it (see my previouse post
to see why your suggested method fails). For some applications what is needed
is a different model not just some kludge for ovals.

But QD works quite well and it is fast even if it does have limitations (all
graphics models do).

Sean

P.S. I am not part of the QD team so my opinions are my own and don't reflect
everyone's opinion in the QD team or in Apple (even though I wish they did
:-) ). I work in the PrintShop if anyone cares.

kaufman@polya.Stanford.EDU (Marc T. Kaufman) (12/16/88)

In article <22253@apple.Apple.COM> parent@Apple.COM (Sean Parent) writes:

.If what was meant by the "ovals should be separated by the pen size" meant
.that they should be seperated by the pen size at all points on the oval as if
.you drug the pen around the oval then that is not what I said. If QD did this
., however, then the results would be very bad. You would get ovals whose lines
.got fatter as they neared the diagnals of the bounding rectangle. This is
.because QD uses a square pen.

Nevertheless, that is what QD does.  Actually, QD uses a rectangular pen.
The inset-oval method is because it would look even worse if QD did what it
does for polygons, where the pen hangs down and to the right.  At least, by
filling the pen pattern between two ovals, the framing is entirely inside
the outer oval.

Marc Kaufman (kaufman@polya.stanford.edu)