Struct gut::mesh::polymesh::PolyMesh [−][src]
pub struct PolyMesh<T> where
T: Real, {
pub vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>,
pub indices: Vec<usize, Global>,
pub offsets: Vec<usize, Global>,
pub vertex_attributes: HashMap<String, Attribute<VertexIndex>, RandomState, Global>,
pub face_attributes: HashMap<String, Attribute<FaceIndex>, RandomState, Global>,
pub face_vertex_attributes: HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>,
pub face_edge_attributes: HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>,
pub attribute_value_cache: HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>,
}
Expand description
Mesh with arbitrarily shaped faces. It could have polygons with any number of sides. All faces are assumed to be closed polygons.
Fields
vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>
Vertex positions intrinsic attribute.
indices: Vec<usize, Global>
Indices into vertices
representing face vertices.
offsets: Vec<usize, Global>
Offsets into indices
representing individual faces. The last element in this Vec
is
always the length of indices
for convenience.
vertex_attributes: HashMap<String, Attribute<VertexIndex>, RandomState, Global>
Vertex attributes.
face_attributes: HashMap<String, Attribute<FaceIndex>, RandomState, Global>
Polygon attributes.
face_vertex_attributes: HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>
Polygon vertex attributes.
face_edge_attributes: HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>
Polygon edge attributes.
attribute_value_cache: HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>
Indirect attribute value cache
Implementations
pub fn merge_with_vertex_source<'a, I>(
meshes: I,
source_attrib: &str
) -> Result<PolyMesh<T>, Error> where
I: IntoIterator<Item = &'a PolyMesh<T>>,
pub fn merge_with_vertex_source<'a, I>(
meshes: I,
source_attrib: &str
) -> Result<PolyMesh<T>, Error> where
I: IntoIterator<Item = &'a PolyMesh<T>>,
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.
pub fn split_vertices_by_face_vertex_attrib<U>(&mut self, attrib: &str) where
U: 'static + PartialOrd<U> + PartialEq<U> + Copy,
pub fn split_vertices_by_face_vertex_attrib<U>(&mut self, attrib: &str) where
U: 'static + PartialOrd<U> + PartialEq<U> + Copy,
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.
Construct a PolyMesh
from an array of vertices and an array of sizes and indices.
The faces
array contains the indices into the vertex array for each face preceeded by the
number of vertices in the corresponding face. I.e. faces
is expected to be structured as
a contiguous array of a number (corresponding to the number of vertices in the face)
followed by the vertex indices (in the same face):
n i_1 i_2 ... i_n m j_1 j_2 ... j_m ...
Examples
use meshx::mesh::PolyMesh;
let points = vec![
[0.0, 0.0, 0.0],
[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[1.0, 1.0, 0.0],
[0.0, 0.0, 1.0],
[1.0, 0.0, 1.0]];
let faces = vec![3, 0, 1, 2, // first triangle
3, 1, 3, 2, // second triangle
4, 0, 1, 5, 4]; // quadrilateral
let polymesh = PolyMesh::new(points, &faces);
assert_eq!(polymesh.indices, [0, 1, 2, 1, 3, 2, 0, 1, 5, 4]);
assert_eq!(polymesh.offsets, [0, 3, 6, 10]);
pub fn face_iter(&self) -> DynamicIndexSliceIter<'_>ⓘNotable traits for DynamicIndexSliceIter<'a>impl<'a> Iterator for DynamicIndexSliceIter<'a> type Item = &'a [usize];
impl<'a> Iterator for DynamicIndexSliceIter<'a> type Item = &'a [usize];
pub fn face_iter_mut(&mut self) -> DynamicIndexSliceIterMut<'_>ⓘNotable traits for DynamicIndexSliceIterMut<'a>impl<'a> Iterator for DynamicIndexSliceIterMut<'a> type Item = &'a mut [usize];
impl<'a> Iterator for DynamicIndexSliceIterMut<'a> type Item = &'a mut [usize];
Trait Implementations
Get the size of the attribute at the appropriate mesh location determined by I
.
pub fn attrib_dict<I>(
&self
) -> &HashMap<String, Attribute<I>, RandomState, Global> where
I: AttribIndex<PolyMesh<T>>,
pub fn attrib_dict<I>(
&self
) -> &HashMap<String, Attribute<I>, RandomState, Global> where
I: AttribIndex<PolyMesh<T>>,
Read only access to the attribute dictionary.
pub fn attrib_dict_mut<I>(
&mut self
) -> &mut HashMap<String, Attribute<I>, RandomState, Global> where
I: AttribIndex<PolyMesh<T>>,
pub fn attrib_dict_mut<I>(
&mut self
) -> &mut HashMap<String, Attribute<I>, RandomState, Global> where
I: AttribIndex<PolyMesh<T>>,
Read and write access to the attribute dictionary.
pub fn attrib_dict_and_cache_mut<I>(
&mut self
) -> (&mut HashMap<String, Attribute<I>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>) where
I: AttribIndex<PolyMesh<T>>,
pub fn attrib_dict_and_cache_mut<I>(
&mut self
) -> (&mut HashMap<String, Attribute<I>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>) where
I: AttribIndex<PolyMesh<T>>,
Read and write access to the attribute dictionary along with a cache for indirect attribute values. Read more
fn add_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
fn add_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
Add an attribute at the appropriate location with a given default.
fn add_attrib_data<T, I>(
&mut self,
name: &'a str,
data: Vec<T, Global>
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
fn add_attrib_data<T, I>(
&mut self,
name: &'a str,
data: Vec<T, Global>
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
Construct an attribute from a given data Vec<T>
. data
must have
exactly the right size for the attribute to be added successfully. Read more
fn set_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
fn set_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
Sets the attribute to the specified default value whether or not it already exists. Read more
fn set_attrib_data<T, I>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
fn set_attrib_data<T, I>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
Set an attribute to the given data slice. data
must have exactly the
right size for the attribute to be set successfully. Read more
fn add_indirect_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
fn add_indirect_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
Add an indirect attribute at the appropriate location with a given default.
fn set_indirect_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
fn set_indirect_attrib<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
Sets the indirect attribute to the specified default value whether or not it already exists. Read more
fn add_indirect_attrib_data<I>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
fn add_indirect_attrib_data<I>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
Construct an indirect attribute from a given IndirectData
. data
must have
exactly the right size for the attribute to be added successfully. Read more
fn set_indirect_attrib_data<I>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
fn set_indirect_attrib_data<I>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
Set an indirect attribute to the given IndirectData
instance. data
must have
exactly the right size for the attribute to be set successfully. Read more
fn duplicate_attrib<T, I>(
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: Any + Clone,
fn duplicate_attrib<T, I>(
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: Any + Clone,
Makes a copy of an existing attribute. Read more
fn remove_attrib<I>(&mut self, name: &str) -> Result<Attribute<I>, Error> where
I: AttribIndex<Self>,
fn remove_attrib<I>(&mut self, name: &str) -> Result<Attribute<I>, Error> where
I: AttribIndex<Self>,
Remove an attribute from the attribute dictionary. Read more
fn insert_attrib<I>(
&mut self,
name: &str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error> where
I: AttribIndex<Self>,
fn insert_attrib<I>(
&mut self,
name: &str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error> where
I: AttribIndex<Self>,
Inserts an attribute into the dictionary with the usual HashMap
semantics. Read more
fn attrib_or_add<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
fn attrib_or_add<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue,
Retrieve the attribute with the given name and if it doesn’t exist, add a new one and set it to a given default value. In either case the mutable reference to the attribute is returned. Read more
fn attrib_or_add_data<T, I>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
fn attrib_or_add_data<T, I>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
T: AttributeValue + Default,
Retrieve the attribute with the given name and if it doesn’t exist, set its data to what’s in the given slice. In either case the mutable reference to the attribute is returned. Read more
fn attrib_or_add_indirect<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
fn attrib_or_add_indirect<T, I>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
I: AttribIndex<Self>,
T: AttributeValueHash,
Retrieve the indirect attribute with the given name and if it doesn’t exist, add a new one and set it to a given default value. In either case the mutable reference to the attribute is returned. Read more
fn direct_attrib_iter<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Iter<'b, T>, Error> where
I: 'b + AttribIndex<Self>,
T: Any + Clone,
fn direct_attrib_iter<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Iter<'b, T>, Error> where
I: 'b + AttribIndex<Self>,
T: Any + Clone,
Get the attribute iterator for a direct attribute.
fn attrib_iter_mut<'b, T, I>(
&'b mut self,
name: &'a str
) -> Result<IterMut<'b, T>, Error> where
I: 'b + AttribIndex<Self>,
T: Any + Clone,
fn attrib_iter_mut<'b, T, I>(
&'b mut self,
name: &'a str
) -> Result<IterMut<'b, T>, Error> where
I: 'b + AttribIndex<Self>,
T: Any + Clone,
Get the attribute mutable iterator for a direct attribute. Read more
Get the iterator for an attribute no matter what kind.
fn indirect_attrib_update_with<'b, T, I, F>(
&'b mut self,
name: &'a str,
f: F
) -> Result<(&'b mut Attribute<I>, &'b mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
T: AttributeValueHash,
I: 'b + AttribIndex<Self>,
F: FnMut(usize, &Arc<T>) -> Option<Arc<T>>,
fn indirect_attrib_update_with<'b, T, I, F>(
&'b mut self,
name: &'a str,
f: F
) -> Result<(&'b mut Attribute<I>, &'b mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>), Error> where
T: AttributeValueHash,
I: 'b + AttribIndex<Self>,
F: FnMut(usize, &Arc<T>) -> Option<Arc<T>>,
Update indirect attribute entries with the given closure. Read more
Return true
if the given attribute exists at the given location, and
false
otherwise, even if the specified attribute location is invalid
for the mesh. Read more
fn attrib_check<T, I>(&self, name: &'a str) -> Result<&Attribute<I>, Error> where
T: Any,
I: AttribIndex<Self>,
fn attrib_check<T, I>(&self, name: &'a str) -> Result<&Attribute<I>, Error> where
T: Any,
I: AttribIndex<Self>,
Determine if the given attribute is valid and exists at the given location. Read more
fn attrib_as_slice<'b, T, I>(&'b self, name: &'a str) -> Result<&'b [T], Error> where
T: 'static,
I: 'b + AttribIndex<Self>,
fn attrib_as_slice<'b, T, I>(&'b self, name: &'a str) -> Result<&'b [T], Error> where
T: 'static,
I: 'b + AttribIndex<Self>,
Expose the underlying direct attribute as a slice.
fn attrib_as_mut_slice<'b, T, I>(
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error> where
T: 'static,
I: 'b + AttribIndex<Self>,
fn attrib_as_mut_slice<'b, T, I>(
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error> where
T: 'static,
I: 'b + AttribIndex<Self>,
Expose the underlying direct attribute as a mutable slice.
fn attrib_clone_into_vec<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Vec<T, Global>, Error> where
I: 'b + AttribIndex<Self>,
T: AttributeValueHash,
fn attrib_clone_into_vec<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Vec<T, Global>, Error> where
I: 'b + AttribIndex<Self>,
T: AttributeValueHash,
Clone attribute data into a Vec<T>
. Read more
fn direct_attrib_clone_into_vec<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Vec<T, Global>, Error> where
I: 'b + AttribIndex<Self>,
T: AttributeValue,
fn direct_attrib_clone_into_vec<'b, T, I>(
&'b self,
name: &'a str
) -> Result<Vec<T, Global>, Error> where
I: 'b + AttribIndex<Self>,
T: AttributeValue,
Clone direct attribute data into a Vec<T>
.
Borrow the raw attribute from the attribute dictionary. From there you can use methods defined on the attribute itself. Read more
fn attrib_mut<I>(&mut self, name: &'a str) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
fn attrib_mut<I>(&mut self, name: &'a str) -> Result<&mut Attribute<I>, Error> where
I: AttribIndex<Self>,
Get the raw mutable attribute from the attribute dictionary. From there you can use methods defined on the attribute itself. Read more
Mesh implementation of the attribute size getter.
Mesh implementation of the attribute dictionary getter.
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceIndex>, RandomState, Global>
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary mutable getter.
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
Mesh implementation of the attribute dictionary and cache mutable getter.
Index of the destination element given the topology index.
Toplogy index: where the data lives in an attribute array.
Topology quantifier. Number of connectors in total.
Topology quantifier. Number of connectors at a particular element.
Mesh implementation of the attribute size getter.
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary getter.
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary mutable getter.
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceEdgeIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
Mesh implementation of the attribute dictionary and cache mutable getter.
Index of the destination element given the topology index.
pub fn face_vertex<FI>(&self, fidx: FI, which: usize) -> Option<FaceVertexIndex> where
FI: Copy + Into<FaceIndex>,
pub fn face_vertex<FI>(&self, fidx: FI, which: usize) -> Option<FaceVertexIndex> where
FI: Copy + Into<FaceIndex>,
Toplogy index: where the data lives in an attribute array.
Topology quantifier. Number of connectors in total.
Topology quantifier. Number of connectors at a particular element.
fn face_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex> where
I: Copy + Into<FaceIndex>,
fn face_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex> where
I: Copy + Into<FaceIndex>,
Index of the destination element from the source index.
Generate the reverse topology structure.
Mesh implementation of the attribute size getter.
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary getter.
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary mutable getter.
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<FaceVertexIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
Mesh implementation of the attribute dictionary and cache mutable getter.
Convert a point cloud into a polygon mesh.
Performs the conversion.
Convert a polygon mesh to a point cloud by erasing all polygon data.
Performs the conversion.
Convert a PolyMesh into a LineMesh. This is effectively a wireframe construction.
Note that this conversion does not merge any attributes, each face will generate its own edge. This means that two neighbouring faces will generate two overlapping edges. This is done to preserve all attribute data during the conversion, which means that some of it is duplicated.
Convert a triangle mesh to a polygon mesh.
Performs the conversion.
Convert a triangle mesh to a polygon mesh.
Convert a quad mesh into a polygon mesh.
Convert a triangle mesh into a polygon mesh.
Attributes with the same name but different types won’t be merged.
Merge an iterator of objects into one of the same type.
Merge a Vec
of objects into one of the same type.
Mesh implementation of the attribute size getter.
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<VertexIndex>, RandomState, Global>
pub fn topo_attrib_dict(
&self
) -> &HashMap<String, Attribute<VertexIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary getter.
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<VertexIndex>, RandomState, Global>
pub fn topo_attrib_dict_mut(
&mut self
) -> &mut HashMap<String, Attribute<VertexIndex>, RandomState, Global>
Mesh implementation of the attribute dictionary mutable getter.
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<VertexIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
pub fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut HashMap<String, Attribute<VertexIndex>, RandomState, Global>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>, RandomState, Global>>)
Mesh implementation of the attribute dictionary and cache mutable getter.
Vertex positions as a slice of triplets.
Vertex positions as a mutable slice of triplets.
Vertex iterator.
Mutable vertex iterator.
fn vertex_position<VI>(&self, vidx: VI) -> Self::Element where
VI: Into<VertexIndex>,
Self::Element: Clone,
fn vertex_position<VI>(&self, vidx: VI) -> Self::Element where
VI: Into<VertexIndex>,
Self::Element: Clone,
Vertex accessor.
Auto Trait Implementations
impl<T> RefUnwindSafe for PolyMesh<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for PolyMesh<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compute the bounding box of this object.
impl<T> CloneBytes for T where
T: 'static + Clone,
impl<T> CloneBytes for T where
T: 'static + Clone,
pub unsafe fn clone_bytes(
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
pub unsafe fn clone_from_bytes(
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
pub unsafe fn clone_into_raw_bytes(
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
impl<M> Connectivity<FaceVertexIndex, VertexIndex> for M where
M: FaceVertex + NumFaces + NumVertices,
impl<M> Connectivity<FaceVertexIndex, VertexIndex> for M where
M: FaceVertex + NumFaces + NumVertices,
Additional topology that may aid in computing connectivity. Read more
Precompute additional topology information prior to determining connectivity. Read more
Get the number of elements which are considered for connectivity Read more
pub fn push_neighbours<T>(
&self,
index: FaceVertexIndex,
stack: &mut Vec<FaceVertexIndex, Global>,
topo: &<M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo,
attrib: Option<&[T]>
) where
T: Default + PartialEq<T>,
pub fn push_neighbours<T>(
&self,
index: FaceVertexIndex,
stack: &mut Vec<FaceVertexIndex, Global>,
topo: &<M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo,
attrib: Option<&[T]>
) where
T: Default + PartialEq<T>,
Push all neighbours of the element at the given index
to the given stack
. Read more
Determine the connectivity of a set of meshes. Read more
Determine the connectivity of a set of meshes. Read more
impl<M> Connectivity<VertexIndex, FaceIndex> for M where
M: FaceVertex + NumVertices + NumFaces,
impl<M> Connectivity<VertexIndex, FaceIndex> for M where
M: FaceVertex + NumVertices + NumFaces,
Additional topology that may aid in computing connectivity. Read more
Precompute additional topology information prior to determining connectivity. Read more
Get the number of elements which are considered for connectivity Read more
pub fn push_neighbours<T>(
&self,
index: VertexIndex,
stack: &mut Vec<VertexIndex, Global>,
topo: &<M as Connectivity<VertexIndex, FaceIndex>>::Topo,
Option<&[T]>
) where
T: Default + PartialEq<T>,
pub fn push_neighbours<T>(
&self,
index: VertexIndex,
stack: &mut Vec<VertexIndex, Global>,
topo: &<M as Connectivity<VertexIndex, FaceIndex>>::Topo,
Option<&[T]>
) where
T: Default + PartialEq<T>,
Push all neighbours of the element at the given index
to the given stack
. Read more
Determine the connectivity of a set of meshes. Read more
Determine the connectivity of a set of meshes. Read more
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
pub unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
type Output = <I as GetIndex<'a, S>>::Output
fn at(&self, idx: I) -> Self::Output
fn at(&self, idx: I) -> Self::Output
Return a value at the given index. This is provided as the checked
version of get
that will panic if the equivalent get
call is None
,
which typically means that the given index is out of bounds. Read more
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
Return a value at the given index. This is provided as the unchecked
version of get
that has undefined behavior when the index is out of bounds. Read more
type Output = <I as IsolateIndex<S>>::Output
pub unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output
pub fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
pub unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool
pub fn partition_by_attrib<T, Src>(
&self,
attrib: &str
) -> (Vec<usize, Global>, usize) where
T: AttributeValueHash,
Src: AttribIndex<M>,
pub fn partition_by_attrib<T, Src>(
&self,
attrib: &str
) -> (Vec<usize, Global>, usize) where
T: AttributeValueHash,
Src: AttribIndex<M>,
Returns a partitioning by unique values of the given attribute. Read more
pub fn partition_by_attrib_by_sort<T, Src>(
&self,
attrib: &str
) -> (Vec<usize, Global>, usize) where
T: PartialOrd<T> + AttributeValue,
Src: AttribIndex<M>,
pub fn partition_by_attrib_by_sort<T, Src>(
&self,
attrib: &str
) -> (Vec<usize, Global>, usize) where
T: PartialOrd<T> + AttributeValue,
Src: AttribIndex<M>,
Returns a partitioning by unique values of the given attribute. Read more
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
This method tells this type how it can be pushed to a Vec
as an array.
Rotate the mesh using the given column-major rotation matrix.
Rotate the object around the given unit vector u
by the given angle theta
(in radians). Read more
Return a version of self
rotated about the unit vector u
by the given angle theta
(in
radians). Read more
Return a version of self
rotated using the given column-major rotation matrix
Return a version of self
rotated about the Euler vector e
.
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
Return a version of self
translated by the given translation vector t
.