[−][src]Trait plexus::FromRawBuffers
Associated Types
Loading content...Required methods
fn from_raw_buffers<I, J>(indices: I, vertices: J) -> Result<Self, Self::Error> where
I: IntoIterator<Item = N>,
J: IntoIterator<Item = G>,
I: IntoIterator<Item = N>,
J: IntoIterator<Item = G>,
Implementors
impl<A, N, M, G> FromRawBuffers<M, G> for MeshBuffer<Flat<A, N>, G> where
A: NonZero + Unsigned,
N: Copy + Integer + NumCast + Unsigned,
M: Copy + Integer + NumCast + Unsigned,
<Flat<A, N> as IndexBuffer>::Item: ToPrimitive,
[src]
A: NonZero + Unsigned,
N: Copy + Integer + NumCast + Unsigned,
M: Copy + Integer + NumCast + Unsigned,
<Flat<A, N> as IndexBuffer>::Item: ToPrimitive,
type Error = BufferError
fn from_raw_buffers<I, J>(indices: I, vertices: J) -> Result<Self, BufferError> where
I: IntoIterator<Item = M>,
J: IntoIterator<Item = G>,
[src]
I: IntoIterator<Item = M>,
J: IntoIterator<Item = G>,
Creates a flat MeshBuffer
from raw index and vertex buffers.
Errors
Returns an error if the index data is out of bounds within the vertex buffer or if the number of indices disagrees with the arity of the index buffer.
Examples
use plexus::buffer::MeshBuffer3; use plexus::prelude::*; use plexus::primitive; use plexus::primitive::cube::Cube; use plexus::primitive::index::HashIndexer; let cube = Cube::new(); let (indices, vertices) = primitive::zip_vertices(( cube.polygons_with_position(), cube.polygons_with_normal(), cube.polygons_with_uv_map(), )) .flat_index_vertices(HashIndexer::default()); let buffer = MeshBuffer3::<usize, _>::from_raw_buffers(indices, vertices).unwrap();
impl<P, G, H> FromRawBuffers<P, H> for MeshGraph<G> where
P: IntoVertices + Polygonal,
P::Vertex: Integer + ToPrimitive + Unsigned,
G: Geometry,
H: IntoGeometry<G::Vertex>,
[src]
P: IntoVertices + Polygonal,
P::Vertex: Integer + ToPrimitive + Unsigned,
G: Geometry,
H: IntoGeometry<G::Vertex>,
type Error = GraphError
fn from_raw_buffers<I, J>(indices: I, vertices: J) -> Result<Self, Self::Error> where
I: IntoIterator<Item = P>,
J: IntoIterator<Item = H>,
[src]
I: IntoIterator<Item = P>,
J: IntoIterator<Item = H>,
impl<P, Q, G> FromRawBuffers<Q, G> for MeshBuffer<Structured<P>, G> where
P: Polygonal,
P::Vertex: Copy + Integer + NumCast + Unsigned,
Q: Into<<Structured<P> as IndexBuffer>::Item>,
Structured<P>: IndexBuffer,
<Structured<P> as IndexBuffer>::Item: Copy + IntoVertices + Topological<Vertex = P::Vertex>,
[src]
P: Polygonal,
P::Vertex: Copy + Integer + NumCast + Unsigned,
Q: Into<<Structured<P> as IndexBuffer>::Item>,
Structured<P>: IndexBuffer,
<Structured<P> as IndexBuffer>::Item: Copy + IntoVertices + Topological<Vertex = P::Vertex>,
type Error = BufferError
fn from_raw_buffers<I, J>(indices: I, vertices: J) -> Result<Self, BufferError> where
I: IntoIterator<Item = Q>,
J: IntoIterator<Item = G>,
[src]
I: IntoIterator<Item = Q>,
J: IntoIterator<Item = G>,
Creates a structured MeshBuffer
from raw index and vertex buffers.
Errors
Returns an error if the index data is out of bounds within the vertex buffer.
Examples
use nalgebra::Point3; use plexus::buffer::MeshBufferN; use plexus::prelude::*; use plexus::primitive::sphere::UvSphere; let sphere = UvSphere::new(8, 8); let buffer = MeshBufferN::<usize, _>::from_raw_buffers( sphere.indices_for_position(), sphere .vertices_with_position() .map(|position| -> Point3<f32> { position.into() }), ) .unwrap();