BezierPath Madness...
BezierPath Madness...
- Subject: BezierPath Madness...
- From: Jerry LeVan <email@hidden>
- Date: Thu, 12 Dec 2002 18:28:32 -0500
Hi,
I have been fiddling around with a simple program that draws pretty
geometric paths called spirolaterals. I was playing around with it and I
found that the drawing performance would "fall off the cliff" if the
generated Bezier Path had about 2500 points, ie the spinning cursor of doom
would spin anywhere from 5 to 10 seconds before the path would be drawn.
The basic algorithm was something like:
path = new bezier path
initialization
for I = 1 to repts
initialization
for j = 1 to turns
add a point to the path ( using rlinetopoint)
end for j loop
end for I loop
stroke the path
So there are about repts*turns points in the path, as I said earlier, at
some point the performance drops through the floor. ( repts=50, turns=50)
If I replace the above by:
path = new bezier path
initialization
for I = 1 to repts
initialization
for j = 1 to turns
add a point to the path ( using rlinetopoint)
end for j loop
stroke the path
empty the path
end for I loop
Performance is *much* better. (I can't make turns too large because each
turn generates a line segment one unit longer than the previous segment.)
Why would it take significantly longer to stoke a path with 2500 points as
opposed to 50 paths with 50 points?
The project can be found at
http://homepage.mac.com/levanj
--Jerry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.