Re: Appending CGPath to CGPath
Re: Appending CGPath to CGPath
- Subject: Re: Appending CGPath to CGPath
- From: Graham Cox <email@hidden>
- Date: Sat, 16 Apr 2011 17:32:07 +1000
On 16/04/2011, at 4:40 PM, Roland King wrote:
> Where I'm getting the most time spent is in CGPathAddArc(), and this particular shape has a lot of them. My assumption here is that CGPathAddArc, which takes two angles, is having to calculate a bunch of trig functions of those and figure out which bezier paths to add to approximate it. Once I have the path calculated once, yes to rotate and translate it I'll have to iterate over the points and multiply each of them by the transformation, but that's a quicker operation than recalculating each one of those arcs all over again from basics.
Yes, calculating arc-to-bezier is quite complicated (I just implemented this for importing SVG 'A' commands). If the arcs have common angles but there are many of them you could re-use the calculated arc segment using transforms to speed that up.
For joining paths in the way you describe, you have to use CGPathApply.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden