输入(散乱点):std::vector<Point2f> points
错误调用:
Polygon2f rect;
CGAL::min_rectangle_2(points.begin(), points.end(), std::back_inserter(rect));
正确调用:
Polygon2f convex_hull;
CGAL::convex_hull_2(pts.begin(), pts.end(), std::back_inserter(convex_hull));
Polygon2f rect;
CGAL::min_rectangle_2(convex_hull.vertices_begin(), convex_hull.vertices_end(), std::back_inserter(rect));
原因(Precondition):
The points denoted by the range [vertices begin, vertices end] form the boundary of a simple convex
polygon in counterclockwise orientation.
https://blog.sciencenet.cn/blog-562235-563526.html
上一篇:
Boost Graph Library 快速入门下一篇:
C/C++结构体的前向声明