collectChains MethodStatic

Restructure curve fragments as Paths and Loops.

  • Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.

collectChains(fragments: AnyCurve[], gapTolerance: numberGeometry.smallMetricDistance, planeTolerance?: number): undefined | AnyChain

@returns chains, possibly wrapped in a BagOfCurves.

Parameter Type Description
fragments AnyCurve[] fragments to be chained
gapTolerance number distance to be treated as "effectively zero" when assembling fragments head-to-tail
planeTolerance number tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.

Returns - undefined | AnyChain

chains, possibly wrapped in a BagOfCurves.

Defined in

Last Updated: 13 November, 2024