[−][src]Struct plane_split::Polygon
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]
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, pub fn from_points(
points: [TypedPoint3D<T, U>; 4],
anchor: usize
) -> Option<Self>[src]
pub fn from_points(
points: [TypedPoint3D<T, U>; 4],
anchor: usize
) -> Option<Self>Construct a polygon from points that are already transformed. Return None if the polygon doesn't contain any space.
pub fn from_rect(rect: TypedRect<T, U>, anchor: usize) -> Self[src]
pub fn from_rect(rect: TypedRect<T, U>, anchor: usize) -> SelfConstruct a polygon from a non-transformed rectangle.
pub fn from_transformed_rect<V>(
rect: TypedRect<T, V>,
transform: TypedTransform3D<T, V, U>,
anchor: usize
) -> Option<Self> where
T: Trig + Neg<Output = T>, [src]
pub fn from_transformed_rect<V>(
rect: TypedRect<T, V>,
transform: TypedTransform3D<T, V, U>,
anchor: usize
) -> 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: TypedRect<T, V>,
transform: &TypedTransform3D<T, V, U>,
inv_transform: &TypedTransform3D<T, U, V>,
anchor: usize
) -> Option<Self> where
T: Trig + Neg<Output = T>, [src]
pub fn from_transformed_rect_with_inverse<V>(
rect: TypedRect<T, V>,
transform: &TypedTransform3D<T, V, U>,
inv_transform: &TypedTransform3D<T, U, V>,
anchor: usize
) -> 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: TypedPoint3D<T, U>) -> Point2D<T>[src]
pub fn untransform_point(&self, point: TypedPoint3D<T, U>) -> Point2D<T>Bring a point into the local coordinate space, returning the 2D normalized coordinates.
pub fn transform<V>(
&self,
transform: &TypedTransform3D<T, U, V>
) -> Option<Polygon<T, V>> where
T: Trig,
V: Debug, [src]
pub fn transform<V>(
&self,
transform: &TypedTransform3D<T, U, V>
) -> Option<Polygon<T, V>> where
T: Trig,
V: Debug, Transform a polygon by an affine transform (preserving straight lines).
pub fn is_valid(&self) -> bool[src]
pub fn is_valid(&self) -> boolCheck 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]
pub fn is_empty(&self) -> boolCheck 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]
pub fn contains(&self, other: &Self) -> boolCheck if this polygon contains another one.
pub fn project_on(&self, vector: &TypedVector3D<T, U>) -> LineProjection<T>[src]
pub fn project_on(&self, vector: &TypedVector3D<T, U>) -> LineProjection<T>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]
pub fn intersect_plane(&self, other: &Plane<T, U>) -> Intersection<Line<T, U>>Compute the line of intersection with an infinite plane.
pub fn intersect(&self, other: &Self) -> Intersection<Line<T, U>>[src]
pub fn intersect(&self, other: &Self) -> Intersection<Line<T, U>>Compute the line of intersection with another polygon.
pub fn split(&mut self, line: &Line<T, U>) -> (Option<Self>, Option<Self>)[src]
pub fn split(&mut self, line: &Line<T, U>) -> (Option<Self>, Option<Self>)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]
impl<T: PartialEq, U: PartialEq> PartialEq<Polygon<T, U>> for Polygon<T, U>fn eq(&self, other: &Polygon<T, U>) -> bool[src]
fn eq(&self, other: &Polygon<T, U>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Polygon<T, U>) -> bool[src]
fn ne(&self, other: &Polygon<T, U>) -> boolThis method tests for !=.
impl<T: Clone, U> Clone for Polygon<T, U>[src]
impl<T: Clone, U> Clone for Polygon<T, U>fn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T: Debug, U: Debug> Debug for Polygon<T, U>[src]
impl<T: Debug, U: Debug> Debug for Polygon<T, U>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats 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]
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, Auto Trait Implementations
impl<T, U> Send for Polygon<T, U> where
T: Send,
U: Send,
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,
impl<T, U> Sync for Polygon<T, U> where
T: Sync,
U: Sync, Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 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]
impl<T, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 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