closestPointScalarFromPointToSegment

closestPointScalarFromPointToSegment()
closestPointScalarFromPointToSegment(p0: Point3, p1: Point3, point: Point3): number

Finds the scalar for the closest point on line segment p0-p1 to the given point. The returned scalar will always be in the range [0, 1], where 0 indicates p0 is closest, and 1 indicates p1 is closest.

Parameters

p0: Point3

First point of the line segment

p1: Point3

Second point of the line segment

point: Point3

Point at which to find closest line segment scalar

Returns: number