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

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

Associated Types

type Item: Polygonal[src]

Loading content...

Required methods

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

Loading content...

Implementors

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

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

Converts the index buffer of a MeshBuffer from flat data into structured data.

Examples

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

type E3 = Point3<f64>;

let cube = Cube::new();
let buffer = MeshBuffer::<Flat3, E3>::from_raw_buffers(
    cube.indexing_polygons::<Position>()
        .triangulate()
        .vertices(),
    cube.vertices::<Position<E3>>(),
)
.unwrap();
let buffer = buffer.into_structured_index();
for trigon in buffer.as_index_slice() {
    // ...
}

type Item = Trigon<N>

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

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

Converts the index buffer of a MeshBuffer from flat data into structured data.

Examples

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

type E3 = Point3<f64>;

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

type Item = Tetragon<N>

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

type Item = P

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

Loading content...