closestApproach MethodStatic

Find smallest distance between polylines.

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:

  • a is the closest approach distance
  • point is the point of closest approach
  • fraction is the global polyline fraction
  • childDetail.a is the segment index
  • childDetail.fraction is 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:

  • a is the closest approach distance
  • point is the point of closest approach
  • fraction is the global polyline fraction
  • childDetail.a is the segment index
  • childDetail.fraction is the local segment fraction

Defined in

Last Updated: 13 May, 2024