Re: How to import drawing paths into a Cocoa application?
Re: How to import drawing paths into a Cocoa application?
- Subject: Re: How to import drawing paths into a Cocoa application?
- From: Graham Cox <email@hidden>
- Date: Tue, 22 Apr 2008 10:35:01 +1000
On 22 Apr 2008, at 10:23 am, Steve Weller wrote:
Are there any easy ways of calculating the points on the path as a
function of the distance from the start of the path?
I'm not sure about the rest of your question but I can answer this
part. The short answer is no - it's really tricky.
However if you have a look at my DrawKit project, it solves this
problem exactly ;-)
One category method on NSBezierPath I have is:
- (NSPoint) pointOnPathAtLength:(float) length slope:(float*) slope;
where <length> is the linear distance from the start of the path - it
optionally also returns the slope (dy/dx) at the given point. The
project is still in beta though this method is used a lot in my code
and is well debugged.
http://apptree.net/drawkitmain.html
hth,
G.
_______________________________________________
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