Specialized Template Function lanelet::geometry::convexPartition< BasicPolygon2d >
Defined in File Polygon.h
Function Documentation
-
template<>
inline IfPoly<BasicPolygon2d, BasicPolygons2d> lanelet::geometry::convexPartition<BasicPolygon2d>(const BasicPolygon2d &poly) Split a concave polygon into convex parts.
Internally computes a Delaunay triangulation which is greedily merged into convex parts. Guaranteed to deliver a partition with at most 2N+1 parts if N is minimum partition. Since boost only allows integral types, the triangulation is only millimeter-accurate, even though the resulting points are identical to the input points.
- Parameters:
poly – BasicPolygon2d to partition
- Returns:
a list of convex polygons yielding the original polygon if merged.