Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to import drawing paths into a Cocoa application?




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How to import drawing paths into a Cocoa application? (From: Steve Weller <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.