Re: Insetting a complex NSBezierPath shape?
Re: Insetting a complex NSBezierPath shape?
- Subject: Re: Insetting a complex NSBezierPath shape?
- From: Robert Clair <email@hidden>
- Date: Thu, 31 Mar 2005 00:16:49 -0500
You can't do this exactly because, as had been noted many times, the
offset of a Bezier curve isn't a Bezier curve. Therefore there is no
NSBezierPath that is the exact inset of another NSBezierPath (unless
the path contains only line segments).
A reasonable approximation ( for small offsets ) can be obtained by
1) making a polygon out of the Bezier curves control points
2) offsetting the polygon (requires some high school geometry)
3) using the vertices of the offset polygon as the control points for a
new Bezier curve.
You have to be a bit careful if any of the polygon segments makes a
very small acute angle with a neighbor - the offset vertex can go very
far away.
That being said, it's unlikely that, if you do this with a one pixel
offset, it will look much different or any better than just stroking
the path.
....Bob Clair
_______________________________________________
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