[][src]Trait plexus::buffer::IntoStructuredIndex

pub trait IntoStructuredIndex<G> where
    <Self::Item as Topological>::Vertex: Copy + Integer + NumCast + Unsigned
{ type Item: Polygonal; fn into_structured_index(self) -> MeshBuffer<Self::Item, G>; }

Associated Types

type Item: Polygonal

Loading content...

Required methods

fn into_structured_index(self) -> MeshBuffer<Self::Item, G>

Loading content...

Implementors

impl<N, G> IntoStructuredIndex<G> for MeshBuffer<Flat3<N>, G> where
    N: Copy + Integer + NumCast + Unsigned,
    Trigon<N>: Grouping<Item = Trigon<N>>, 
[src]

type Item = Trigon<N>

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

Converts a flat index buffer into a structured index buffer.

Examples

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

let cube = Cube::new();
let buffer = MeshBuffer3::<usize, _>::from_raw_buffers(
    cube.indexing_polygons::<Position>()
        .triangulate()
        .vertices(),
    cube.vertices::<Position<Point3<f32>>>(),
)
.unwrap();
let buffer = buffer.into_structured_index();
for trigon in buffer.as_index_slice() {
    // ...
}

impl<N, G> IntoStructuredIndex<G> for MeshBuffer<Flat4<N>, G> where
    N: Copy + Integer + NumCast + Unsigned,
    Tetragon<N>: Grouping<Item = Tetragon<N>>, 
[src]

type Item = Tetragon<N>

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

Converts a flat index buffer into a structured index buffer.

Examples

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

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

impl<P, G> IntoStructuredIndex<G> for MeshBuffer<P, G> where
    P: Grouping + Polygonal,
    P::Vertex: Copy + Integer + NumCast + Unsigned
[src]

type Item = P

Loading content...