Struct plane_split::Plane

source ·
pub struct Plane {
    pub normal: Vector3D<f64>,
    pub offset: f64,
}
Expand description

An infinite plane in 3D space, defined by equation: dot(v, normal) + offset = 0 When used for plane splitting, it’s defining a hemisphere with equation “dot(v, normal) + offset > 0”.

Fields

normal: Vector3D<f64>

Normalized vector perpendicular to the plane.

offset: f64

Constant offset from the normal plane, specified in the direction opposite to the normal.

Implementations

Construct a new plane from unnormalized equation.

Check if this plane contains another one.

Return the signed distance from this plane to a point. The distance is negative if the point is on the other side of the plane from the direction of the normal.

Compute the distance across the line to the plane plane, starting from the line origin.

Compute the sum of signed distances to each of the points of another plane. Useful to know the relation of a plane that is a product of a split, and we know it doesn’t intersect self.

Check if a convex shape defined by a set of points is completely outside of this plane. Merely touching the surface is not considered an intersection.

Compute the line of intersection with another plane.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.