Struct plexus::index::HashIndexer
source · [−]pub struct HashIndexer<T, K> where
T: Topological,
K: Clone + Eq + Hash, { /* private fields */ }
Expand description
Hashing vertex indexer.
This indexer hashes key data for vertices to form an index. This is fast, reliable, and requires no configuration. Prefer this indexer when possible.
The vertex key data must implement Hash
. Vertex data often includes
floating-point values (i.e., f32
or f64
), which do not implement
Hash
. Types from the decorum
crate can be used to allow
floating-point data to be hashed.
Examples
use decorum::R64;
use nalgebra::Point3;
use plexus::index::{Flat3, HashIndexer};
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;
let (indices, positions) = Cube::new()
.polygons::<Position<Point3<R64>>>()
.triangulate()
.index_vertices::<Flat3, _>(HashIndexer::default());
Implementations
sourceimpl<T, K> HashIndexer<T, K> where
T: Topological,
K: Clone + Eq + Hash,
impl<T, K> HashIndexer<T, K> where
T: Topological,
K: Clone + Eq + Hash,
Trait Implementations
sourceimpl<T, K> Default for HashIndexer<T, K> where
T: Topological,
K: Clone + Eq + Hash,
impl<T, K> Default for HashIndexer<T, K> where
T: Topological,
K: Clone + Eq + Hash,
Auto Trait Implementations
impl<T, K> RefUnwindSafe for HashIndexer<T, K> where
K: RefUnwindSafe,
impl<T, K> Send for HashIndexer<T, K> where
K: Send,
impl<T, K> Sync for HashIndexer<T, K> where
K: Sync,
impl<T, K> Unpin for HashIndexer<T, K> where
K: Unpin,
impl<T, K> UnwindSafe for HashIndexer<T, K> where
K: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromGeometry<T> for T
impl<T> FromGeometry<T> for T
fn from_geometry(other: T) -> T
sourceimpl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
impl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
fn into_geometry(self) -> U
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if 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
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.