[][src]Struct genmesh::Neighbors

pub struct Neighbors<T> {
    pub vertices: Vec<T>,
    pub polygons: Vec<Triangle<usize>>,
    // some fields omitted
}

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]

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]

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

impl<T> Sync for Neighbors<T> where
    T: Sync

impl<T> Send for Neighbors<T> where
    T: Send

impl<T> UnwindSafe for Neighbors<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Neighbors<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]