[−][src]Struct gut::mesh::tetmesh::TetMeshExt
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]
meshes: I,
source_attrib: &str
) -> Result<Self, Error> where
I: IntoIterator<Item = &'a Self>,
I::IntoIter: Clone,
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 i
th face of the
tet is the one opposite to the i
th 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]
fn attrib_size<I: AttribIndex<Self>>(&self) -> usize
[src]
fn attrib_dict<I: AttribIndex<Self>>(&self) -> &AttribDict<I>
[src]
fn attrib_dict_mut<I: AttribIndex<Self>>(&mut self) -> &mut AttribDict<I>
[src]
fn add_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn add_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
fn set_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn set_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
fn duplicate_attrib<'a, 'b, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn remove_attrib<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str
) -> Result<Attribute<I>, Error>
[src]
&mut self,
name: &'a str
) -> Result<Attribute<I>, Error>
fn insert_attrib<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error>
[src]
&mut self,
name: &'a str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error>
fn attrib_or_add<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn attrib_or_add_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
fn attrib_iter<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Iter<T>, Error> where
T: 'static + Clone,
[src]
&'b self,
name: &'a str
) -> Result<Iter<T>, Error> where
T: 'static + Clone,
fn attrib_iter_mut<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<IterMut<T>, Error> where
T: 'static + Clone,
[src]
&'b mut self,
name: &'a str
) -> Result<IterMut<T>, Error> where
T: 'static + Clone,
fn attrib_exists<'a, I: AttribIndex<Self>>(&self, name: &'a str) -> bool
[src]
fn attrib_check<'a, T: Any, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
[src]
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib_as_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<&'b [T], Error>
[src]
&'b self,
name: &'a str
) -> Result<&'b [T], Error>
fn attrib_as_mut_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error>
[src]
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error>
fn attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: 'static + Clone,
[src]
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: 'static + Clone,
fn attrib<'a, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
[src]
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib_mut<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str
) -> Result<&mut Attribute<I>, Error>
[src]
&mut self,
name: &'a str
) -> Result<&mut Attribute<I>, Error>
impl<T: Real> CellAttrib for TetMeshExt<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<CellIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<CellIndex>
[src]
impl<T: Real> CellFace for TetMeshExt<T>
[src]
fn face<CFI>(&self, cf_idx: CFI) -> FaceIndex where
CFI: Copy + Into<CellFaceIndex>,
[src]
CFI: Copy + Into<CellFaceIndex>,
fn cell_face<CI>(&self, cidx: CI, which: usize) -> Option<CellFaceIndex> where
CI: Copy + Into<CellIndex>,
[src]
CI: Copy + Into<CellIndex>,
fn num_cell_faces(&self) -> usize
[src]
fn num_faces_at_cell<CI>(&self, cidx: CI) -> usize where
CI: Copy + Into<CellIndex>,
[src]
CI: Copy + Into<CellIndex>,
fn cell_to_face<I>(&self, i: I, k: usize) -> Option<FaceIndex> where
I: Copy + Into<CellIndex>,
[src]
I: Copy + Into<CellIndex>,
impl<T: Real> CellFaceAttrib for TetMeshExt<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<CellFaceIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<CellFaceIndex>
[src]
impl<T: Real> CellVertex for TetMeshExt<T>
[src]
fn vertex<CVI>(&self, cv_idx: CVI) -> VertexIndex where
CVI: Copy + Into<CellVertexIndex>,
[src]
CVI: Copy + Into<CellVertexIndex>,
fn cell_vertex<CI>(&self, cidx: CI, which: usize) -> Option<CellVertexIndex> where
CI: Copy + Into<CellIndex>,
[src]
CI: Copy + Into<CellIndex>,
fn num_cell_vertices(&self) -> usize
[src]
fn num_vertices_at_cell<CI>(&self, cidx: CI) -> usize where
CI: Copy + Into<CellIndex>,
[src]
CI: Copy + Into<CellIndex>,
fn cell_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex> where
I: Copy + Into<CellIndex>,
[src]
I: Copy + Into<CellIndex>,
fn reverse_topo(&self) -> (Vec<usize>, Vec<usize>) where
Self: NumCells + NumVertices,
[src]
Self: NumCells + NumVertices,
fn reverse_source_topo(&self) -> (Vec<usize>, Vec<usize>) where
Self: NumVertices,
[src]
Self: NumVertices,
impl<T: Real> CellVertexAttrib for TetMeshExt<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<CellVertexIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<CellVertexIndex>
[src]
impl<T: Clone + Real> Clone for TetMeshExt<T>
[src]
fn clone(&self) -> TetMeshExt<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn from(tetmesh: TetMesh<T>) -> TetMeshExt<T>
[src]
impl<T: Real> From<TetMeshExt<T>> for TetMesh<T>
[src]
fn from(ext: TetMeshExt<T>) -> 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.
fn merge_vec(vec: Vec<Self>) -> Self where
Self: Default,
[src]
Self: Default,
fn merge_slice(slice: &[Self]) -> Self where
Self: Clone + Default,
[src]
Self: Clone + Default,
impl<T: Real> NumCells for TetMeshExt<T>
[src]
impl<T: Real> NumVertices for TetMeshExt<T>
[src]
Define TetMeshExt
topology
fn num_vertices(&self) -> usize
[src]
impl<T: PartialEq + Real> PartialEq<TetMeshExt<T>> for TetMeshExt<T>
[src]
fn eq(&self, other: &TetMeshExt<T>) -> bool
[src]
fn ne(&self, other: &TetMeshExt<T>) -> bool
[src]
impl<T: Real> SplitIntoConnectedComponents<VertexIndex, CellIndex> for TetMeshExt<T>
[src]
fn split_into_connected_components(self) -> Vec<Self>
[src]
impl<T: Real> StructuralPartialEq for TetMeshExt<T>
[src]
impl<T: Real> VertexAttrib for TetMeshExt<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<VertexIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexIndex>
[src]
impl<T: Real> VertexCell for TetMeshExt<T>
[src]
fn cell<VCI>(&self, vc_idx: VCI) -> CellIndex where
VCI: Copy + Into<VertexCellIndex>,
[src]
VCI: Copy + Into<VertexCellIndex>,
fn vertex_cell<VI>(&self, vidx: VI, which: usize) -> Option<VertexCellIndex> where
VI: Copy + Into<VertexIndex>,
[src]
VI: Copy + Into<VertexIndex>,
fn num_vertex_cells(&self) -> usize
[src]
fn num_cells_at_vertex<VI>(&self, vidx: VI) -> usize where
VI: Copy + Into<VertexIndex>,
[src]
VI: Copy + Into<VertexIndex>,
fn vertex_to_cell<I>(&self, i: I, k: usize) -> Option<CellIndex> where
I: Copy + Into<VertexIndex>,
[src]
I: Copy + Into<VertexIndex>,
impl<T: Real> VertexCellAttrib for TetMeshExt<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<VertexCellIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexCellIndex>
[src]
impl<T: Real> VertexPositions for TetMeshExt<T>
[src]
type Element = <TetMesh<T> as VertexPositions>::Element
fn vertex_positions(&self) -> &[Self::Element]
[src]
fn vertex_positions_mut(&mut self) -> &mut [Self::Element]
[src]
fn vertex_position_iter(&self) -> Iter<Self::Element>
[src]
fn vertex_position_iter_mut(&mut self) -> IterMut<Self::Element>
[src]
fn vertex_position<VI>(&self, vidx: VI) -> Self::Element where
VI: Into<VertexIndex>,
[src]
VI: Into<VertexIndex>,
Auto Trait Implementations
impl<T> RefUnwindSafe for TetMeshExt<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for TetMeshExt<T>
impl<T> Sync for TetMeshExt<T>
impl<T> Unpin for TetMeshExt<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TetMeshExt<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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<M, T> BoundingBox<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: Real,
[src]
M: VertexPositions<Element = [T; 3]>,
T: Real,
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]
M: NumVertices + CellVertex + VertexCell,
type Topo = ()
Additional topology that may aid in computing connectivity. Read more
fn num_elements(&Self) -> usize
[src]
fn push_neighbours<T>(
&Self,
VertexIndex,
&mut Vec<VertexIndex>,
&(),
Option<&[T]>
) where
T: PartialEq<T> + Default,
[src]
&Self,
VertexIndex,
&mut Vec<VertexIndex>,
&(),
Option<&[T]>
) where
T: PartialEq<T> + Default,
fn precompute_topo(&self) -> Self::Topo
[src]
fn connectivity(&self) -> (Vec<usize>, usize)
[src]
fn connectivity_via_attrib<T>(
&self,
attrib: Option<&str>
) -> (Vec<usize>, usize) where
Self: Attrib,
Src: AttribIndex<Self>,
T: Default + PartialEq + 'static,
[src]
&self,
attrib: Option<&str>
) -> (Vec<usize>, usize) where
Self: Attrib,
Src: AttribIndex<Self>,
T: Default + PartialEq + 'static,
fn connectivity_via_attrib_fn<'a, T, F>(&self, f: F) -> (Vec<usize>, usize) where
T: Default + PartialEq + 'a,
F: FnOnce() -> Option<&'a [T]>,
[src]
T: Default + PartialEq + 'a,
F: FnOnce() -> Option<&'a [T]>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, M> Rotate<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
fn rotate_by_matrix(&mut Self, [[T; 3]; 3])
[src]
Rotate the mesh using the given column-major rotation matrix.
fn rotate(&mut self, [x, y, z]: [T; 3], theta: T)
[src]
fn rotate_by_vector(&mut self, e: [T; 3]) where
T: Zero,
[src]
T: Zero,
impl<S, T> Rotated<T> for S where
S: Rotate<T>,
T: BaseFloat,
[src]
S: Rotate<T>,
T: BaseFloat,
fn rotated(Self, [T; 3], T) -> S
[src]
fn rotated_by_matrix(Self, [[T; 3]; 3]) -> S
[src]
fn rotated_by_vector(Self, [T; 3]) -> S
[src]
impl<T, M> Scale<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
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.
fn uniform_scale(&mut self, s: T)
[src]
impl<S, T> Scaled<T> for S where
S: Scale<T>,
T: Copy,
[src]
S: Scale<T>,
T: Copy,
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, M> Translate<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
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]
S: Translate<T>,
fn translated(Self, [T; 3]) -> S
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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<M, T> VertexMesh<T> for M where
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
T: Real,
[src]
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
T: Real,