我对 1000 个均匀随机点的 Delaunay 三角剖分结果看起来根本不正确(见图)。有些点似乎属于异常多的三角形......有什么想法吗?
详细信息:CGAL 3.4,Windows XP
这是我使用的类型:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_2<K> Triangulation;
typedef Triangulation::Point Point;
显示如下:
delaunay_c::Triangulation::Edge_iterator eit = T.edges_begin();
delaunay_c::Triangulation::Edge_iterator end = T.edges_end();
for(;eit != end; ++eit)
{
delaunay_c::Triangulation::Segment s = T.segment(eit);
line.m_a = delaunay_c::convert(s.source());
line.m_b = delaunay_c::convert(s.target());
line.draw();
}
convert 函数简单地将 CGAL 点转换为另一种点格式
编辑:根据选择的答案,我只是将三角剖分更改为 delaunay_triangulation:
typedef CGAL::Delaunay_triangulation_2<K> Triangulation;
它给出了:
最佳答案
您使用的是常规三角剖分而不是 Delaunay 三角剖分吗?
您正在使用以下内容,对吗?
CGAL::Delaunay_triangulation_2<Traits,Tds>
关于c++ - CGAL:错误的 Delaunay 结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1028636/