pub struct Triangle {
pub id: u32,
pub a: Point3,
pub b: Point3,
pub c: Point3,
pub bounds: Bounds3,
pub normal: Point3,
pub face: u32,
}Expand description
One triangle with its cached bounds, unit normal and source face.
Fields§
§id: u32Position in the snapshot’s triangles.
a: Point3§b: Point3§c: Point3§bounds: Bounds3§normal: Point3Unit normal (b - a) × (c - a), normalized. Degenerate triangles never enter a snapshot.
face: u32Index into MeshSnapshot::faces.
Implementations§
Source§impl Triangle
impl Triangle
pub fn vertices(&self) -> [Point3; 3]
Sourcepub fn area_vector(&self) -> Point3
pub fn area_vector(&self) -> Point3
Twice the signed area vector; its length is twice the area.
pub fn area(&self) -> f64
pub fn centroid(&self) -> Point3
Sourcepub fn is_vertical(&self, tol: &Tolerance) -> bool
pub fn is_vertical(&self, tol: &Tolerance) -> bool
The triangle’s plane is vertical (normal perpendicular to Z) within the tolerance.
Sourcepub fn is_horizontal(&self, tol: &Tolerance) -> bool
pub fn is_horizontal(&self, tol: &Tolerance) -> bool
The triangle’s plane is horizontal within the tolerance.
pub fn min_z(&self) -> f64
pub fn max_z(&self) -> f64
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Triangle
impl<'de> Deserialize<'de> for Triangle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Triangle
Auto Trait Implementations§
impl Forget for Triangle
impl Freeze for Triangle
impl Move 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