[][src]Trait plexus::FromRawBuffersWithArity

pub trait FromRawBuffersWithArity<N, G>: Sized {
    type Error: Debug;
    fn from_raw_buffers_with_arity<I, J>(
        indices: I,
        vertices: J,
        arity: usize
    ) -> Result<Self, Self::Error>
    where
        I: IntoIterator<Item = N>,
        J: IntoIterator<Item = G>
; }

Associated Types

type Error: Debug

Loading content...

Required methods

fn from_raw_buffers_with_arity<I, J>(
    indices: I,
    vertices: J,
    arity: usize
) -> Result<Self, Self::Error> where
    I: IntoIterator<Item = N>,
    J: IntoIterator<Item = G>, 

Loading content...

Implementors

impl<N, G, H> FromRawBuffersWithArity<N, H> for MeshGraph<G> where
    N: Integer + ToPrimitive + Unsigned,
    G: Geometry,
    H: IntoGeometry<G::Vertex>, 
[src]

type Error = GraphError

fn from_raw_buffers_with_arity<I, J>(
    indices: I,
    vertices: J,
    arity: usize
) -> Result<Self, Self::Error> where
    I: IntoIterator<Item = N>,
    J: IntoIterator<Item = H>, 
[src]

Creates a MeshGraph from raw index and vertex buffers. The arity of the polygons in the index buffer must be known and constant.

Errors

Returns an error if the arity of the index buffer is not constant, any index is out of bounds, or there is an error inserting topology into the mesh.

Examples

use nalgebra::Point3;
use plexus::graph::MeshGraph;
use plexus::prelude::*;
use plexus::primitive::index::LruIndexer;
use plexus::primitive::sphere::UvSphere;

let (indices, positions) = UvSphere::new(16, 16)
    .polygons_with_position()
    .triangulate()
    .flat_index_vertices(LruIndexer::with_capacity(256));
let mut graph =
    MeshGraph::<Point3<f64>>::from_raw_buffers_with_arity(indices, positions, 3).unwrap();
Loading content...