closest_point_on_polyline

compas.geometry.closest_point_on_polyline(point, polyline)[source]

Find the closest point on a polyline to a given point.

Parameters
  • point (list) – XYZ coordinates of a 2D or 3D point (Z will be ignored).

  • polygon (sequence) – A sequence of XYZ coordinates representing the locations of the corners of a polygon. The vertices are assumed to be in order. The polygon is assumed to be closed: the first and last vertex in the sequence should not be the same.

Returns

list – XYZ coordinates of closest point.