Trait iron_shapes::polygon::ToPolygon[][src]

pub trait ToPolygon<T> where
    T: CoordinateType
{ fn to_polygon(&self) -> Polygon<T>; }

Trait for the conversion of a geometric shape to a polygon.

Required methods

fn to_polygon(&self) -> Polygon<T>[src]

Convert the geometric object into a polygon.

Loading content...

Implementors

impl<T: CoordinateType + NumCast> ToPolygon<T> for Geometry<T>[src]

fn to_polygon(&self) -> Polygon<T>[src]

Convert a geometry into a polygon.

The coordinate type must implement NumCast because there is currently no way to convert a Path into a polygon without converting it to a float type first.

Examples

use iron_shapes::prelude::*;
let rect = Rect::new((0, 0), (1, 2));
// Convert the rectangle to a `Geometry`.
let g: Geometry<_> = rect.into();
assert_eq!(g.to_polygon(), rect.to_polygon())

impl<T: CoordinateType> ToPolygon<T> for Rect<T>[src]

Loading content...