Struct nannou::geom::polygon::Polygon[][src]

pub struct Polygon<I> {
    pub points: I,
}

A simple type wrapper around a list of points that describe a polygon.

Fields

The iterator yielding all points in the polygon.

Methods

impl<I> Polygon<I> where
    I: Iterator
[src]

Construct a new polygon from the given list of points describing its vertices.

Triangulate the polygon given as a list of Points describing its sides.

Returns None if the polygon's iterator yields less than two points.

Returns Some with the touched triangle if the given Point is over the polygon described by the given series of points.

This uses the triangles function internally.

The Rect that bounds the polygon.

Returns None if the polygon's point iterator is empty.

The `Cuboid that bounds the polygon.

Returns None if the polygon's point iterator is empty.

Trait Implementations

impl<I: Clone> Clone for Polygon<I>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<I: Debug> Debug for Polygon<I>
[src]

Formats the value using the given formatter. Read more

impl<I: PartialEq> PartialEq for Polygon<I>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<I: Eq> Eq for Polygon<I>
[src]

Auto Trait Implementations

impl<I> Send for Polygon<I> where
    I: Send

impl<I> Sync for Polygon<I> where
    I: Sync