constructAllXYRegionLoops MethodStatic
Find all xy-areas bounded by the unstructured, possibly intersecting curves.
- For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
- "Holes" implied/bounded by inputs are not preserved/discovered in output; in particular ParityRegion hole loops are treated like any other positive area loops.
- A common use case of this method is to assemble the bounding negative-area "exterior" loop for each connected
component of input curves. Passing
addBridges = true
decreases the number of connected components for nested input Loops, and thus increases the likelihood of returning exactly one exterior loop. (This is why the default value foraddBridges
istrue
.)
constructAllXYRegionLoops(curvesAndRegions: AnyCurve | AnyCurve[], tolerance: numberGeometry.smallMetricDistance, addBridges: booleantrue): SignedLoops[]
@returns array of SignedLoops, each entry of which describes the areas bounded by 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 AnyRegion contributes its children stripped of parity context. |
tolerance | number | optional distance tolerance for coincidence. |
addBridges | boolean | whether to add line segments to connect nested input Loops (default is true ). When false ,no line segments are added to the input curves, but the number of output components may be greater than expected. |
Returns - SignedLoops[]
array of SignedLoops, each entry of which describes the areas bounded by 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
- curve/RegionOps.ts Line 807
Last Updated: 14 August, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.