[][src]Struct plane_split::Polygon

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]

Construct a polygon from points that are already transformed. Return None if the polygon doesn't contain any space.

Construct a polygon from a non-transformed rectangle.

Construct a polygon from a rectangle with 3D transform.

Construct a polygon from a rectangle with an invertible 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: PartialEq, U: PartialEq> PartialEq<Polygon<T, U>> 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

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

Formats the value using the given formatter. Read more

impl<T, U> Plane 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

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

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more