Struct plane_split::Polygon[][src]

pub struct Polygon<T, U> {
    pub points: [TypedPoint3D<T, U>; 4],
    pub plane: Plane<T, U>,
    pub anchor: usize,
}

A convex polygon with 4 points lying on a plane.

Fields

Points making the polygon.

A plane describing polygon orientation.

A simple anchoring index to allow association of the produced split polygons with the original one.

Methods

impl<T, U> Polygon<T, U> where
    T: Copy + Debug + ApproxEq<T> + Sub<T, Output = T> + Add<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + Zero + One + Float,
    U: Debug
[src]

Deprecated since 0.12.1

: Use try_from_points instead

Construct a polygon from points that are already transformed.

Construct a polygon from points that are already transformed. Return None if the polygon doesn't contain any space. This method will be removed in from_points in the next breaking release.

Construct a polygon from a non-transformed rectangle.

Construct a polygon from a rectangle with 3D transform.

Bring a point into the local coordinate space, returning the 2D normalized coordinates.

Transform a polygon by an affine transform (preserving straight lines).

Check if all the points are indeed placed on the plane defined by the normal and offset, and the winding order is consistent.

Check if the polygon doesn't contain any space. This may happen after a sequence of splits, and such polygons should be discarded.

Check if this polygon contains another one.

Project this polygon onto a 3D vector, returning a line projection. Note: we can think of it as a projection to a ray placed at the origin.

Compute the line of intersection with an infinite plane.

Compute the line of intersection with another polygon.

Split the polygon along the specified Line. Will do nothing if the line doesn't belong to the polygon plane.

Trait Implementations

impl<T, U> BspPlane for Polygon<T, U> where
    T: Copy + Debug + ApproxEq<T> + Sub<T, Output = T> + Add<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + Zero + One + Float,
    U: Debug
[src]

Try to cut a different plane by this one.

Check if a different plane is aligned in the same direction as this one. Read more

impl<T: Debug, U: Debug> Debug for Polygon<T, U>
[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq, U: PartialEq> PartialEq for Polygon<T, U>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Clone, U> Clone for Polygon<T, U>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T, U> Send for Polygon<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for Polygon<T, U> where
    T: Sync,
    U: Sync