[][src]Trait plexus::buffer::IntoFlatIndex

pub trait IntoFlatIndex<A, G> where
    A: NonZero + Unsigned, 
{ type Item: Copy + Integer + NumCast + Unsigned; fn into_flat_index(self) -> MeshBuffer<Flat<A, Self::Item>, G>; }

Associated Types

type Item: Copy + Integer + NumCast + Unsigned

Loading content...

Required methods

fn into_flat_index(self) -> MeshBuffer<Flat<A, Self::Item>, G>

Loading content...

Implementors

impl<A, N, G> IntoFlatIndex<A, G> for MeshBuffer<Flat<A, N>, G> where
    A: NonZero + Unsigned,
    N: Copy + Integer + NumCast + Unsigned
[src]

type Item = N

impl<N, G> IntoFlatIndex<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, G> for MeshBuffer<Tetragon<N>, G> where
    N: Copy + Integer + NumCast + Unsigned
[src]

type Item = N

fn into_flat_index(self) -> MeshBuffer<Flat<U4, Self::Item>, G>[src]

Converts a structured index buffer into a flat index buffer.

Examples

use nalgebra::Point3;
use plexus::buffer::MeshBuffer;
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;
use plexus::primitive::Tetragon;

let cube = Cube::new();
let buffer = MeshBuffer::<Tetragon<usize>, _>::from_raw_buffers(
    cube.indexing_polygons::<Position>(),
    cube.vertices::<Position<Point3<f64>>>(),
)
.unwrap();
let buffer = buffer.into_flat_index();
for index in buffer.as_index_slice() {
    // ...
}

impl<N, G> IntoFlatIndex<UInt<UInt<UTerm, B1>, B1>, G> for MeshBuffer<Trigon<N>, G> where
    N: Copy + Integer + NumCast + Unsigned
[src]

type Item = N

fn into_flat_index(self) -> MeshBuffer<Flat<U3, Self::Item>, G>[src]

Converts a structured index buffer into a flat index buffer.

Examples

use nalgebra::Point3;
use plexus::buffer::MeshBuffer;
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;
use plexus::primitive::Trigon;

let cube = Cube::new();
let buffer = MeshBuffer::<Trigon<usize>, _>::from_raw_buffers(
    cube.indexing_polygons::<Position>().triangulate(),
    cube.vertices::<Position<Point3<f32>>>(),
)
.unwrap();
let buffer = buffer.into_flat_index();
for index in buffer.as_index_slice() {
    // ...
}
Loading content...