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
points: I
The iterator yielding all points in the polygon.
Methods
impl<I> Polygon<I> where
I: Iterator,
[src]
impl<I> Polygon<I> where
I: Iterator,
pub fn new<P>(points: P) -> Self where
P: IntoIterator<IntoIter = I, Item = I::Item>,
[src]
pub fn new<P>(points: P) -> Self where
P: IntoIterator<IntoIter = I, Item = I::Item>,
Construct a new polygon from the given list of points describing its vertices.
pub fn triangles(self) -> Option<Triangles<I>>
[src]
pub fn triangles(self) -> Option<Triangles<I>>
Triangulate the polygon given as a list of Point
s describing its sides.
Returns None
if the polygon's iterator yields less than two points.
pub fn contains(self, p: &I::Item) -> Option<Tri<I::Item>> where
I::Item: Vertex2d,
[src]
pub fn contains(self, p: &I::Item) -> Option<Tri<I::Item>> where
I::Item: Vertex2d,
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.
pub fn bounding_rect(self) -> Option<Rect<<I::Item as Vertex>::Scalar>> where
I::Item: Vertex2d,
[src]
pub fn bounding_rect(self) -> Option<Rect<<I::Item as Vertex>::Scalar>> where
I::Item: Vertex2d,
The Rect
that bounds the polygon.
Returns None
if the polygon's point iterator is empty.
pub fn bounding_cuboid(self) -> Option<Cuboid<<I::Item as Vertex>::Scalar>> where
I::Item: Vertex3d,
[src]
pub fn bounding_cuboid(self) -> Option<Cuboid<<I::Item as Vertex>::Scalar>> where
I::Item: Vertex3d,
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]
impl<I: Clone> Clone for Polygon<I>
fn clone(&self) -> Polygon<I>
[src]
fn clone(&self) -> Polygon<I>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<I: Debug> Debug for Polygon<I>
[src]
impl<I: Debug> Debug for Polygon<I>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<I: PartialEq> PartialEq for Polygon<I>
[src]
impl<I: PartialEq> PartialEq for Polygon<I>
fn eq(&self, other: &Polygon<I>) -> bool
[src]
fn eq(&self, other: &Polygon<I>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Polygon<I>) -> bool
[src]
fn ne(&self, other: &Polygon<I>) -> bool
This method tests for !=
.
impl<I: Eq> Eq for Polygon<I>
[src]
impl<I: Eq> Eq for Polygon<I>