Plane.intersection_with_line

Plane.intersection_with_line(line, tol=None)[source]

Compute the intersection of a plane and a line.

Parameters:
linecompas.geometry.Line

The line.

tolfloat, optional

Tolerance for the dot product of the line vector and the plane normal. Default is TOL.absolute.

Returns:
compas.geometry.Point | None

The intersection point, or None if the line is parallel to the plane.

Examples

>>> from compas.geometry import Line
>>> plane = Plane.worldXY()
>>> line = Line.from_point_and_vector(Point(0, 0, 1), Vector(1, 1, 1))
>>> point = plane.intersection_with_line(line)
>>> print(point)
Point(x=-1.000, y=-1.000, z=0.000)