logo
pub struct Flat<T, const N: usize> where
    Constant<N>: ToType,
    TypeOf<N>: NonZero,
    T: Copy + Integer + Unsigned
{ /* private fields */ }
Expand description

Flat index buffer meta-grouping.

Describes a flat index buffer with a constant arity. The number of vertices in the indexed topological structures is specified using a constant parameter N, which represents the number of grouped elements in the index buffer. For example, Flat<_, 3> describes an index buffer with indices in implicit and contiguous groups of three. Note that this constant may be distinct from the arity of the indexed topological structures (i.e., if N is less than three, then arity is N - 1 and may be zero.).

Unlike structured groupings, this meta-grouping is needed to associate an index type with an implicit grouping and arity. For example, Vec<usize> implements both IndexBuffer<Flat<usize, 3>> (a triangular buffer) and IndexBuffer<Flat<usize, 4>> (a quadrilateral buffer).

See the index module documention for more information about index buffers.

Examples

Creating a MeshBuffer with a flat and triangular index buffer:

use plexus::buffer::MeshBuffer;
use plexus::index::Flat;
use plexus::prelude::*;

let mut buffer = MeshBuffer::<Flat<usize, 3>, (f64, f64, f64)>::default();

Trait Implementations

Formats the value using the given formatter. Read more

The elements of flat index buffers are indices. These indices are implicitly grouped by the arity of the buffer (N).

The type of individual indices in the buffer. 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.