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: [TypedPoint3D<T, U>; 4]
Points making the polygon.
plane: Plane<T, U>
A plane describing polygon orientation.
anchor: usize
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]
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,
pub fn from_points(points: [TypedPoint3D<T, U>; 4], anchor: usize) -> Self[src]
Construct a polygon from points that are already transformed.
pub fn from_transformed_rect<V>(
rect: TypedRect<T, V>,
transform: TypedTransform3D<T, V, U>,
anchor: usize
) -> Self where
T: Trig + Neg<Output = T>, [src]
rect: TypedRect<T, V>,
transform: TypedTransform3D<T, V, U>,
anchor: usize
) -> Self where
T: Trig + Neg<Output = T>,
Construct a polygon from a rectangle with 3D transform.
pub fn untransform_point(&self, point: TypedPoint3D<T, U>) -> Point2D<T>[src]
Bring a point into the local coordinate space, returning the 2D normalized coordinates.
pub fn is_valid(&self) -> bool[src]
Check if all the points are indeed placed on the plane defined by the normal and offset, and the winding order is consistent.
pub fn contains(&self, other: &Self) -> bool[src]
Check if this polygon contains another one.
pub fn project_on(&self, vector: &TypedVector3D<T, U>) -> LineProjection<T>[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.
pub fn intersect_plane(&self, other: &Plane<T, U>) -> Intersection<Line<T, U>>[src]
Compute the line of intersection with an infinite plane.
pub fn intersect(&self, other: &Self) -> Intersection<Line<T, U>>[src]
Compute the line of intersection with another polygon.
pub fn split(&mut self, line: &Line<T, U>) -> (Option<Self>, Option<Self>)[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> 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]
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,
fn cut(&self, plane: Self) -> PlaneCut<Self>[src]
Try to cut a different plane by this one.
fn is_aligned(&self, other: &Self) -> bool[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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<T: PartialEq, U: PartialEq> PartialEq for Polygon<T, U>[src]
fn eq(&self, __arg_0: &Polygon<T, U>) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Polygon<T, U>) -> bool[src]
This method tests for !=.