Plane

class compas.geometry.Plane[source]

Bases: Geometry

A plane is defined by a base point and a normal vector.

Parameters:
point[float, float, float] | compas.geometry.Point

The base point of the plane.

normal[float, float, float] | compas.geometry.Vector

The normal vector of the plane.

namestr, optional

The name of the plane.

Examples

>>> plane = Plane([0, 0, 0], [0, 0, 1])
>>> print(plane.point)
Point(x=0.000, y=0.000, z=0.000)
>>> print(plane.normal)
Vector(x=0.000, y=0.000, z=1.000)
Attributes:
abcdlist[float], read-only

The coefficients of the plane equation.

dfloat, read-only

The d parameter of the linear equation describing the plane.

normalcompas.geometry.Vector

The normal vector of the plane.

pointcompas.geometry.Plane

The base point of the plane.

Methods

closest_point

Compute the closest point on the plane to a given point.

contains_point

Verify if a given point lies in the plane.

distance_to_point

Compute the distance from a given point to the plane.

from_abcd

Construct a plane from the plane equation coefficients.

from_frame

Construct a plane from a frame.

from_point_and_two_vectors

Construct a plane from a base point and two vectors.

from_points

Construct a plane from a list of points.

from_three_points

Construct a plane from three points in three-dimensional space.

intersection_with_line

Compute the intersection of a plane and a line.

intersection_with_plane

Compute the intersection of two planes.

intersections_with_curve

Compute the intersection of a plane and a curve.

intersections_with_surface

Compute the intersection of a plane and a surface.

is_parallel

Verify if this plane is parallel to another plane.

is_perpendicular

Verify if this plane is perpendicular to another plane.

mirrored_point

Returns the mirror image of a given point.

offset

Returns a new offset plane by a given distance.

projected_point

Returns the projection of a given point onto the plane.

transform

Transform this plane.

worldXY

Construct the world XY plane.

worldYZ

Construct the world YZ plane.

worldZX

Construct the world ZX plane.

Inherited Methods

ToString

Converts the instance to a string.

compute_aabb

Compute the axis-aligned bounding box of the geometry.

compute_obb

Compute the oriented bounding box of the geometry.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

rotate

Rotate the geometry.

rotated

Returns a rotated copy of this geometry.

scale

Scale the geometry.

scaled

Returns a scaled copy of this geometry.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

transformed

Returns a transformed copy of this geometry.

translate

Translate the geometry.

translated

Returns a translated copy of this geometry.

validate_data

Validate the data against the object's data schema.