Re: Remove overlap on NSBezierPath
Re: Remove overlap on NSBezierPath
- Subject: Re: Remove overlap on NSBezierPath
- From: Graham Cox <email@hidden>
- Date: Mon, 14 Jul 2008 09:46:00 +1000
Are you talking about performing union, intersection, difference (i.e.
"set" operations)? If so, this is not a simple problem. Cocoa doesn't
have anything built in to do it, and in fact there is no known general
solution for arbitrary bezier curves (though there are plenty of
practical/heuristic methods that work for most practically useful
cases, and I for one would love to see these as part of CG, as they
are part of Java, Flash, etc).
In the meantime, there is a general solution for vector paths (i.e.
paths that consist of short straight line segments) and you can
flatten a bezier path to one of these easily. One of the best
implementations I've run across is General Polygon Clipper by Alan
Murta (http://www.cs.man.ac.uk/~toby/alan/software/) - free for non-
comercial use but not for commercial use. I have written some
straightforward categories on NSBezierPath that translate
NSBezierpaths to and from GPC's internal representation and also
provide some high-level methods to directly perform set operations.
This code is part of DrawKit (http://apptree.net/drawkitmain.htm) and
also covered on CocoaDev here:
http://www.cocoadev.com/index.pl?NSBezierPathcombinatorics
hth,
Graham
On 13 Jul 2008, at 11:43 pm, Georg Seifert wrote:
Hello,
I don’t know if this is the right place to ask ...
How I can merge to bezierPaths and remove the overlap in Cocoa.
Does anyone has exerience with this or can point me to some
information?
Thanks in advance
Georg_______________________________________________
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
_______________________________________________
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