Liangliang Nan (南亮亮)分享 http://blog.sciencenet.cn/u/LiangliangNan 细推物理须行乐,何用浮名绊此身

博文

CGAL::min_rectangle_2()的使用

已有 5262 次阅读 2012-4-25 17:39 |系统分类:科研笔记|关键词:学者

输入(散乱点):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://m.sciencenet.cn/blog-562235-563526.html

上一篇:Boost Graph Library 快速入门
下一篇:C/C++结构体的前向声明

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-17 10:03

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部