[][src]Struct gut::mesh::tetmesh::TetMesh

pub struct TetMesh<T: Real> {
    pub vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>,
    pub indices: IntrinsicAttribute<[usize; 4], CellIndex>,
    pub vertex_attributes: AttribDict<VertexIndex>,
    pub cell_attributes: AttribDict<CellIndex>,
    pub cell_vertex_attributes: AttribDict<CellVertexIndex>,
    pub cell_face_attributes: AttribDict<CellFaceIndex>,
}

A basic mesh composed of tetrahedra. This mesh is based on vertex positions and a list of vertex indices representing tetrahedra.

Fields

vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>

Vertex positions.

indices: IntrinsicAttribute<[usize; 4], CellIndex>

Quadruples of indices into vertices representing tetrahedra. The canonical non-inverted tetrahedron is indexed as follows:

      3
     /|\
    / | \
   /  |  \
 2/...|...\0
  \   |   /
   \  |  /
    \ | /
     \|/
      1

(the dotted line is behind the dashed).

vertex_attributes: AttribDict<VertexIndex>

Vertex Attributes.

cell_attributes: AttribDict<CellIndex>

Cell Attributes.

cell_vertex_attributes: AttribDict<CellVertexIndex>

Cell vertex Attributes.

cell_face_attributes: AttribDict<CellFaceIndex>

Cell face Attributes.

Methods

impl<T: Real> TetMesh<T>[src]

pub fn surface_topo(&self) -> Vec<[usize; 3]>[src]

Extract the surface topology (triangles) of the TetMesh. This function assumes that the given tetmesh is a manifold.

pub fn surface_triangle_data(&self) -> (Vec<[usize; 3]>, Vec<usize>, Vec<usize>)[src]

Extract the surface triangle information of the TetMesh. This includes the triangle topology, which tet each triangle came from and which face on the originating tet it belongs to. The returned vectors have the same size. This function assumes that the given tetmesh is a manifold.

pub fn surface_vertices(&self) -> Vec<usize>[src]

Extract indices of vertices that are on the surface of this TetMesh.

pub fn surface_trimesh(&self) -> TriMesh<T>[src]

Convert into a mesh of triangles representing the surface of this TetMesh.

pub fn surface_trimesh_with_mapping(
    &self,
    original_vertex_index_name: Option<&str>,
    original_tet_index_name: Option<&str>,
    original_tet_vertex_index_name: Option<&str>,
    original_tet_face_index_name: Option<&str>
) -> TriMesh<T>
[src]

Convert into a mesh of triangles representing the surface of this TetMesh. Additionally this function adds attributes that map the new triangle mesh to the original tetmesh.

Note that if the given attribute name coincides with an existing vertex attribute, that attribute will be replaced with the original tetmesh vertex attribute.

impl<T: Real> TetMesh<T>[src]

pub const TET_FACES: [[usize; 3]; 4][src]

This constant defines the triangle faces of each tet. The rule is that ith face of the tet is the one opposite to the ith vertex. The triangle starts with the smallest index.

pub fn new(verts: Vec<[T; 3]>, indices: Vec<usize>) -> TetMesh<T>[src]

pub fn cell_iter(&self) -> Iter<[usize; 4]>[src]

pub fn cell_iter_mut(&mut self) -> IterMut<[usize; 4]>[src]

pub fn cell<CI: Into<CellIndex>>(&self, cidx: CI) -> &[usize; 4][src]

Cell accessor. These are vertex indices.

pub fn cells(&self) -> &[[usize; 4]][src]

Return a slice of individual cells.

pub fn tet_iter<'a>(&'a self) -> impl Iterator<Item = Tetrahedron<T>> + 'a[src]

Tetrahedron iterator.

pub fn tet_from_indices(&self, indices: &[usize; 4]) -> Tetrahedron<T>[src]

Get a tetrahedron primitive corresponding to the given vertex indices.

pub fn tet<CI: Into<CellIndex>>(&self, cidx: CI) -> Tetrahedron<T>[src]

Get a tetrahedron primitive corresponding to the given cell index.

pub fn inverted(self) -> TetMesh<T>[src]

Consumes the current mesh to produce a mesh with inverted tetrahedra.

pub fn invert(&mut self)[src]

Non consuming verion of the inverted function which simply modifies the given mesh.

pub fn canonicalized(self) -> TetMesh<T>[src]

Convert this mesh into canonical form. This function inverts any inverted tetrahedron such that all tetrahedra are in canonical (non-inverted) form. The canonical form is determined by the shape matrix determinant of each tetrahedron. Canonical tetrahedra have a positive shape matrix determinant (see the gut::ops::ShapeMatrix trait and the gut::prim::tetrahedron module).

pub fn canonicalize(&mut self)[src]

Convert this mesh into canonical form. This function inverts any inverted tetrahedron such that all tetrahedra are in canonical (non-inverted) form. This is a non-consuming version of canonicalized.

Trait Implementations

impl<T: Real> SplitIntoConnectedComponents<VertexCellIndex> for TetMesh<T>[src]

impl<T: Real> Merge for TetMesh<T>[src]

fn merge(&mut self, other: Self) -> &mut Self[src]

Attributes with the same name but different types won't be merged.

impl<T: Real> NumVertices for TetMesh<T>[src]

Define TetMesh topology

impl<T: Real> NumCells for TetMesh<T>[src]

impl<T: Real> Attrib for TetMesh<T>[src]

impl<T: Real> VertexPositions for TetMesh<T>[src]

type Element = [T; 3]

impl<T: Real> CellVertex for TetMesh<T>[src]

impl<T: Real> CellFace for TetMesh<T>[src]

impl<T: Real> VertexAttrib for TetMesh<T>[src]

impl<T: Real> CellAttrib for TetMesh<T>[src]

impl<T: Real> CellVertexAttrib for TetMesh<T>[src]

impl<T: Real> CellFaceAttrib for TetMesh<T>[src]

impl<T: Real> From<TetMesh<T>> for PointCloud<T>[src]

Convert a tet mesh to a point cloud by erasing all tet data.

impl<T: Real> From<TetMesh<T>> for TriMesh<T>[src]

impl<T: Real> From<TetMesh<T>> for PolyMesh<T>[src]

impl<T: Real> From<TetMesh<T>> for TetMeshExt<T>[src]

impl<T: Real> From<TetMeshExt<T>> for TetMesh<T>[src]

impl<T: Clone + Real> Clone for TetMesh<T>[src]

impl<T: Real> Default for TetMesh<T>[src]

fn default() -> Self[src]

Produce an empty TetMesh. This is not particularly useful on its own, however it can be used as a null case for various mesh algorithms.

impl<T: PartialEq + Real> PartialEq<TetMesh<T>> for TetMesh<T>[src]

impl<T: Debug + Real> Debug for TetMesh<T>[src]

impl<T: Real> StructuralPartialEq for TetMesh<T>[src]

Auto Trait Implementations

impl<T> Send for TetMesh<T>

impl<T> Sync for TetMesh<T>

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

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

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

Blanket Implementations

impl<T, M> Scale<T> for M where
    M: VertexPositions<Element = [T; 3]>,
    T: BaseFloat
[src]

fn scale(&mut Self, [T; 3])[src]

Scale a mesh in 3D by a given vector of scale factors. s = [1.0; 3] corresponds to a noop.

impl<T, M> Rotate<T> for M where
    M: VertexPositions<Element = [T; 3]>,
    T: BaseFloat
[src]

fn rotate_by_matrix(&mut Self, [[T; 3]; 3])[src]

Rotate the mesh using the given column-major rotation matrix.

impl<T, M> Translate<T> for M where
    M: VertexPositions<Element = [T; 3]>,
    T: BaseFloat
[src]

fn translate(&mut Self, [T; 3])[src]

Translate the mesh by the given translation vector (displacement) t.

impl<S, T> Scaled<T> for S where
    S: Scale<T>,
    T: Copy
[src]

impl<S, T> Rotated<T> for S where
    S: Rotate<T>,
    T: BaseFloat
[src]

impl<S, T> Translated<T> for S where
    S: Translate<T>, 
[src]

impl<M, T> BoundingBox<T> for M where
    M: VertexPositions<Element = [T; 3]>,
    T: Real
[src]

fn bounding_box(&Self) -> BBox<T>[src]

Compute the bounding box of this object.

impl<T> Bytes for T[src]

impl<M, T> VertexMesh<T> for M where
    M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
    T: Real
[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]