Skip to content

Improve separating shapes by path - Polypath #5

@TobyKLight

Description

@TobyKLight

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.

Polypaths

PolyPaths use the Skia native SKPaths Op function to clip curves (and retain 'vector' curve data).
This function only supports clipping with fill area.

Potential solutions are:
-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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions