• 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
Re: How to import drawing paths into a Cocoa application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to import drawing paths into a Cocoa application?
      • From: "John C. Randolph" <email@hidden>
    • Re: How to import drawing paths into a Cocoa application?
      • From: Graham Cox <email@hidden>
References: 
 >How to import drawing paths into a Cocoa application? (From: Steve Weller <email@hidden>)

  • Prev by Date: Re: -windowDidLoad not getting called
  • Next by Date: Re: -windowDidLoad not getting called
  • Previous by thread: How to import drawing paths into a Cocoa application?
  • Next by thread: Re: How to import drawing paths into a Cocoa application?
  • Index(es):
    • Date
    • Thread