• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
BezierPath Madness...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: BezierPath Madness...
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: NSStepper and NSTextField changes
  • Next by Date: NSSlider and mouseUp event
  • Previous by thread: RE: NSStepper and NSTextField changes
  • Next by thread: Re: BezierPath Madness...
  • Index(es):
    • Date
    • Thread