intersection_plane_circle

compas.geometry.intersection_plane_circle(plane, circle)[source]

Computes the intersection of a plane and a circle.

Parameters:
plane[point, vector] | compas.geometry.Plane

A plane defined by a point and normal vector.

circle[plane, float] | compas.geometry.Circle

A circle defined by a plane and radius.

Returns:
tuple[[float, float, float], [float, float, float]] | [float, float, float] | None

Two points (secant intersection), one point (tangent intersection), or None (otherwise).

Notes

There are 4 cases of plane-circle intersection:

  1. they intersect in 2 points (secant),

  2. they intersect in 1 point (tangent),

  3. they do not intersect, or

  4. they coincide (circle.plane == plane).

Examples

>>> plane = (0, 0, 0), (0, 0, 1)
>>> circle = ((0, 0, 0), (0, 1, 0)), 10.0
>>> x1, x2 = intersection_plane_circle(plane, circle)
>>> x1
(-10.0, 0.0, 0.0)
>>> x2
(10.0, 0.0, 0.0)