pub struct Triangle {
pub v0: Point3<f64>,
pub v1: Point3<f64>,
pub v2: Point3<f64>,
}Expand description
Triangle definition
Fields§
§v0: Point3<f64>§v1: Point3<f64>§v2: Point3<f64>Implementations§
Source§impl Triangle
impl Triangle
Sourcepub fn cross_product(&self) -> Vector3<f64>
pub fn cross_product(&self) -> Vector3<f64>
Calculate the cross product of edges, which is twice the area vector.
Returns a Vector3<f64> perpendicular to the triangle plane.
For degenerate/collinear triangles, returns the zero vector.
Use is_degenerate() or try_normalize() on the result if you need
to detect and handle degenerate cases.
Sourcepub fn is_degenerate(&self, epsilon: f64) -> bool
pub fn is_degenerate(&self, epsilon: f64) -> bool
Check if triangle is degenerate (zero area, collinear vertices).
Uses try_normalize on the cross product with the specified epsilon.
Returns true if the cross product cannot be normalized (i.e., degenerate).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnsafeUnpin for Triangle
impl UnwindSafe for Triangle
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<T> Pointable for T
impl<T> Pointable for T
Source§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.