[][src]Struct plexus::index::HashIndexer

pub struct HashIndexer<T, K> where
    T: Topological,
    K: Clone + Eq + Hash
{ /* fields omitted */ }

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 be hashable (implement Hash). Most vertex data includes floating-point values (i.e., f32 or f64), which do not implement Hash. To avoid problems with hashing, the decorum crate can be used. The Finite and NotNan types are particularly useful for this and will panic if illegal values result from a computation.

Examples

use decorum::N64;
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<N64>>>()
    .triangulate()
    .index_vertices::<Flat3, _>(HashIndexer::default());

Implementations

impl<T, K> HashIndexer<T, K> where
    T: Topological,
    K: Clone + Eq + Hash
[src]

pub fn new() -> Self[src]

Creates a new HashIndexer.

Trait Implementations

impl<T, K> Default for HashIndexer<T, K> where
    T: Topological,
    K: Clone + Eq + Hash
[src]

impl<T, K> Indexer<T, K> for HashIndexer<T, K> where
    T: Topological,
    K: Clone + Eq + Hash
[src]

Auto Trait Implementations

impl<T, K> RefUnwindSafe for HashIndexer<T, K> where
    K: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, K> Send for HashIndexer<T, K> where
    K: Send,
    T: Send

impl<T, K> Sync for HashIndexer<T, K> where
    K: Sync,
    T: Sync

impl<T, K> Unpin for HashIndexer<T, K> where
    K: Unpin,
    T: Unpin

impl<T, K> UnwindSafe for HashIndexer<T, K> where
    K: UnwindSafe,
    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<T> From<T> for T[src]

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

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

impl<T, U> IntoGeometry<U> for T where
    U: FromGeometry<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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<V, T> VZip<V> for T where
    V: MultiLane<T>,