Struct meshx::mesh::uniform_poly_mesh::TriMesh
source · pub struct TriMesh<T: Real> {
pub vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>,
pub indices: IntrinsicAttribute<[usize; 3], FaceIndex>,
pub vertex_attributes: AttribDict<VertexIndex>,
pub face_attributes: AttribDict<FaceIndex>,
pub face_vertex_attributes: AttribDict<FaceVertexIndex>,
pub face_edge_attributes: AttribDict<FaceEdgeIndex>,
pub attribute_value_cache: AttribValueCache,
}
Fields§
§vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>
Vertex positions.
indices: IntrinsicAttribute<[usize; 3], FaceIndex>
Triples of indices into vertices
representing triangles.
vertex_attributes: AttribDict<VertexIndex>
Vertex attributes.
face_attributes: AttribDict<FaceIndex>
Triangle attributes.
face_vertex_attributes: AttribDict<FaceVertexIndex>
Triangle vertex attributes.
face_edge_attributes: AttribDict<FaceEdgeIndex>
Triangle edge attributes.
attribute_value_cache: AttribValueCache
Indirect attribute value cache
Implementations§
source§impl<T: Real> TriMesh<T>
impl<T: Real> TriMesh<T>
sourcepub fn merge_with_vertex_source<'a, I>(
meshes: I,
source_attrib: &str
) -> Result<Self, Error>where
I: IntoIterator<Item = &'a Self>,
pub fn merge_with_vertex_source<'a, I>(
meshes: I,
source_attrib: &str
) -> Result<Self, Error>where
I: IntoIterator<Item = &'a Self>,
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.
source§impl<T: Real> TriMesh<T>
impl<T: Real> TriMesh<T>
sourcepub fn split_by_face_partition(
self,
face_partition: &[usize],
num_parts: usize
) -> (Vec<Self>, Vec<Vec<usize>>)
pub fn split_by_face_partition( self, face_partition: &[usize], num_parts: usize ) -> (Vec<Self>, Vec<Vec<usize>>)
Split the mesh by the given face partition.
Returns a vector of meshes and the mapping from new vertex indices to old vertex indices, since some may have been duplicated. The faces remain in the same order as in the original mesh.
source§impl<T: Real> TriMesh<T>
impl<T: Real> TriMesh<T>
sourcepub fn split_vertices_by_face_vertex_attrib(&mut self, attrib_name: &str)
pub fn split_vertices_by_face_vertex_attrib(&mut self, attrib_name: &str)
Split vertices by a given face-vertex attribute.
If a pair of face-vertices have different values for the same vertex, then they will be split into distinct vertices. New vertex positions are appended at the end of the vertex position array.
If the given attribute doesn’t exist, then nothing is changed.
source§impl<T: Real> TriMesh<T>
impl<T: Real> TriMesh<T>
pub fn new(verts: Vec<[T; 3]>, indices: Vec<[usize; 3]>) -> TriMesh<T>
sourcepub fn face_iter_mut(&mut self) -> IterMut<'_, [usize; 3]>
pub fn face_iter_mut(&mut self) -> IterMut<'_, [usize; 3]>
Iterate mutably over each face.
sourcepub fn face<FI: Into<FaceIndex>>(&self, fidx: FI) -> &[usize; 3]
pub fn face<FI: Into<FaceIndex>>(&self, fidx: FI) -> &[usize; 3]
Face accessor. These are vertex indices.
Panics
This function panics when the given face index is out of bounds.
sourcepub fn reversed(self) -> Self
pub fn reversed(self) -> Self
Reverse the order of each polygon in this mesh. This is the consuming version of the
reverse
method.
sourcepub fn sort_vertices_by_key<K, F>(&mut self, f: F) -> Vec<usize>
pub fn sort_vertices_by_key<K, F>(&mut self, f: F) -> Vec<usize>
Sort vertices by the given key values, and return the reulting order (permutation).
This function assumes we have at least one vertex.
sourcepub fn fuse_vertices_by_attrib<K, F>(
&mut self,
attrib_name: &str,
join: F
) -> Result<(), Error>
pub fn fuse_vertices_by_attrib<K, F>( &mut self, attrib_name: &str, join: F ) -> Result<(), Error>
Fuses vertices with matching attribute value together.
If two or more vertices have the same value for the given attribute,
they are fused into one. The given function join
s the positions
of vertices whose attribute value matches.
source§impl<T: Real> TriMesh<T>
impl<T: Real> TriMesh<T>
sourcepub fn tri_iter(&self) -> impl Iterator<Item = Triangle<T>> + '_
pub fn tri_iter(&self) -> impl Iterator<Item = Triangle<T>> + '_
Triangle iterator.
use meshx::mesh::TriMesh;
use meshx::prim::Triangle;
let verts = vec![[0.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, 1.0, 0.0]];
let mesh = TriMesh::new(verts.clone(), vec![[0, 1, 2]]);
let tri = Triangle::from_indexed_slice(&[0, 1, 2], verts.as_slice());
assert_eq!(Some(tri), mesh.tri_iter().next());
sourcepub fn tri_from_indices(&self, indices: &[usize; 3]) -> Triangle<T>
pub fn tri_from_indices(&self, indices: &[usize; 3]) -> Triangle<T>
Get a tetrahedron primitive corresponding to the given vertex indices.
Trait Implementations§
source§impl<T: Real> Attrib for TriMesh<T>
impl<T: Real> Attrib for TriMesh<T>
source§fn attrib_size<I: AttribIndex<Self>>(&self) -> usize
fn attrib_size<I: AttribIndex<Self>>(&self) -> usize
I
.source§fn attrib_dict<I: AttribIndex<Self>>(&self) -> &AttribDict<I>
fn attrib_dict<I: AttribIndex<Self>>(&self) -> &AttribDict<I>
source§fn attrib_dict_mut<I: AttribIndex<Self>>(&mut self) -> &mut AttribDict<I>
fn attrib_dict_mut<I: AttribIndex<Self>>(&mut self) -> &mut AttribDict<I>
source§fn attrib_dict_and_cache_mut<I: AttribIndex<Self>>(
&mut self
) -> (&mut AttribDict<I>, Option<&mut AttribValueCache>)
fn attrib_dict_and_cache_mut<I: AttribIndex<Self>>( &mut self ) -> (&mut AttribDict<I>, Option<&mut AttribValueCache>)
source§fn insert_attrib_with_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
fn insert_attrib_with_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
source§fn insert_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
fn insert_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
Vec<T>
. data
must have
exactly the right size for the attribute to be inserted successfully. Read moresource§fn reset_attrib_to_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
fn reset_attrib_to_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
source§fn set_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
fn set_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
data
must have exactly the
right size for the attribute to be set successfully. Read moresource§fn insert_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
fn insert_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
source§fn set_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
fn set_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
source§fn insert_indirect_attrib_data<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
fn insert_indirect_attrib_data<'a, I: AttribIndex<Self>>( &mut self, name: &'a str, data: IndirectData ) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
IndirectData
. data
must have
exactly the right size for the attribute to be inserted successfully.source§fn set_indirect_attrib_data<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
fn set_indirect_attrib_data<'a, I: AttribIndex<Self>>( &mut self, name: &'a str, data: IndirectData ) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
IndirectData
instance. data
must have
exactly the right size for the attribute to be set successfully.source§fn duplicate_attrib<'a, 'b, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error>
fn duplicate_attrib<'a, 'b, T, I: AttribIndex<Self>>( &mut self, name: &'a str, new_name: &'b str ) -> Result<&mut Attribute<I>, Error>
source§fn remove_attrib<I: AttribIndex<Self>>(
&mut self,
name: &str
) -> Result<Attribute<I>, Error>
fn remove_attrib<I: AttribIndex<Self>>( &mut self, name: &str ) -> Result<Attribute<I>, Error>
source§fn insert_attrib<I: AttribIndex<Self>>(
&mut self,
name: &str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error>
fn insert_attrib<I: AttribIndex<Self>>( &mut self, name: &str, attrib: Attribute<I> ) -> Result<Option<Attribute<I>>, Error>
HashMap
semantics. Read moresource§fn attrib_or_insert_with_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
fn attrib_or_insert_with_default<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue,
source§fn attrib_or_insert_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
fn attrib_or_insert_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error>where
T: AttributeValue + Default,
source§fn attrib_or_insert_indirect<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
fn attrib_or_insert_indirect<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>where
T: AttributeValueHash,
source§fn direct_attrib_iter<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Iter<'_, T>, Error>
fn direct_attrib_iter<'a, 'b, T, I: 'b + AttribIndex<Self>>( &'b self, name: &'a str ) -> Result<Iter<'_, T>, Error>
source§fn attrib_iter_mut<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<IterMut<'_, T>, Error>
fn attrib_iter_mut<'a, 'b, T, I: 'b + AttribIndex<Self>>( &'b mut self, name: &'a str ) -> Result<IterMut<'_, T>, Error>
source§fn attrib_iter<'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &str
) -> Result<Box<dyn Iterator<Item = &'b T> + 'b>, Error>
fn attrib_iter<'b, T, I: 'b + AttribIndex<Self>>( &'b self, name: &str ) -> Result<Box<dyn Iterator<Item = &'b T> + 'b>, Error>
source§fn indirect_attrib_update_with<'a, 'b, T, I, F>(
&'b mut self,
name: &'a str,
f: F
) -> Result<(&'b mut Attribute<I>, &'b mut AttribValueCache), Error>
fn indirect_attrib_update_with<'a, 'b, T, I, F>( &'b mut self, name: &'a str, f: F ) -> Result<(&'b mut Attribute<I>, &'b mut AttribValueCache), Error>
source§fn attrib_exists<I: AttribIndex<Self>>(&self, name: &str) -> bool
fn attrib_exists<I: AttribIndex<Self>>(&self, name: &str) -> bool
true
if the given attribute exists at the given location, and
false
otherwise, even if the specified attribute location is invalid
for the mesh.source§fn attrib_check<'a, T: Any, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib_check<'a, T: Any, I: AttribIndex<Self>>( &self, name: &'a str ) -> Result<&Attribute<I>, Error>
source§fn attrib_as_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<&'b [T], Error>
fn attrib_as_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>( &'b self, name: &'a str ) -> Result<&'b [T], Error>
source§fn attrib_as_mut_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<&'b mut [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>
source§fn attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error>where
T: AttributeValueHash,
fn attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error>where
T: AttributeValueHash,
Vec<T>
. Read moresource§fn direct_attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error>where
T: AttributeValue,
fn direct_attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error>where
T: AttributeValue,
Vec<T>
. Read moresource§fn attrib<'a, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib<'a, I: AttribIndex<Self>>( &self, name: &'a str ) -> Result<&Attribute<I>, Error>
source§fn attrib_mut<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str
) -> Result<&mut Attribute<I>, Error>
fn attrib_mut<'a, I: AttribIndex<Self>>( &mut self, name: &'a str ) -> Result<&mut Attribute<I>, Error>
source§impl<T: Real> AttribPromote<FaceVertexIndex, VertexIndex> for TriMesh<T>
impl<T: Real> AttribPromote<FaceVertexIndex, VertexIndex> for TriMesh<T>
source§impl<T: Real> FaceAttrib for TriMesh<T>
impl<T: Real> FaceAttrib for TriMesh<T>
source§fn topo_attrib_size(&self) -> usize
fn topo_attrib_size(&self) -> usize
source§fn topo_attrib_dict(&self) -> &AttribDict<FaceIndex>
fn topo_attrib_dict(&self) -> &AttribDict<FaceIndex>
source§fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceIndex>
fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceIndex>
source§fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut AttribDict<FaceIndex>, Option<&mut AttribValueCache>)
fn topo_attrib_dict_and_cache_mut( &mut self ) -> (&mut AttribDict<FaceIndex>, Option<&mut AttribValueCache>)
source§impl<T: Real> FaceEdge for TriMesh<T>
impl<T: Real> FaceEdge for TriMesh<T>
source§fn edge<FEI>(&self, fe_idx: FEI) -> EdgeIndex
fn edge<FEI>(&self, fe_idx: FEI) -> EdgeIndex
source§fn face_edge<FI>(&self, fidx: FI, which: usize) -> Option<FaceEdgeIndex>
fn face_edge<FI>(&self, fidx: FI, which: usize) -> Option<FaceEdgeIndex>
source§fn num_face_edges(&self) -> usize
fn num_face_edges(&self) -> usize
source§fn num_edges_at_face<FI>(&self, _: FI) -> usize
fn num_edges_at_face<FI>(&self, _: FI) -> usize
source§impl<T: Real> FaceEdgeAttrib for TriMesh<T>
impl<T: Real> FaceEdgeAttrib for TriMesh<T>
source§fn topo_attrib_size(&self) -> usize
fn topo_attrib_size(&self) -> usize
source§fn topo_attrib_dict(&self) -> &AttribDict<FaceEdgeIndex>
fn topo_attrib_dict(&self) -> &AttribDict<FaceEdgeIndex>
source§fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceEdgeIndex>
fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceEdgeIndex>
source§fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut AttribDict<FaceEdgeIndex>, Option<&mut AttribValueCache>)
fn topo_attrib_dict_and_cache_mut( &mut self ) -> (&mut AttribDict<FaceEdgeIndex>, Option<&mut AttribValueCache>)
source§impl<T: Real> FaceVertex for TriMesh<T>
impl<T: Real> FaceVertex for TriMesh<T>
source§fn vertex<FVI>(&self, fv_idx: FVI) -> VertexIndex
fn vertex<FVI>(&self, fv_idx: FVI) -> VertexIndex
source§fn face_vertex<FI>(&self, fidx: FI, which: usize) -> Option<FaceVertexIndex>
fn face_vertex<FI>(&self, fidx: FI, which: usize) -> Option<FaceVertexIndex>
source§fn num_face_vertices(&self) -> usize
fn num_face_vertices(&self) -> usize
source§fn num_vertices_at_face<FI>(&self, _: FI) -> usize
fn num_vertices_at_face<FI>(&self, _: FI) -> usize
source§fn face_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex>
fn face_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex>
source§fn reverse_topo(&self) -> (Vec<usize>, Vec<usize>)where
Self: NumFaces + NumVertices,
fn reverse_topo(&self) -> (Vec<usize>, Vec<usize>)where
Self: NumFaces + NumVertices,
source§fn reverse_source_topo(&self) -> (Vec<usize>, Vec<usize>)where
Self: NumVertices,
fn reverse_source_topo(&self) -> (Vec<usize>, Vec<usize>)where
Self: NumVertices,
source§impl<T: Real> FaceVertexAttrib for TriMesh<T>
impl<T: Real> FaceVertexAttrib for TriMesh<T>
source§fn topo_attrib_size(&self) -> usize
fn topo_attrib_size(&self) -> usize
source§fn topo_attrib_dict(&self) -> &AttribDict<FaceVertexIndex>
fn topo_attrib_dict(&self) -> &AttribDict<FaceVertexIndex>
source§fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceVertexIndex>
fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<FaceVertexIndex>
source§fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut AttribDict<FaceVertexIndex>, Option<&mut AttribValueCache>)
fn topo_attrib_dict_and_cache_mut( &mut self ) -> (&mut AttribDict<FaceVertexIndex>, Option<&mut AttribValueCache>)
source§impl<T: Real> From<TriMesh<T>> for PointCloud<T>
impl<T: Real> From<TriMesh<T>> for PointCloud<T>
Convert a triangle mesh to a point cloud by erasing all triangle data.
source§fn from(mesh: TriMesh<T>) -> PointCloud<T>
fn from(mesh: TriMesh<T>) -> PointCloud<T>
source§impl<T: Real> From<TriMesh<T>> for TriMeshExt<T>
impl<T: Real> From<TriMesh<T>> for TriMeshExt<T>
source§fn from(base_mesh: TriMesh<T>) -> TriMeshExt<T>
fn from(base_mesh: TriMesh<T>) -> TriMeshExt<T>
source§impl<T: Real> From<TriMeshExt<T>> for TriMesh<T>
impl<T: Real> From<TriMeshExt<T>> for TriMesh<T>
source§fn from(ext: TriMeshExt<T>) -> TriMesh<T>
fn from(ext: TriMeshExt<T>) -> TriMesh<T>
source§impl<T: Real> Merge for TriMesh<T>
impl<T: Real> Merge for TriMesh<T>
source§fn merge(&mut self, other: Self) -> &mut Self
fn merge(&mut self, other: Self) -> &mut Self
Attributes with the same name but different types won’t be merged.
source§fn merge_iter(iterable: impl IntoIterator<Item = Self>) -> Selfwhere
Self: Default,
fn merge_iter(iterable: impl IntoIterator<Item = Self>) -> Selfwhere
Self: Default,
source§impl<T: Real> MeshBuilder<TriMesh<T>> for BoxBuilder
impl<T: Real> MeshBuilder<TriMesh<T>> for BoxBuilder
source§impl<T: Real> NumVertices for TriMesh<T>
impl<T: Real> NumVertices for TriMesh<T>
fn num_vertices(&self) -> usize
source§impl<T: PartialEq + Real> PartialEq for TriMesh<T>
impl<T: PartialEq + Real> PartialEq for TriMesh<T>
source§impl<T: Real> Split<FaceIndex> for TriMesh<T>
impl<T: Real> Split<FaceIndex> for TriMesh<T>
fn split(self, partition: &[usize], num_parts: usize) -> Vec<Self>
source§fn split_by_attrib<T: AttributeValueHash>(self, attrib: &str) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
fn split_by_attrib<T: AttributeValueHash>(self, attrib: &str) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
source§fn split_by_attrib_ord<T: PartialOrd + AttributeValue>(
self,
attrib: &str
) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
fn split_by_attrib_ord<T: PartialOrd + AttributeValue>(
self,
attrib: &str
) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
PartialOrd
. Read moresource§impl<T: Real> Split<VertexIndex> for TriMesh<T>
impl<T: Real> Split<VertexIndex> for TriMesh<T>
fn split(self, partition: &[usize], num_parts: usize) -> Vec<Self>
source§fn split_by_attrib<T: AttributeValueHash>(self, attrib: &str) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
fn split_by_attrib<T: AttributeValueHash>(self, attrib: &str) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
source§fn split_by_attrib_ord<T: PartialOrd + AttributeValue>(
self,
attrib: &str
) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
fn split_by_attrib_ord<T: PartialOrd + AttributeValue>(
self,
attrib: &str
) -> Vec<Self>where
Self: Attrib,
Src: AttribIndex<Self>,
PartialOrd
. Read moresource§impl<T: Real> SplitIntoConnectedComponents<VertexIndex, FaceIndex> for TriMesh<T>
impl<T: Real> SplitIntoConnectedComponents<VertexIndex, FaceIndex> for TriMesh<T>
fn split_into_connected_components(self) -> Vec<Self>
source§impl<T: Real> VertexAttrib for TriMesh<T>
impl<T: Real> VertexAttrib for TriMesh<T>
source§fn topo_attrib_size(&self) -> usize
fn topo_attrib_size(&self) -> usize
source§fn topo_attrib_dict(&self) -> &AttribDict<VertexIndex>
fn topo_attrib_dict(&self) -> &AttribDict<VertexIndex>
source§fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexIndex>
fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexIndex>
source§fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut AttribDict<VertexIndex>, Option<&mut AttribValueCache>)
fn topo_attrib_dict_and_cache_mut( &mut self ) -> (&mut AttribDict<VertexIndex>, Option<&mut AttribValueCache>)
source§impl<T: Real> VertexPositions for TriMesh<T>
impl<T: Real> VertexPositions for TriMesh<T>
type Element = [T; 3]
source§fn vertex_positions(&self) -> &[Self::Element]
fn vertex_positions(&self) -> &[Self::Element]
source§fn vertex_positions_mut(&mut self) -> &mut [Self::Element]
fn vertex_positions_mut(&mut self) -> &mut [Self::Element]
source§fn vertex_position_iter(&self) -> Iter<'_, Self::Element>
fn vertex_position_iter(&self) -> Iter<'_, Self::Element>
source§fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>
fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>
impl<T: Real> StructuralPartialEq for TriMesh<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for TriMesh<T>where
T: RefUnwindSafe,
impl<T> Send for TriMesh<T>
impl<T> Sync for TriMesh<T>
impl<T> Unpin for TriMesh<T>where
T: Unpin,
impl<T> UnwindSafe for TriMesh<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<M, T> BoundingBox<T> for M
impl<M, T> BoundingBox<T> for M
source§fn bounding_box(&self) -> BBox<T>
fn bounding_box(&self) -> BBox<T>
Compute the bounding box of this object.
source§impl<T> CloneBytes for Twhere
T: Clone + 'static,
impl<T> CloneBytes for Twhere
T: Clone + 'static,
unsafe fn clone_bytes(src: &[MaybeUninit<u8>]) -> Box<[MaybeUninit<u8>]>
unsafe fn clone_from_bytes(dst: &mut [MaybeUninit<u8>], src: &[MaybeUninit<u8>])
unsafe fn clone_into_raw_bytes( src: &[MaybeUninit<u8>], dst: &mut [MaybeUninit<u8>] )
source§impl<M> Connectivity<FaceVertexIndex, VertexIndex> for M
impl<M> Connectivity<FaceVertexIndex, VertexIndex> for M
§type Topo = (Vec<usize>, Vec<usize>)
type Topo = (Vec<usize>, Vec<usize>)
source§fn precompute_topo(
&self
) -> <M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo
fn precompute_topo( &self ) -> <M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo
source§fn num_elements(&self) -> usize
fn num_elements(&self) -> usize
source§fn push_neighbours<T>(
&self,
index: FaceVertexIndex,
stack: &mut Vec<FaceVertexIndex>,
topo: &<M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo,
attrib: Option<&[T]>
)
fn push_neighbours<T>( &self, index: FaceVertexIndex, stack: &mut Vec<FaceVertexIndex>, topo: &<M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo, attrib: Option<&[T]> )
source§fn connectivity(&self) -> (Vec<usize>, usize)
fn connectivity(&self) -> (Vec<usize>, usize)
source§impl<M> Connectivity<VertexIndex, FaceIndex> for M
impl<M> Connectivity<VertexIndex, FaceIndex> for M
§type Topo = (Vec<usize>, Vec<usize>)
type Topo = (Vec<usize>, Vec<usize>)
source§fn precompute_topo(&self) -> <M as Connectivity<VertexIndex, FaceIndex>>::Topo
fn precompute_topo(&self) -> <M as Connectivity<VertexIndex, FaceIndex>>::Topo
source§fn num_elements(&self) -> usize
fn num_elements(&self) -> usize
source§fn push_neighbours<T>(
&self,
index: VertexIndex,
stack: &mut Vec<VertexIndex>,
topo: &<M as Connectivity<VertexIndex, FaceIndex>>::Topo,
_: Option<&[T]>
)
fn push_neighbours<T>( &self, index: VertexIndex, stack: &mut Vec<VertexIndex>, topo: &<M as Connectivity<VertexIndex, FaceIndex>>::Topo, _: Option<&[T]> )
source§fn connectivity(&self) -> (Vec<usize>, usize)
fn connectivity(&self) -> (Vec<usize>, usize)
source§impl<T> DebugBytes for Twhere
T: Debug + 'static,
impl<T> DebugBytes for Twhere
T: Debug + 'static,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> DropBytes for Twhere
T: 'static,
impl<T> DropBytes for Twhere
T: 'static,
unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
source§impl<'a, S, I> Get<'a, I> for Swhere
I: GetIndex<'a, S>,
impl<'a, S, I> Get<'a, I> for Swhere
I: GetIndex<'a, S>,
type Output = <I as GetIndex<'a, S>>::Output
fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>
source§fn at(&self, idx: I) -> Self::Output
fn at(&self, idx: I) -> Self::Output
get
that will panic if the equivalent get
call is None
,
which typically means that the given index is out of bounds. Read moresource§unsafe fn at_unchecked(&self, idx: I) -> Self::Output
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
source§impl<S, I> Isolate<I> for Swhere
I: IsolateIndex<S>,
impl<S, I> Isolate<I> for Swhere
I: IsolateIndex<S>,
source§impl<T> PartialEqBytes for Twhere
T: PartialEq + 'static,
impl<T> PartialEqBytes for Twhere
T: PartialEq + 'static,
unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool
source§impl<M> Partition for Mwhere
M: Attrib,
impl<M> Partition for Mwhere
M: Attrib,
source§fn partition_by_attrib<T, Src>(&self, attrib: &str) -> (Vec<usize>, usize)where
T: AttributeValueHash,
Src: AttribIndex<M>,
fn partition_by_attrib<T, Src>(&self, attrib: &str) -> (Vec<usize>, usize)where
T: AttributeValueHash,
Src: AttribIndex<M>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, N> PushArrayToVec<N> for T
impl<T, N> PushArrayToVec<N> for T
source§impl<T, M> Rotate<T> for M
impl<T, M> Rotate<T> for M
source§fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])
fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])
Rotate the mesh using the given column-major rotation matrix.
source§fn rotate_by_vector(&mut self, e: [T; 3])where
T: Zero,
fn rotate_by_vector(&mut self, e: [T; 3])where
T: Zero,
e
. The direction of
e
specifies the axis of rotation and its magnitude is the angle in radians.source§impl<S, T> Rotated<T> for Swhere
T: RealField,
S: Rotate<T>,
impl<S, T> Rotated<T> for Swhere
T: RealField,
S: Rotate<T>,
source§fn rotated(self, u: [T; 3], theta: T) -> S
fn rotated(self, u: [T; 3], theta: T) -> S
self
rotated about the unit vector u
by the given angle theta
(in
radians). Read moresource§fn rotated_by_matrix(self, mtx: [[T; 3]; 3]) -> S
fn rotated_by_matrix(self, mtx: [[T; 3]; 3]) -> S
self
rotated using the given column-major rotation matrixsource§fn rotated_by_vector(self, e: [T; 3]) -> S
fn rotated_by_vector(self, e: [T; 3]) -> S
self
rotated about the Euler vector e
.source§impl<T, M> Scale<T> for Mwhere
T: RealField,
M: VertexPositions<Element = [T; 3]>,
impl<T, M> Scale<T> for Mwhere
T: RealField,
M: VertexPositions<Element = [T; 3]>,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<T, M> Translate<T> for Mwhere
T: RealField,
M: VertexPositions<Element = [T; 3]>,
impl<T, M> Translate<T> for Mwhere
T: RealField,
M: VertexPositions<Element = [T; 3]>,
source§impl<S, T> Translated<T> for Swhere
S: Translate<T>,
impl<S, T> Translated<T> for Swhere
S: Translate<T>,
source§fn translated(self, t: [T; 3]) -> S
fn translated(self, t: [T; 3]) -> S
self
translated by the given translation vector t
.