-
Notifications
You must be signed in to change notification settings - Fork 0
Improve separating shapes by path - Polygon #4
Description
Goal
The goal of the end user is to split a shape into parts with only an open path. Like the knife tool in Adobe Illustrator.
Currently shapes can only be clipped by other shapes with fill.
The workaround (As used by the PolyPath.Compartments operation) is to clip the shape with a very thin filled shape representing a line. However this means the resulting points do not exactly match the original points and can create artifacts. You can see this in the helpatch "Extract Compartments from a Polypath" by changing the 'divider width' value.
Polygons
Polygons use the Clipper1 library.
The Clipper1 library does support clipping an open path but as the subject only. I.E the path is clipped by the fill shape. You can see this the Helppatch "HowTo Find Intersection of Line and Polygons". It does not work the other way.
Potential solutions are:
-Clipper2 library may support this, but will not bring this in until vvvv gamma stable version supports net5. See #1
-Clip using the 'small filled paths' workaround > Then have an operation that searches along the clipping path for an original point in the radius of all new points and shifts new points back to their original position. I can already see some edge cases that wouldn't work with this solution but maybe worthwhile.
-Find another clipping algorithm for this case? If anyone has ideas put em below. (Or even better if you'd like to contribute a patch more than welcome)