Function polygon_utils::triangulate(const polygon_msgs::msg::Polygon2D&)
Defined in File polygon_utils.hpp
Function Documentation
-
std::vector<polygon_msgs::msg::Point2D> polygon_utils::triangulate(const polygon_msgs::msg::Polygon2D &polygon)
Decompose a simple polygon into a set of triangles.
See https://en.wikipedia.org/wiki/Polygon_triangulation
Implementation from https://github.com/mapbox/earcut.hpp
- Parameters:
polygon – The polygon to deconstruct
- Returns:
A vector of points where each set of three points represents a triangle