CGAL:错误的Delaunay结果?

时间:2009-06-22 18:05:26

标签: c++ cgal

我的Delaunay三角测量在1000个均匀随机点上的结果看起来并不正确(见图)。有些点似乎属于异常高数量的三角形......有什么想法吗?

alt text

细节: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(); 
} 

函数转换只需从CGAL Point转换为另一种点格式

编辑:按照选择的答案,我只是将三角测量改为delaunay_triangulation:

typedef CGAL::Delaunay_triangulation_2<K>         Triangulation;

它给了: alt text

1 个答案:

答案 0 :(得分:5)

您使用的是常规而非Delaunay三角测量吗?

您正在使用以下内容,对吧?

CGAL::Delaunay_triangulation_2<Traits,Tds>

http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Triangulation_2_ref/Class_Delaunay_triangulation_2.html#Cross_link_anchor_1152