Template Function lanelet::geometry::convexPartition

Function Documentation

template<typename Polygon2dT>
IfPoly<Polygon2dT, BasicPolygons2d> lanelet::geometry::convexPartition(const Polygon2dT &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.

Template Parameters:

Polygon2dT – Polygon Type

Parameters:

poly – Polygon to partition

Returns:

a list of convex polygons yielding the original polygon if merged.