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: number = Number.MAX_VALUE, result?: CurveLocationDetailPair): undefined | CurveLocationDetailPair
@returns pair of details, one for each polyline, with field values:
ais the closest approach distancepointis the point of closest approachfractionis the global polyline fractionchildDetail.ais the segment indexchildDetail.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 distancepointis the point of closest approachfractionis the global polyline fractionchildDetail.ais the segment indexchildDetail.fractionis the local segment fraction
Defined in
- geometry3d/PolylineOps.ts Line 304
Last Updated: 24 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.