pub struct Quad2d<T: Scalar>(pub [Point2<T>; 4]);Expand description
A quadrilateral consisting of four vertices, assumed to be specified in counter-clockwise winding order.
Tuple Fields§
§0: [Point2<T>; 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) -> (Triangle2d<T>, Triangle2d<T>)
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) -> AxisAlignedBoundingBox2d<T>
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: &Point2<T>) -> 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].impl<T: Copy + Scalar> Copy for Quad2d<T>
impl<T: Eq + Scalar> Eq for Quad2d<T>
impl<T: Scalar> StructuralPartialEq for Quad2d<T>
Auto Trait Implementations§
impl<T> Freeze for Quad2d<T>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.