removeSelfIntersections

fun Shape.removeSelfIntersections(fillRule: FillRule = FillRule.NON_ZERO): Shape(source)


fun ShapeContour.removeSelfIntersections(fillRule: FillRule = FillRule.NON_ZERO): Shape(source)

Resolves self-intersections of this ShapeContour.

For a closed contour this delegates to Shape.removeSelfIntersections, which resolves the enclosed area under fillRule.

An open contour doesn't enclose an area, so there's no fill rule to apply (the fillRule parameter is ignored): every self-crossing loop is excised instead, trimming the two crossing strands back to the point they share and reconnecting them, repeatedly, until no crossing remains -- preserving the contour's original start and end point. The result always has exactly one contour.