sortOuterAndHoleLoopsXY MethodStatic
Reverse and reorder loops in the xy-plane for consistent orientation and containment.
sortOuterAndHoleLoopsXY(loops: IndexedXYZCollection | Loop[]): AnyRegion
@returns a region that captures the input pointers. This region is a:
- Loop if there is exactly one input loop. It is oriented counterclockwise.
- ParityRegion if input consists of exactly one outer loop with at least one hole loop. Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented clockwise.
- UnionRegion if any other input configuration. Its children are individually ordered/oriented as in the above cases.
Parameter | Type | Description |
---|---|---|
loops | IndexedXYZCollection | Loop[] | multiple loops in any order and orientation, z-coordinates ignored. * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross. |
Returns - AnyRegion
a region that captures the input pointers. This region is a:
- Loop if there is exactly one input loop. It is oriented counterclockwise.
- ParityRegion if input consists of exactly one outer loop with at least one hole loop. Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented clockwise.
- UnionRegion if any other input configuration. Its children are individually ordered/oriented as in the above cases.
Defined in
- curve/RegionOps.ts Line 751
Last Updated: 07 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.