facetRegionXY MethodStatic

Facet the region according to stroke options.

facetRegionXY(region: AnyRegion, options?: StrokeOptions): undefined | IndexedPolyface

@note For best results, UnionRegion input should consist of non-overlapping children. See regionBooleanXY.

@note For best results, ParityRegion input should be correctly oriented. See sortOuterAndHoleLoopsXY.

@returns facets for the region, or undefined if facetting failed

Parameter Type Description
region AnyRegion a closed xy-planar region, possibly with holes.
* The z-coordinates of the region are ignored. Caller is responsible for rotating the region into plane local coordinates beforehand, and reversing the rotation afterwards.
options StrokeOptions primarily how to stroke the region boundary, but also how to facet the region interior.
* By default, a triangulation is returned, but if options.maximizeConvexFacets === true, edges between coplanar triangles are removed to return maximally convex facets.

Returns - undefined | IndexedPolyface

facets for the region, or undefined if facetting failed

Defined in

Last Updated: 07 June, 2025