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 = truedecreases 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 foraddBridgesistrue.)
constructAllXYRegionLoops(curvesAndRegions: AnyCurve | AnyCurve[], tolerance: number = Geometry.smallMetricDistance, addBridges: boolean = true): SignedLoops[]
@returns array of SignedLoops, each entry of which describes the areas bounded by a single connected component:
positiveAreaLoopscontains "interior" loops, including holes in ParityRegion input. These loops have positive area and counterclockwise orientation.negativeAreaLoopscontains (probably just one) "exterior" loop which is ordered clockwise.sliverscontains sliver loops that have zero area, such as appear between coincident curves.edgescontains 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. Default is smallMetricDistance. |
| 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:
positiveAreaLoopscontains "interior" loops, including holes in ParityRegion input. These loops have positive area and counterclockwise orientation.negativeAreaLoopscontains (probably just one) "exterior" loop which is ordered clockwise.sliverscontains sliver loops that have zero area, such as appear between coincident curves.edgescontains 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 877
Last Updated: 29 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.