2009-06-22 3 views
4

Le résultat de ma triangulation de Delaunay sur 1000 points uniformément aléatoires ne ressemble pas du tout (voir image). Certains points semblent appartenir à un nombre anormalement élevé de triangles ... Une idée?CGAL: résultat Delaunay erroné?

alt text

Détail: CGAL 3.4, Windows XP

Ce sont les types que j'ai utilisé:

typedef CGAL::Exact_predicates_inexact_constructions_kernel K; 
typedef CGAL::Triangulation_2<K>   Triangulation; 
typedef Triangulation::Point    Point; 

L'affichage est le suivant:

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

La fonction convert il suffit de convertir le point CGAL en un autre format de point

EDIT: après la réponse choisie, je viens de changer la triangulation pour delaunay_triangulation:

typedef CGAL::Delaunay_triangulation_2<K>   Triangulation; 

et lui a donné: alt text

Répondre