Struct plane_split::Polygon [] [src]

pub struct Polygon<T, U> {
    pub points: [TypedPoint3D<T, U>; 4],
    pub normal: TypedVector3D<T, U>,
    pub offset: T,
    pub anchor: usize,
}

A convex flat polygon with 4 points, defined by equation: dot(v, normal) + offset = 0

Fields

Points making the polygon.

Normalized vector perpendicular to the polygon plane.

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

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]

[src]

Construct a polygon from a transformed rectangle.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Check if this polygon contains another one.

[src]

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.

[src]

Compute the line of intersection with another polygon.

[src]

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> 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]

[src]

Try to cut a different plane by this one.

[src]

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]

[src]

Formats the value using the given formatter.

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

[src]

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

[src]

This method tests for !=.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more