facetRegionXY MethodStatic

Facet the region according to stroke options.

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

@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.
* For best results, UnionRegion input should consist of non-overlapping children.
Caller can ensure this by passing in region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union).
* For best results, ParityRegion input should be correctly oriented (holes have opposite orientation to their containing loop).
Caller can ensure this for non-intersecting loops by passing in region = RegionOps.sortOuterAndHoleLoopsXY(loops).
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: 28 October, 2024