constructAllXYRegionLoops MethodStatic

Find all areas bounded by the unstructured, possibly intersecting curves.

  • A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the input curves.
  • This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop, regardless of its containment, is returned as its own SignedLoops object. Pre-process with RegionOps.regionBooleanXY to add bridge edges so that RegionOps.constructAllXYRegionLoops will return outer and inner loops in the same SignedLoops object.

constructAllXYRegionLoops(curvesAndRegions: AnyCurve | AnyCurve[], tolerance: number = Geometry.smallMetricDistance): SignedLoops[]

@returns array of SignedLoops, each entry of which describes the faces in a single connected component:

  • positiveAreaLoops contains "interior" loops, including holes in ParityRegion input. These loops have positive area and counterclockwise orientation.
  • negativeAreaLoops contains (probably just one) "exterior" loop which is ordered clockwise.
  • slivers contains sliver loops that have zero area, such as appear between coincident curves.
  • edges contains a LoopCurveLoopCurve object for each component edge, collecting both loops adjacent to the edge and a constituent curve in each.
Parameter Type Description
curvesAndRegions AnyCurve | AnyCurve[] Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
primitives.
tolerance number optional distance tolerance for coincidence

Returns - SignedLoops[]

array of SignedLoops, each entry of which describes the faces in a single connected component:

  • positiveAreaLoops contains "interior" loops, including holes in ParityRegion input. These loops have positive area and counterclockwise orientation.
  • negativeAreaLoops contains (probably just one) "exterior" loop which is ordered clockwise.
  • slivers contains sliver loops that have zero area, such as appear between coincident curves.
  • edges contains a LoopCurveLoopCurve object for each component edge, collecting both loops adjacent to the edge and a constituent curve in each.

Defined in

Last Updated: 16 April, 2024