Struct parry3d::shape::Tetrahedron[][src]

#[repr(C)]pub struct Tetrahedron {
    pub a: Point<Real>,
    pub b: Point<Real>,
    pub c: Point<Real>,
    pub d: Point<Real>,
}

A tetrahedron with 4 vertices.

Fields

a: Point<Real>

The tetrahedron first point.

b: Point<Real>

The tetrahedron first point.

c: Point<Real>

The tetrahedron first point.

d: Point<Real>

The tetrahedron first point.

Implementations

impl Tetrahedron[src]

pub fn new(
    a: Point<Real>,
    b: Point<Real>,
    c: Point<Real>,
    d: Point<Real>
) -> Tetrahedron
[src]

Creates a tetrahedron from three points.

pub fn from_array(arr: &[Point<Real>; 4]) -> &Tetrahedron[src]

Creates the reference to a tetrahedron from the reference to an array of four points.

pub fn face(&self, i: usize) -> Triangle[src]

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.

pub fn face_ids(i: u32) -> (u32, u32, u32)[src]

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.

pub fn edge(&self, i: u32) -> Segment[src]

Returns the i-th edge of this tetrahedron.

The 0-st 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.

pub fn edge_ids(i: u32) -> (u32, u32)[src]

Returns the indices of the vertices of the i-th edge of this tetrahedron.

The 0-st 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.

pub fn barycentric_coordinates(&self, p: &Point<Real>) -> Option<[Real; 4]>[src]

Computes the barycentric coordinates of the given point in the coordinate system of this tetrahedron.

Returns None if this tetrahedron is degenerate.

pub fn volume(&self) -> Real[src]

Computes the volume of this tetrahedron.

pub fn signed_volume(&self) -> Real[src]

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).

pub fn center(&self) -> Point<Real>[src]

Computes the center of this tetrahedron.

Trait Implementations

impl Clone for Tetrahedron[src]

impl Copy for Tetrahedron[src]

impl Debug for Tetrahedron[src]

impl PointQuery for Tetrahedron[src]

impl PointQueryWithLocation for Tetrahedron[src]

type Location = TetrahedronPointLocation

Additional shape-specific projection information Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.