skspatial.objects.Plane.intersect_plane

Plane.intersect_plane(other: skspatial.objects.plane.Plane, **kwargs) skspatial.objects.line.Line[source]

Intersect the plane with another.

The planes must not be parallel.

Parameters
otherPlane

Other plane.

kwargsdict, optional

Additional keywords passed to Vector.is_parallel().

Returns
Line

The line of intersection.

Raises
ValueError

If the planes are parallel.

References

http://tbirdal.blogspot.com/2016/10/a-better-approach-to-plane-intersection.html

Examples

>>> from skspatial.objects import Plane
>>> plane_a = Plane([0, 0, 0], [0, 0, 1])
>>> plane_b = Plane([0, 0, 0], [1, 0, 0])
>>> plane_a.intersect_plane(plane_b)
Line(point=Point([0., 0., 0.]), direction=Vector([0, 1, 0]))
>>> plane_b = Plane([5, 16, -94], [1, 0, 0])
>>> plane_a.intersect_plane(plane_b)
Line(point=Point([5., 0., 0.]), direction=Vector([0, 1, 0]))
>>> plane_b = Plane([0, 0, 1], [1, 0, 1])
>>> plane_a.intersect_plane(plane_b)
Line(point=Point([1., 0., 0.]), direction=Vector([0, 1, 0]))
>>> plane_b = Plane([0, 0, 5], [0, 0, -8])
>>> plane_a.intersect_plane(plane_b)
Traceback (most recent call last):
...
ValueError: The planes must not be parallel.