closest_point_on_segment

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

Computes closest point on line segment (p1, p2) to test point.

Parameters
  • point ([float, float, float] | Point) – XYZ coordinates.

  • segment ([point, point] | Line) – Two points defining the segment.

Returns

[float, float, float] – XYZ coordinates of closest point.

Examples

>>>