pub struct Normal<S = ()> { /* private fields */ }
Expand description
Meta-attribute for surface normals.
Describes the surface normals of a polytope. The generated data is derived
from the type parameter S
, which typically requires EuclideanSpace
.
Examples
Generating raw buffers with normal data of a $uv$-sphere:
use decorum::R64;
use nalgebra::Point3;
use plexus::index::{Flat3, HashIndexer};
use plexus::prelude::*;
use plexus::primitive::generate::Normal;
use plexus::primitive::sphere::UvSphere;
let (indices, normals) = UvSphere::new(8, 8)
.polygons::<Normal<Point3<R64>>>()
.map_vertices(|normal| normal.into_inner())
.triangulate()
.index_vertices::<Flat3, _>(HashIndexer::default());
Trait Implementations
sourceimpl<S> AttributeGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
sourceimpl<S> AttributeGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
sourceimpl<S> AttributePolygonGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributePolygonGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = NGon<Unit<<S as EuclideanSpace>::CoordinateSpace>, 4_usize>
fn polygon_from(&self, state: &Self::State, index: usize) -> Self::Output
sourceimpl<S> AttributePolygonGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributePolygonGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = BoundedPolygon<Unit<<S as EuclideanSpace>::CoordinateSpace>>
fn polygon_from(&self, _: &Self::State, index: usize) -> Self::Output
sourceimpl<S> AttributeVertexGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeVertexGenerator<Normal<S>> for Cube where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = Unit<<S as EuclideanSpace>::CoordinateSpace>
fn vertex_count(&self) -> usize
fn vertex_from(&self, _: &Self::State, index: usize) -> Self::Output
sourceimpl<S> AttributeVertexGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
impl<S> AttributeVertexGenerator<Normal<S>> for UvSphere where
S: EuclideanSpace + FiniteDimensional<N = U3>,
type Output = Unit<<S as EuclideanSpace>::CoordinateSpace>
fn vertex_count(&self) -> usize
fn vertex_from(&self, _: &Self::State, index: usize) -> Self::Output
sourceimpl<S> IndexingPolygonGenerator<Normal<S>> for Cube
impl<S> IndexingPolygonGenerator<Normal<S>> for Cube
sourceimpl<S> IndexingPolygonGenerator<Normal<S>> for UvSphere
impl<S> IndexingPolygonGenerator<Normal<S>> for UvSphere
type Output = BoundedPolygon<usize>
fn indexing_polygon(&self, index: usize) -> Self::Output
impl<S> Attribute for Normal<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Normal<S>
impl<S> Send for Normal<S>
impl<S> Sync for Normal<S>
impl<S> Unpin for Normal<S>
impl<S> UnwindSafe for Normal<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.