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

pub struct TetMeshExt<T: Real> {
    pub tetmesh: TetMesh<T>,
    pub cell_indices: Vec<usize>,
    pub cell_offsets: Vec<usize>,
    pub vertex_cell_attributes: AttribDict<VertexCellIndex>,
}

Mesh composed of tetrahedra, extended with its dual voronoi topology.

Fields

tetmesh: TetMesh<T>cell_indices: Vec<usize>

Lists of cell indices for each vertex. Since each vertex can have a variable number of cell neighbours, the cell_offsets field keeps track of where each subarray of indices begins.

cell_offsets: Vec<usize>

Offsets into the cell_indices array, one for each vertex. The last offset is always equal to the size of cell_indices for convenience.

vertex_cell_attributes: AttribDict<VertexCellIndex>

Vertex cell Attributes.

Methods

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

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

pub fn merge_with_vertex_source<'a, I>(
    meshes: I,
    source_attrib: &str
) -> Result<Self, Error> where
    I: IntoIterator<Item = &'a Self>,
    I::IntoIter: Clone
[src]

Merge a iterator of meshes into a single distinct mesh.

This version of merge accepts an attribute name for the source index on vertices.

The mesh vertices will be merged in the order given by the source attribute. This is useful when merging previously split up meshes. The source attribute needs to have type usize.

If the source attribute does not exist in at least one of the given meshes, then None is returned and the merge is aborted.

This is a non-destructive merge --- both original meshes remain intact. This also means that this way of merging is somewhat more expensive than a merge without any source indices.

impl<T: Real> TetMeshExt<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>) -> TetMeshExt<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) -> TetMeshExt<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) -> TetMeshExt<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> Attrib for TetMeshExt<T>[src]

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

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

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

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

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

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

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

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

fn default() -> Self[src]

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

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

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

impl<T: Real> Merge for TetMeshExt<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> NumCells for TetMeshExt<T>[src]

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

Define TetMeshExt topology

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

impl<T: Real> SplitIntoConnectedComponents<VertexIndex, CellIndex> for TetMeshExt<T>[src]

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

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

impl<T: Real> VertexCell for TetMeshExt<T>[src]

impl<T: Real> VertexCellAttrib for TetMeshExt<T>[src]

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

type Element = <TetMesh<T> as VertexPositions>::Element

Auto Trait Implementations

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

impl<T> Send for TetMeshExt<T>

impl<T> Sync for TetMeshExt<T>

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

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

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<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> Connectivity<VertexIndex, CellIndex> for M where
    M: NumVertices + CellVertex + VertexCell
[src]

type Topo = ()

Additional topology that may aid in computing connectivity. Read more

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

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

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<S, T> Rotated<T> for S where
    S: Rotate<T>,
    T: BaseFloat
[src]

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<S, T> Scaled<T> for S where
    S: Scale<T>,
    T: Copy
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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> Translated<T> for S where
    S: Translate<T>, 
[src]

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.

impl<M, T> VertexMesh<T> for M where
    M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
    T: Real
[src]