pub struct Position<S = ()> { /* private fields */ }
Expand description
Meta-attribute for positions.
Describes the position of vertices in a polytope. The generated data is
derived from the type parameter S
, which typically requires
EuclideanSpace
.
Examples
Generating raw buffers with positional data of a cube:
use decorum::R64;
use nalgebra::Point3;
use plexus::index::{Flat3, HashIndexer};
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;
use plexus::primitive::UnboundedPolygon;
let (indices, positions) = Cube::new()
.polygons::<Position<Point3<R64>>>()
.triangulate()
.index_vertices::<UnboundedPolygon<usize>, _>(HashIndexer::default());
Trait Implementations
sourceimpl<S> AttributeGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
sourceimpl<S> AttributeGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
sourceimpl<S> AttributePolygonGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributePolygonGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
sourceimpl<S> AttributePolygonGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributePolygonGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = BoundedPolygon<S>
fn polygon_from(&self, state: &Self::State, index: usize) -> Self::Output
sourceimpl<S> AttributeVertexGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeVertexGenerator<Position<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = S
fn vertex_count(&self) -> usize
fn vertex_from(&self, state: &Self::State, index: usize) -> Self::Output
sourceimpl<S> AttributeVertexGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeVertexGenerator<Position<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = S
fn vertex_count(&self) -> usize
fn vertex_from(&self, state: &Self::State, index: usize) -> Self::Output
sourceimpl<S> IndexingPolygonGenerator<Position<S>> for Cube
impl<S> IndexingPolygonGenerator<Position<S>> for Cube
sourceimpl<S> IndexingPolygonGenerator<Position<S>> for UvSphere
impl<S> IndexingPolygonGenerator<Position<S>> for UvSphere
type Output = BoundedPolygon<usize>
fn indexing_polygon(&self, index: usize) -> Self::Output
impl<S> Attribute for Position<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Position<S>
impl<S> Send for Position<S>
impl<S> Sync for Position<S>
impl<S> Unpin for Position<S>
impl<S> UnwindSafe for Position<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromGeometry<T> for T
impl<T> FromGeometry<T> for T
fn from_geometry(other: T) -> T
sourceimpl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
impl<T, U> IntoGeometry<U> for T where
U: FromGeometry<T>,
fn into_geometry(self) -> U
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.