The polyline to evaluate, represented as an array of 2D vertices.
The 2D point for which to find the closest footing point on the polyline.
If true, restricts the search to points strictly within segments (not at vertices).
An object containing:
pt
: The closest point on the polyline (2D).t
: The normalized parameter (0 to 1) representing the position along the polyline.lineSegment
: The segment of the polyline where the footing point lies.availableFactors
: All candidate factors considered during evaluation.
Returns undefined
if no valid footing point is found.
Finds the closest footing point on a 2D polyline to a given point.
Iterates through each segment of the polyline and computes the perpendicular foot point from the input point. Returns the best candidate with the shortest distance to the input point, along with its position on the polyline, the corresponding segment, and all available candidate factors.