[][src]Struct gut::prim::triangle::Triangle

pub struct Triangle<T>(pub Vector3<T>, pub Vector3<T>, pub Vector3<T>);

Generic triangle with three points

Methods

impl<T: Clone> Triangle<T>[src]

pub fn from_indexed_slice<V: Into<[T; 3]> + Clone>(
    indices: &[usize; 3],
    slice: &[V]
) -> Triangle<T>
[src]

Build a Triangle from a triplet of indices.

pub fn new([a, b, c]: [[T; 3]; 3]) -> Self[src]

Build a new triangle from an array of vertex positions.

impl<T: Pod> Triangle<T>[src]

pub fn as_array(&self) -> &[[T; 3]; 3][src]

Return this triangle as an array of vertex positions.

This can be useful for performing custom arithmetic on the triangle positions.

impl<T> Triangle<T>[src]

pub fn into_array(self) -> [[T; 3]; 3][src]

Convert this triangle into an array of vertex positions.

impl<T: BaseNum + Neg<Output = T>> Triangle<T>[src]

pub fn area_normal(&self) -> [T; 3][src]

Compute the area weighted normal of this triangle. This is the standard way to compute the normal and the area of the triangle.

pub fn area_normal_gradient(&self, wrt: usize) -> [[T; 3]; 3][src]

Compute the gradient of the area weighted normal with respect to the given vertex. The returned matrix is in column-major format.

pub fn area_normal_hessian_product(
    wrt_row: usize,
    at_col: usize,
    lambda: [T; 3]
) -> [[T; 3]; 3]
[src]

Compute the hessian of the area weighted normal with respect to the given vertex (row index) at a given vertex (column index) multiplied by a given vector (lambda).

The returned matrix is in column-major format.

Trait Implementations

impl<'a, T: BaseNum> Centroid<Vector3<T>> for &'a Triangle<T>[src]

impl<'a, T: BaseNum> Centroid<[T; 3]> for &'a Triangle<T>[src]

impl<'a, T: BaseFloat + Neg<Output = T>> Area<T> for &'a Triangle<T>[src]

impl<T: BaseFloat + Neg<Output = T>> Area<T> for Triangle<T>[src]

impl<'a, T: BaseNum> ShapeMatrix<[[T; 3]; 2]> for &'a Triangle<T>[src]

Returns a column major 3x2 matrix.

impl<T: BaseNum> ShapeMatrix<[[T; 3]; 2]> for Triangle<T>[src]

Returns a column major 3x2 matrix.

impl<'a, T: BaseFloat + Neg<Output = T>> Normal<Vector3<T>> for &'a Triangle<T>[src]

impl<'a, T: BaseFloat + Neg<Output = T>> Normal<[T; 3]> for &'a Triangle<T>[src]

impl<T: Clone> Clone for Triangle<T>[src]

impl<T: Copy> Copy for Triangle<T>[src]

impl<T: PartialEq> PartialEq<Triangle<T>> for Triangle<T>[src]

impl<T: Debug> Debug for Triangle<T>[src]

impl<T: BaseNum> Index<usize> for Triangle<T>[src]

type Output = Vector3<T>

The returned type after indexing.

impl<T: BaseNum> IndexMut<usize> for Triangle<T>[src]

impl<T> StructuralPartialEq for Triangle<T>[src]

Auto Trait Implementations

impl<T> Send for Triangle<T> where
    T: Send

impl<T> Sync for Triangle<T> where
    T: Sync

impl<T> Unpin for Triangle<T> where
    T: Unpin

impl<T> UnwindSafe for Triangle<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Triangle<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Bytes for T[src]

impl<T> Pod for T where
    T: 'static + Copy + Send + Sync + Any
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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 = !

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.

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

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

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