rgeometry/algorithms/polygonization/star.rs
1use crate::data::{Point, Polygon};
2use crate::{Error, PolygonScalar};
3
4pub fn new_star_polygon<T>(
5 mut vertices: Vec<Point<T>>,
6 point: &Point<T>,
7) -> Result<Polygon<T>, Error>
8where
9 T: PolygonScalar,
10{
11 vertices.sort_by(|a, b| point.ccw_cmp_around(a, b));
12 Polygon::new(vertices)
13}