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 14:14:20 +1000
If all you need is a fill, and a union, it's trivial just to paint two
paths one on top of the other. If one path completely surrounds the
other you can get a difference effect by appending the paths and using
the appropriate winding rule. XOR likewise. But these are about the
only situations you can handle with Cocoa/Quartz as it stands.
Stroking paths that intersect in any way generally can't be done.
Finding the intersection of two paths can't be done.
If you wanted to perform the rasterization of the paths yourself there
are more options, but that's a pretty hefty task (using anti-grain
geometry or similar) to take on just to gain some peripheral
functionality.
Since apps like Adobe Illustrator and Flash can perform these
operations on bezier paths, clearly there are methods that exist for
doing it, even though the mathematicians claim otherwise (what they
are claiming is the lack of a general all-purpose solution to the
arbitrary intersection of bezier paths, but for real-world graphics
there wouldn't be too many pathological cases to worry about).
I'd love to see these features added to Cocoa, as it would open up the
ability to compete with the likes of Adobe to us ordinary mortals in
some areas, and for anyone but Adobe, I can't see how that can be a
bad thing.
cheers, Graham
On 14 Jul 2008, at 1:28 pm, David Duncan wrote:
On Jul 13, 2008, at 6:43 AM, Georg Seifert wrote:
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?
Now one thing that no one has really asked is, do you need a
mathematical representation of this, or just a graphical
representation?
If you just need a graphical representation, then you might be able
to do this by drawing both beziers and then manipulating the blend
mode to draw what you want. I haven't tried this myself, and I
haven't thought too much about it beyond that it might be easier in
the graphical domain, but if all you need is graphics, then consider
the issue to be a graphical one rather than a mathematical one.
_______________________________________________
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