pub struct Polygon<'a> { /* private fields */ }Expand description
A polygon defined in an OBJ.
Implementations§
Source§impl<'a> Polygon<'a>
impl<'a> Polygon<'a>
Sourcepub fn vertices(&self) -> impl ExactSizeIterator<Item = Vertex<'a>> + Clone + 'a
pub fn vertices(&self) -> impl ExactSizeIterator<Item = Vertex<'a>> + Clone + 'a
Sourcepub fn triangles(
&self,
) -> impl ExactSizeIterator<Item = [Vertex<'a>; 3]> + Clone + 'a
pub fn triangles( &self, ) -> impl ExactSizeIterator<Item = [Vertex<'a>; 3]> + Clone + 'a
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> Copy for Polygon<'a>
Auto Trait Implementations§
impl<'a> Freeze for Polygon<'a>
impl<'a> RefUnwindSafe for Polygon<'a>
impl<'a> Send for Polygon<'a>
impl<'a> Sync for Polygon<'a>
impl<'a> Unpin for Polygon<'a>
impl<'a> UnwindSafe for Polygon<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more