intersection_line_segment_xy

compas.geometry.intersection_line_segment_xy(line, segment, tol=None)[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.

tolfloat, optional

Tolerance for computing the intersection between the line and the underlying line of the segment, and for verifying that the point is on the segment. Default is TOL.absolute.

Returns:
[float, float, 0.0] | None

XYZ coordinates of the intersection, if one exists, with Z = 0. None otherwise.