Struct parry3d::shape::Tetrahedron
source · #[repr(C)]pub struct Tetrahedron {
pub a: Point<Real>,
pub b: Point<Real>,
pub c: Point<Real>,
pub d: Point<Real>,
}
Expand description
A tetrahedron with 4 vertices.
Fields§
§a: Point<Real>
The tetrahedron’s first point.
b: Point<Real>
The tetrahedron’s second point.
c: Point<Real>
The tetrahedron’s third point.
d: Point<Real>
The tetrahedron’s fourth point.
Implementations§
source§impl Tetrahedron
impl Tetrahedron
sourcepub fn new(
a: Point<Real>,
b: Point<Real>,
c: Point<Real>,
d: Point<Real>
) -> Tetrahedron
pub fn new( a: Point<Real>, b: Point<Real>, c: Point<Real>, d: Point<Real> ) -> Tetrahedron
Creates a tetrahedron from four points.
sourcepub fn from_array(arr: &[Point<Real>; 4]) -> &Tetrahedron
pub fn from_array(arr: &[Point<Real>; 4]) -> &Tetrahedron
Creates the reference to a tetrahedron from the reference to an array of four points.
sourcepub fn face(&self, i: usize) -> Triangle
pub fn face(&self, i: usize) -> Triangle
Returns the i-th face of this tetrahedron.
The 0-th face is the triangle ABC. The 1-st face is the triangle ABD. The 2-nd face is the triangle ACD. The 3-rd face is the triangle BCD.
sourcepub fn face_ids(i: u32) -> (u32, u32, u32)
pub fn face_ids(i: u32) -> (u32, u32, u32)
Returns the i-th face of this tetrahedron.
The 0-th face is the triangle ABC. The 1-st face is the triangle ABD. The 2-nd face is the triangle ACD. The 3-rd face is the triangle BCD.
sourcepub fn edge(&self, i: u32) -> Segment
pub fn edge(&self, i: u32) -> Segment
Returns the i-th edge of this tetrahedron.
The 0-th edge is the segment AB. The 1-st edge is the segment AC. The 2-nd edge is the segment AD. The 3-rd edge is the segment BC. The 4-th edge is the segment BD. The 5-th edge is the segment CD.
sourcepub fn edge_ids(i: u32) -> (u32, u32)
pub fn edge_ids(i: u32) -> (u32, u32)
Returns the indices of the vertices of the i-th edge of this tetrahedron.
The 0-th edge is the segment AB. The 1-st edge is the segment AC. The 2-nd edge is the segment AD. The 3-rd edge is the segment BC. The 4-th edge is the segment BD. The 5-th edge is the segment CD.
sourcepub fn barycentric_coordinates(&self, p: &Point<Real>) -> Option<[Real; 4]>
pub fn barycentric_coordinates(&self, p: &Point<Real>) -> Option<[Real; 4]>
Computes the barycentric coordinates of the given point in the coordinate system of this tetrahedron.
Returns None
if this tetrahedron is degenerate.
sourcepub fn signed_volume(&self) -> Real
pub fn signed_volume(&self) -> Real
Computes the signed volume of this tetrahedron.
If it is positive, p4
is on the half-space pointed by the normal
of the oriented triangle (p1, p2, p3)
.
Trait Implementations§
source§impl Clone for Tetrahedron
impl Clone for Tetrahedron
source§fn clone(&self) -> Tetrahedron
fn clone(&self) -> Tetrahedron
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Tetrahedron
impl Debug for Tetrahedron
source§impl PointQuery for Tetrahedron
impl PointQuery for Tetrahedron
source§fn project_local_point(&self, pt: &Point<Real>, solid: bool) -> PointProjection
fn project_local_point(&self, pt: &Point<Real>, solid: bool) -> PointProjection
self
. Read moresource§fn project_local_point_and_get_feature(
&self,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
fn project_local_point_and_get_feature( &self, pt: &Point<Real> ) -> (PointProjection, FeatureId)
self
and returns the id of the
feature the point was projected on.source§fn project_local_point_with_max_dist(
&self,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<PointProjection>
fn project_local_point_with_max_dist( &self, pt: &Point<Real>, solid: bool, max_dist: Real ) -> Option<PointProjection>
self
, unless the projection lies further than the given max distance. Read moresource§fn project_point_with_max_dist(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<PointProjection>
fn project_point_with_max_dist( &self, m: &Isometry<Real>, pt: &Point<Real>, solid: bool, max_dist: Real ) -> Option<PointProjection>
self
transformed by m
, unless the projection lies further than the given max distance.source§fn distance_to_local_point(&self, pt: &Point<Real>, solid: bool) -> Real
fn distance_to_local_point(&self, pt: &Point<Real>, solid: bool) -> Real
self
.source§fn contains_local_point(&self, pt: &Point<Real>) -> bool
fn contains_local_point(&self, pt: &Point<Real>) -> bool
self
.source§fn project_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> PointProjection
fn project_point( &self, m: &Isometry<Real>, pt: &Point<Real>, solid: bool ) -> PointProjection
self
transformed by m
.source§fn distance_to_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> Real
fn distance_to_point( &self, m: &Isometry<Real>, pt: &Point<Real>, solid: bool ) -> Real
self
transformed by m
.source§fn project_point_and_get_feature(
&self,
m: &Isometry<Real>,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
fn project_point_and_get_feature( &self, m: &Isometry<Real>, pt: &Point<Real> ) -> (PointProjection, FeatureId)
self
transformed by m
and returns the id of the
feature the point was projected on.source§impl PointQueryWithLocation for Tetrahedron
impl PointQueryWithLocation for Tetrahedron
§type Location = TetrahedronPointLocation
type Location = TetrahedronPointLocation
source§fn project_local_point_and_get_location(
&self,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location)
fn project_local_point_and_get_location( &self, pt: &Point<Real>, solid: bool ) -> (PointProjection, Self::Location)
self
.source§fn project_point_and_get_location(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> (PointProjection, Self::Location)
fn project_point_and_get_location( &self, m: &Isometry<Real>, pt: &Point<Real>, solid: bool ) -> (PointProjection, Self::Location)
self
transformed by m
.source§fn project_local_point_and_get_location_with_max_dist(
&self,
pt: &Point<Real>,
solid: bool,
max_dist: Real
) -> Option<(PointProjection, Self::Location)>
fn project_local_point_and_get_location_with_max_dist( &self, pt: &Point<Real>, solid: bool, max_dist: Real ) -> Option<(PointProjection, Self::Location)>
self
, with a maximum projection distance.impl Copy for Tetrahedron
Auto Trait Implementations§
impl Freeze for Tetrahedron
impl RefUnwindSafe for Tetrahedron
impl Send for Tetrahedron
impl Sync for Tetrahedron
impl Unpin for Tetrahedron
impl UnwindSafe for Tetrahedron
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.