convexDecomposePolygonXY MethodStatic

Decompose a polygon with optional holes into an array of convex polygons.

convexDecomposePolygonXY(polygon: MultiLineStringDataVariant, maximize: boolean = true): undefined | GrowableXYZArray[]

@returns array of convex polygons, or undefined if triangulation failed

Parameter Type Description
polygon MultiLineStringDataVariant polygon and hole loops, e.g., as returned by CurveCollection.cloneStroked on a Loop or ParityRegion. All z-coordinates are ignored.
maximize boolean whether to return maximally convex polygons. If false, triangles are returned.

Returns - undefined | GrowableXYZArray[]

array of convex polygons, or undefined if triangulation failed

Defined in

Last Updated: 16 April, 2024