pub struct Quad2d<T>(pub [OPoint<T, Const<2>>; 4])
where
T: Scalar;
Expand description
A quadrilateral consisting of four vertices, assumed to be specified in counter-clockwise winding order.
Tuple Fields§
§0: [OPoint<T, Const<2>>; 4]
Implementations§
source§impl<T> Quad2d<T>where
T: Real,
impl<T> Quad2d<T>where T: Real,
sourcepub fn concave_corner(&self) -> Option<usize>
pub fn concave_corner(&self) -> Option<usize>
Returns the index of a concave corner of the quadrilateral, if there is any.
sourcepub fn split_into_triangle_connectivities(&self) -> ([usize; 3], [usize; 3])
pub fn split_into_triangle_connectivities(&self) -> ([usize; 3], [usize; 3])
Splits the quad into two triangles represented by local indices { 0, 1, 2, 3 } which correspond to the quad’s vertices.
While the quad may be concave, it is assumed that it has no self-intersections and that all vertices are unique.
pub fn split_into_triangles( &self ) -> (Triangle<T, Const<2>>, Triangle<T, Const<2>>)
pub fn area(&self) -> T
Trait Implementations§
source§impl<T> BoundedGeometry<T> for Quad2d<T>where
T: Real,
impl<T> BoundedGeometry<T> for Quad2d<T>where T: Real,
type Dimension = Const<2>
fn bounding_box(&self) -> AxisAlignedBoundingBox<T, Const<2>>
source§impl<T> Distance<T, OPoint<T, Const<2>>> for Quad2d<T>where
T: Real,
impl<T> Distance<T, OPoint<T, Const<2>>> for Quad2d<T>where T: Real,
fn distance(&self, point: &OPoint<T, Const<2>>) -> T
source§fn distance_bound(&self, query_geometry: &QueryGeometry) -> [T; 2]
fn distance_bound(&self, query_geometry: &QueryGeometry) -> [T; 2]
Returns an interval
[l, u]
for the distance d
, such that d
is contained in [l, u]
.source§impl<T> PartialEq<Quad2d<T>> for Quad2d<T>where
T: PartialEq<T> + Scalar,
impl<T> PartialEq<Quad2d<T>> for Quad2d<T>where T: PartialEq<T> + Scalar,
source§impl<T> TryFrom<Quad2d<T>> for ConvexPolygon<T>where
T: Real,
impl<T> TryFrom<Quad2d<T>> for ConvexPolygon<T>where T: Real,
§type Error = ConcavePolygonError
type Error = ConcavePolygonError
The type returned in the event of a conversion error.
source§fn try_from(
value: Quad2d<T>
) -> Result<ConvexPolygon<T>, <ConvexPolygon<T> as TryFrom<Quad2d<T>>>::Error>
fn try_from( value: Quad2d<T> ) -> Result<ConvexPolygon<T>, <ConvexPolygon<T> as TryFrom<Quad2d<T>>>::Error>
Performs the conversion.
impl<T> Copy for Quad2d<T>where T: Copy + Scalar,
impl<T> Eq for Quad2d<T>where T: Eq + Scalar,
impl<T> StructuralEq for Quad2d<T>where T: Scalar,
impl<T> StructuralPartialEq for Quad2d<T>where T: Scalar,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Quad2d<T>where T: RefUnwindSafe,
impl<T> Send for Quad2d<T>where T: Send,
impl<T> Sync for Quad2d<T>where T: Sync,
impl<T> Unpin for Quad2d<T>where T: Unpin,
impl<T> UnwindSafe for Quad2d<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.