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

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

它给了:

有帮助吗?

解决方案

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

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

CGAL::Delaunay_triangulation_2<Traits,Tds>

http://www.cgal.org/手动/ 3.4 / DOC_HTML / cgal_manual / Triangulation_2_ref / Class_Delaunay_triangulation_2.html#Cross_link_anchor_1152

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top