Struct poly2tri::Polygon
[−]
[src]
pub struct Polygon { /* fields omitted */ }
Basic polygon interface
Methods
impl Polygon
[src]
This struct implements a polygon. Note that this is currently a wrapper around a c library and as such it's bubbles through some of the underlying implementation details such as panicking on duplicated points.
fn new() -> Polygon
Creates a new empty polygon.
fn from_iterator<'a, I>(points: I) -> Polygon where
I: Iterator<Item = &'a [f64; 2]>,
I: Iterator<Item = &'a [f64; 2]>,
Creates a polygon from an iterator of points.
fn add_point(&mut self, x: f64, y: f64)
Adds a single point to the polygon. These points must not be repeated!
fn get_point(&self, idx: usize) -> [f64; 2]
Looks up a point at a certain index.
fn size(&self) -> usize
Returns the size of the polygon (number of points).