Plane

class Plane3(c)[source]

Bases: object

Create a plane object from linear coefficients

Parameters

c (array_like(4)) – Plane coefficients

Returns

a Plane object

Return type

Plane

Planes are represented by the 4-vector \([a, b, c, d]\) which describes the plane \(\pi: ax + by + cz + d=0\).

classmethod LinePoint(l, p)[source]

Create a plane object from a line and point

Parameters
  • l (Line3) – 3D line

  • p (ndarray(3)) – Points in the plane

Returns

a Plane object

Return type

Plane

Seealso

PointNormal() ThreePoints()

classmethod PointNormal(p, n)[source]

Create a plane object from point and normal

Parameters
  • p (array_like(3)) – Point in the plane

  • n (array_like(3)) – Normal vector to the plane

Returns

a Plane object

Return type

Plane

Seealso

ThreePoints() LinePoint()

classmethod ThreePoints(p)[source]

Create a plane object from three points

Parameters

p (ndarray(3,3)) – Three points in the plane

Returns

a Plane object

Return type

Plane

The points in p are arranged as columns.

Seealso

PointNormal() LinePoint()

classmethod TwoLines(l1, l2)[source]

Create a plane object from two line

Parameters
Returns

a Plane object

Return type

Plane

Warning

This algorithm fails if the lines are parallel.

Seealso

LinePoint() PointNormal() ThreePoints()

__init__(c)[source]
contains(p, tol=20)[source]

Test if point in plane

Parameters
  • p (array_like(3)) – A 3D point

  • tol (float) – tolerance in units of eps, defaults to 20

Returns

if the point is in the plane

Return type

bool

static intersection(pi1, pi2, pi3)[source]

Intersection point of three planes

Parameters
  • pi1 (Plane) – plane 1

  • pi2 (Plane) – plane 2

  • pi3 (Plane) – plane 3

Returns

coordinates of intersection point

Return type

ndarray(3)

This static method computes the intersection point of the three planes given as arguments.

Warning

This algorithm fails if the planes do not intersect, or intersect along a line.

Seealso

Plane()

plot(bounds=None, ax=None, **kwargs)[source]

Plot plane

Parameters
  • bounds (array_like(2|4|6), optional) – bounds of plot volume, defaults to None

  • ax (Axes, optional) – 3D axes to plot into, defaults to None

  • kwargs – optional arguments passed to plot_surface

The bounds of the 3D plot volume is [xmin, xmax, ymin, ymax, zmin, zmax] and a 3D plot is created if not already existing. If bounds is not provided it is taken from current 3D axes.

The plane is drawn using plot_surface.

Seealso

axes_logic()

property d: float

Plane offset

Returns

Offset of the plane

Return type

float

For a plane \(\pi: ax + by + cz + d=0\) this is the scalar \(d\).

Seealso

n()

property n: numpy.ndarray[Any, numpy.dtype[numpy.floating]]

Normal to the plane

Returns

Normal to the plane

Return type

ndarray(3)

For a plane \(\pi: ax + by + cz + d=0\) this is the vector \([a,b,c]\).

Seealso

d()