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 21:24:25 +1000
On 14 Jul 2008, at 7:48 pm, Georg Seifert wrote:
Hello,
Thanks for you replies.
To clarify: I need it in a small drawing app, where you can draw
shapes and then you should be able to combine them. There is no
outline but the winding is quite important (there may be
overlapping, clipping and self intersecting parts).
If you don't need to draw the stroke, things maybe much easier (you
could keep a list of contributing paths as part of some object of your
own device for example).
I did found DrawKit but as I need to keep the curves, this doesn’t
seem to be an option.
Right now I use GPC and (optional) curve fitting. It keeps the curves
in terms of their appearance but can greatly alter the number and
location of the control points. I don't like it much either - one
reason I'd love there to be a great solution built-in. Unfortunately
I'm no mathematician and so I haven't been able to come up with a
great way to do it from first principles, nor found any suitable code
out there until...
I just had a short look at the Omni-OAExtensions. There are some
functions to find intersections of paths, so I have to build my own
merging routine out of it, right?
...this. I hadn't seen those before either. It looks as if they've
given away the hardest part, finding the intersections and crossing
directions of each intersection. On top of that you can build the set
operations. I plan to have a very good look at doing this for DK as
soon as I can - if it can be made to work it will be a much better
solution than curve fitting. Props to the Omni guys for being prepared
to give away this code like this :)
cheers, Graham_______________________________________________
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