closest_point_on_polyline_xy

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

Compute closest point on a polyline to a given point, assuming they both lie in the XY-plane.

Parameters
  • point ([float, float] or [float, float, float] | Point) – XY(Z) coordinates of a 2D or 3D point (Z will be ignored).

  • polyline (sequence[point] | Polyline) – A sequence of XY(Z) coordinates of 2D or 3D points (Z will be ignored) representing the locations of the corners of a polyline. The vertices are assumed to be in order.

Returns

[float, float, 0.0] – XYZ coordinates of closest point in the XY plane.