Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a union of 2 bezier paths

Tags:

I have two bezier paths that i'd like to combine to form a union, so that I can stroke the entire outer shape. In my case, it's a speech bubble with a tail, so although it's not a complex shape it would actually be quite hard to create it using one single path.

There doesn't appear to be a Core Graphics API for creating unions. Am I wrong?

If I'm not, does anyone know of a library that can handle this? I've search GitHub to no avail.

like image 530
tarmes Avatar asked Oct 04 '13 09:10

tarmes


1 Answers

UIBezierPath does that if you are working with closed shapes.

UIBezierPath *firstPath = [UIBezierPath bezierPath];
// build your path

UIBezierPath *secondPath = [UIBezierPath bezierPath];
// build your path

[firstPath appendPath:secondPath];
like image 154
cescofry Avatar answered Oct 26 '22 23:10

cescofry