[−][src]Struct genmesh::Neighbors
Neighbors search accelerating structure.
Fields
vertices: Vec<T>
Mesh vertices.
polygons: Vec<Triangle<usize>>
Mesh polygons.
Methods
impl<T> Neighbors<T>
[src]
pub fn new(vertices: Vec<T>, polygons: Vec<Triangle<usize>>) -> Self
[src]
Build a Neighbors search based on the supplied vertices and supplied triangle list.
pub fn split(self) -> (Vec<T>, Vec<Triangle<usize>>)
[src]
return the vector and triangle list used to create the Neighbors
pub fn vertex_neighbors(&self, t: &usize) -> Option<&[usize]>
[src]
looks up the index of every polygon that contains vertex t, this can be used to calculate new faces
pub fn polygon_neighbors(&self, i: usize) -> Option<HashSet<usize>>
[src]
looks up the index of every polygon that is a neighbor of polygon at index i. This can be used to prep data for a Geometry shader (eg trinagle_adjacency)
pub fn normal_for_face<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
[src]
F: FnMut(&T) -> Normal,
Calculate the normal for face. This is a flat
shading
You must supply a function that can be used to lookup The position which is needed to calculate the normal
pub fn normal_for_vertex<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
[src]
F: FnMut(&T) -> Normal,
Calculate the normal for an vertex based on the average
of it's Neighbors this is a smooth
shading
You must supply a function that can be used to lookup The position which is needed to calculate the normal
Auto Trait Implementations
impl<T> Unpin for Neighbors<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Neighbors<T> where
T: Sync,
T: Sync,
impl<T> Send for Neighbors<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for Neighbors<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Neighbors<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,