closest_point_on_segment_xy

compas.geometry.closest_point_on_segment_xy(point, segment)[source]

Compute closest point on a line segment to a given point lying in the XY-plane.

Parameters
  • point (sequence of float) – XY(Z) coordinates of a point.

  • segment (tuple) – Two 2D or 3D points defining the line segment (Z components will be ignored).

Returns

list – XYZ coordinates of closest point (Z = 0.0).