[][src]Struct wavefront::Polygon

pub struct Polygon<'a> { /* fields omitted */ }

A polygon defined in an OBJ.

Implementations

impl<'a> Polygon<'a>[src]

pub fn vertex(&self, index: usize) -> Option<Vertex<'a>>[src]

Returns a specific Vertex by index.

pub fn vertices(&self) -> impl ExactSizeIterator<Item = Vertex<'a>> + Clone + 'a[src]

Returns an iterator over the Vertexs in this Polygon.

pub fn triangles(
    &self
) -> impl ExactSizeIterator<Item = [Vertex<'a>; 3]> + Clone + 'a
[src]

Returns an iterator over triangles in this Polygon by splitting up the polygon into smaller pieces.

This function is useful when your application supports only triangles as input but the OBJ contains unusual polygons such as quads.

The triangles produced will be arranged in a fan and will follow the winding order of the original polygon.

This function assumes that:

  • The polygon is concave
  • The vertices of the polygon all lie in the same plane

Trait Implementations

impl<'a> Clone for Polygon<'a>[src]

impl<'a> Copy for Polygon<'a>[src]

impl<'a> Debug for Polygon<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Polygon<'a>[src]

impl<'a> Send for Polygon<'a>[src]

impl<'a> Sync for Polygon<'a>[src]

impl<'a> Unpin for Polygon<'a>[src]

impl<'a> UnwindSafe for Polygon<'a>[src]

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.