sortOuterAndHoleLoopsXY MethodStatic

Reverse and reorder loops in the xy-plane for consistent orientation and containment.

sortOuterAndHoleLoopsXY(loops: IndexedReadWriteXYZCollection[]): IndexedReadWriteXYZCollection[][]

@returns array of arrays of polygons that capture the input pointers. In each first level array:

  • The first polygon is an outer loop, oriented counterclockwise.
  • Any subsequent polygons are holes of the outer loop, oriented clockwise.

@see sortOuterAndHoleLoopsXY

Parameter Type Description
loops IndexedReadWriteXYZCollection[] multiple polygons 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 - IndexedReadWriteXYZCollection[][]

array of arrays of polygons that capture the input pointers. In each first level array:

  • The first polygon is an outer loop, oriented counterclockwise.
  • Any subsequent polygons are holes of the outer loop, oriented clockwise.

Defined in

Last Updated: 07 June, 2025