33 #ifdef OGDF_INCLUDE_CGAL
42 # include <CGAL/number_utils.h>
49 template<
typename Kernel>
50 std::vector<unsigned int> triangulation(
const geometry::Polygon_t<Kernel>& polygon) {
51 using MB_Point = std::array<double, 2>;
53 if (polygon.size() > 3) {
54 std::vector<std::vector<MB_Point>> mb_polygon;
56 for (
unsigned int i = 0; i < polygon.size(); ++i) {
57 mb_polygon[0].push_back(
58 {CGAL::to_double(polygon[i].x()), CGAL::to_double(polygon[i].y())});
61 return mapbox::earcut<unsigned int>(mb_polygon);