[−][src]Struct plane_split::Polygon
A convex polygon with 4 points lying on a plane.
Fields
points: [Point3D<T, U>; 4]
Points making the polygon.
plane: Plane<T, U>
A plane describing polygon orientation.
anchor: A
A simple anchoring index to allow association of the produced split polygons with the original one.
Implementations
impl<T, U, A> Polygon<T, U, A> 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,
A: Copy,
[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,
A: Copy,
pub fn from_points(points: [Point3D<T, U>; 4], anchor: A) -> Option<Self>
[src]
Construct a polygon from points that are already transformed. Return None if the polygon doesn't contain any space.
pub fn from_rect(rect: Rect<T, U>, anchor: A) -> Self
[src]
Construct a polygon from a non-transformed rectangle.
pub fn from_transformed_rect<V>(
rect: Rect<T, V>,
transform: Transform3D<T, V, U>,
anchor: A
) -> Option<Self> where
T: Trig + Neg<Output = T>,
[src]
rect: Rect<T, V>,
transform: Transform3D<T, V, U>,
anchor: A
) -> Option<Self> where
T: Trig + Neg<Output = T>,
Construct a polygon from a rectangle with 3D transform.
pub fn from_transformed_rect_with_inverse<V>(
rect: Rect<T, V>,
transform: &Transform3D<T, V, U>,
inv_transform: &Transform3D<T, U, V>,
anchor: A
) -> Option<Self> where
T: Trig + Neg<Output = T>,
[src]
rect: Rect<T, V>,
transform: &Transform3D<T, V, U>,
inv_transform: &Transform3D<T, U, V>,
anchor: A
) -> Option<Self> where
T: Trig + Neg<Output = T>,
Construct a polygon from a rectangle with an invertible 3D transform.
pub fn untransform_point(&self, point: Point3D<T, U>) -> Point2D<T>
[src]
Bring a point into the local coordinate space, returning the 2D normalized coordinates.
pub fn transform<V>(
&self,
transform: &Transform3D<T, U, V>
) -> Option<Polygon<T, V, A>> where
T: Trig,
V: Debug,
[src]
&self,
transform: &Transform3D<T, U, V>
) -> Option<Polygon<T, V, A>> where
T: Trig,
V: Debug,
Transform a polygon by an affine transform (preserving straight lines).
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 is_empty(&self) -> bool
[src]
Check if the polygon doesn't contain any space. This may happen after a sequence of splits, and such polygons should be discarded.
pub fn contains(&self, other: &Self) -> bool
[src]
Check if this polygon contains another one.
pub fn project_on(&self, vector: &Vector3D<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]
Use split_with_normal instead
Split the polygon along the specified Line
.
Will do nothing if the line doesn't belong to the polygon plane.
pub fn split_with_normal(
&mut self,
line: &Line<T, U>,
normal: &Vector3D<T, U>
) -> (Option<Self>, Option<Self>)
[src]
&mut self,
line: &Line<T, U>,
normal: &Vector3D<T, U>
) -> (Option<Self>, Option<Self>)
Split the polygon along the specified Line
, with a normal to the split line provided.
This is useful when called by the plane splitter, since the other plane's normal
forms the side direction here, and figuring out the actual line of split isn't needed.
Will do nothing if the line doesn't belong to the polygon plane.
Trait Implementations
impl<T: Clone, U, A: Copy> Clone for Polygon<T, U, A>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, U: Debug, A: Debug> Debug for Polygon<T, U, A>
[src]
impl<T: PartialEq, U: PartialEq, A: PartialEq> PartialEq<Polygon<T, U, A>> for Polygon<T, U, A>
[src]
pub fn eq(&self, other: &Polygon<T, U, A>) -> bool
[src]
pub fn ne(&self, other: &Polygon<T, U, A>) -> bool
[src]
impl<T, U, A> Plane for Polygon<T, U, A> where
T: Copy + Debug + ApproxEq<T> + Sub<T, Output = T> + Add<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + Zero + Float,
U: Debug,
A: Copy + Debug,
[src]
T: Copy + Debug + ApproxEq<T> + Sub<T, Output = T> + Add<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + Zero + Float,
U: Debug,
A: Copy + Debug,
pub fn cut(&self, poly: Self) -> PlaneCut<Self>
[src]
pub fn is_aligned(&self, other: &Self) -> bool
[src]
impl<T, U, A> StructuralPartialEq for Polygon<T, U, A>
[src]
Auto Trait Implementations
impl<T, U, A> RefUnwindSafe for Polygon<T, U, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U, A> Send for Polygon<T, U, A> where
A: Send,
T: Send,
U: Send,
A: Send,
T: Send,
U: Send,
impl<T, U, A> Sync for Polygon<T, U, A> where
A: Sync,
T: Sync,
U: Sync,
A: Sync,
T: Sync,
U: Sync,
impl<T, U, A> Unpin for Polygon<T, U, A> where
A: Unpin,
T: Unpin,
U: Unpin,
A: Unpin,
T: Unpin,
U: Unpin,
impl<T, U, A> UnwindSafe for Polygon<T, U, A> where
A: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
A: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,