Function autoware_utils_geometry::triangulate(const alt::Polygon2d&)
Defined in File ear_clipping.hpp
Function Documentation
-
std::vector<alt::ConvexPolygon2d> autoware_utils_geometry::triangulate(const alt::Polygon2d &polygon)
triangulates a polygon into convex triangles
simplifies a concave polygon, with or without holes, into a set of triangles the size of the
pointsvector at the end of the perform_triangulation algorithm is described as follow:outer_points: Number of points in the initial outer linked list.hole_points: Number of points in all inner polygons.2 * n_holes: Additional points for bridging holes, wheren_holesis the number of holes. the final size ofpointsvector is:outer_points + hole_points + 2 * n_holes.
- Returns:
A vector of convex triangles representing the triangulated polygon.