[comp.graphics] A deficiency in the Mac ellipse algorithm?

jurjen@cwi.nl (Jurjen N.E. Bos) (02/27/89)

I just found out that the "deficiency" in the Mac ellipse algorithm really
is a feature: Drawing ellipses inside each other will have a nice look.
This means that ellipses need to have holes to fit inside each other.
This feature is actually used in the Mac OS.
-- 
  -- Jurjen N.E. Bos (jurjen@cwi.nl)

goudal@geocub.greco-prog.fr (Frederic Goudal ) (03/07/89)

In article <7929@boring.cwi.nl> jurjen@cwi.nl (Jurjen N.E. Bos) writes:
>I just found out that the "deficiency" in the Mac ellipse algorithm really
>is a feature: Drawing ellipses inside each other will have a nice look.
>This means that ellipses need to have holes to fit inside each other.

If you mean that drawing ellipses to fill an area don't give the expected
results (because of the holes), you don't have to worry about that, it's
simply at the present time impossible. But, you can fill an area with ellipses
with this algorithm : for each point of the area, you compute with elipse it
belongs. I don't know the exact algorithm.
You will have th same problem with lines, circles, and in general all curves :
just try to fill an area with parallels lines, depending on the direction, you
will find more or less holes, it's inherent to Bresenham algorithm.

So I hope that I have well understood what you mean.


a ciao.
babbs.

Claim : "I do apologize for my bad english"
-- 

goudal@geocub.UUCP          "Why can't we rich the sun?"
oral-maill : babbs		Pink Floyd

jmunkki@kampi.hut.fi (Juri Munkki) (03/10/89)

I just got tired of all this talk about a deficiency in the Quickdraw ellipses. 
There's a very simple way to draw connected ellipses using Quickdraw...

Here's a program that draws to ellipses. The first one has the expected gaps,
but the second is connected. Maybe no one else thought of this solution? It
takes longer to draw this way, but at least you get what you want.

void	main()
{
	GrafPort	MyPort;
	Rect		TheOval;
	RgnHandle	MyRgn;
	
	InitGraf(&thePort);
	InitCursor();
	OpenPort(&MyPort);
	EraseRect(&MyPort.portRect);

	SetRect(&TheOval,10,10,502,30);
	FrameOval(&TheOval);

	MyRgn=NewRgn();
		OpenRgn();
			OffsetRect(&TheOval,0,30);	
			FrameOval(&TheOval);
		CloseRgn(MyRgn);
		FrameRgn(MyRgn);
	DisposeRgn(MyRgn);

	while(!Button());
	while(Button());
}

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|     Juri Munkki jmunkki@hut.fi  jmunkki@fingate.bitnet        I Want   Ne   |
|     Helsinki University of Technology Computing Centre        My Own   XT   |
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^