Question

The result of my Delaunay triangulation on 1000 unifomally random points doens't look right at all (see image). Some points seem to belong an abnormally high number of triangles... Any idea?

alt text

Detail: CGAL 3.4, windows XP

This is the types I used:

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

The display is as follow:

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

The function convert simply convert from CGAL Point to another point format

EDIT: following the chosen answer, I just change triangulation to delaunay_triangulation:

typedef CGAL::Delaunay_triangulation_2<K>         Triangulation;

And it gave: alt text

Was it helpful?

Solution

Are you using a regular rather than a Delaunay triangulation?

You are using the following, right?

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top