closestApproach MethodStatic
Find smallest distance between polylines.
- For polylines with many points, it is more efficient to use searchForClosestApproach.
closestApproach(pointsA: IndexedXYZCollection | Point3d[], extendA: VariantCurveExtendParameter, pointsB: IndexedXYZCollection | Point3d[], extendB: VariantCurveExtendParameter, dMax: numberNumber.MAX_VALUE, result?: CurveLocationDetailPair): undefined | CurveLocationDetailPair
@returns pair of details, one for each polyline, with field values:
- ais the closest approach distance
- pointis the point of closest approach
- fractionis the global polyline fraction
- childDetail.ais the segment index
- childDetail.fractionis the local segment fraction
| Parameter | Type | Description | 
|---|---|---|
| pointsA | IndexedXYZCollection | Point3d[] | first polyline | 
| extendA | VariantCurveExtendParameter | how to extend polylineA forward/backward | 
| pointsB | IndexedXYZCollection | Point3d[] | second polyline | 
| extendB | VariantCurveExtendParameter | how to extend polylineB forward/backward | 
| dMax | number | largest approach distance to consider | 
| result | CurveLocationDetailPair | optional pre-allocated object to populate and return | 
Returns - undefined | CurveLocationDetailPair
pair of details, one for each polyline, with field values:
- ais the closest approach distance
- pointis the point of closest approach
- fractionis the global polyline fraction
- childDetail.ais the segment index
- childDetail.fractionis the local segment fraction
Defined in
- geometry3d/PolylineOps.ts Line 293
Last Updated: 24 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.