logo
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

Creates a new HashIndexer.

Trait Implementations

Returns the “default value” for a type. Read more

Indexes a vertex using a keying function. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.