[−][src]Struct gut::prim::triangle::Triangle
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]
indices: &[usize; 3],
slice: &[V]
) -> Triangle<T>
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]
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]
wrt_row: usize,
at_col: usize,
lambda: [T; 3]
) -> [[T; 3]; 3]
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]
fn area(self) -> T
[src]
fn signed_area(self) -> T
[src]
impl<T: BaseFloat + Neg<Output = T>> Area<T> for Triangle<T>
[src]
fn area(self) -> T
[src]
fn signed_area(self) -> 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.
fn index(&self, i: usize) -> &Self::Output
[src]
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,
T: Send,
impl<T> Sync for Triangle<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Triangle<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Triangle<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Triangle<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Bytes for T
[src]
impl<T> Pod for T where
T: 'static + Copy + Send + Sync + Any,
[src]
T: 'static + Copy + Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,