Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSBezierPath intersection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierPath intersection




On Apr 28, 2005, at 4:01 PM, Linea Tessile srl wrote:


Hi people!

Does anybody know how calculate the intersection point between two lines created using an NSBezierPath?

Thanks,
Alessandra


Since NSBezierPath's contain curves, there is no "the intersection point". Even if both are just a single curve (and an NSBezierPath is more like a complex polygon since it can contain multiple "line to"s and "curve to"s, not to mention multiple discontinuous shapes - an entire page of text outlines could be a single NSBezierPath), there still isn't a single interesection point (I can think of a case that gives six points of intersection).


You're best bet is to use bezierPathByFlatteningPath to get a bezier path composed only of straight lines and then do standard line intersection tests between each segment of each of the bezier paths (and yes, this can get real expensive real quick).


Glenn Andreas                      email@hidden  <http://www.gandreas.com/> oh my! quadrium | build, mutate, evolve | images, textures, backgrounds, art

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSBezierPath intersection (From: Linea Tessile srl <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.