intersection_line_segment_xy

compas.geometry.intersection_line_segment_xy(line, segment, tol=1e-06)[source]

Compute the intersection between a line and a segment.

Parameters
  • line ([point, point] | compas.geometry.Line) – A line defined by two points, with at least XY coordinates.

  • segment ([point, point] | compas.geometry.Line) – A segment defined by two points, with at least XY coordinates.

  • tol (float, optional) – A tolerance for membership verification.

Returns

[float, float, 0.0] | None – XYZ coordinates of the intersection, if one exists, with Z = 0. None otherwise.