Trait libreda_db::prelude::ToPolygon [−][src]
Trait for the conversion of a geometric shape to a polygon.
Required methods
pub fn to_polygon(&self) -> Polygon<T>
[src]
Convert the geometric object into a polygon.
Implementors
impl<T> ToPolygon<T> for Geometry<T> where
T: CoordinateType + NumCast,
[src]
T: CoordinateType + NumCast,
pub 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> ToPolygon<T> for Rect<T> where
T: CoordinateType,
[src]
T: CoordinateType,