Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Problems with using the Delaunay 3 data structure + some robustness question

Subject: CGAL users discussion list

List archive

[cgal-discuss] Problems with using the Delaunay 3 data structure + some robustness question


Chronological Thread 
  • From: Josip Dzolonga <>
  • To:
  • Subject: [cgal-discuss] Problems with using the Delaunay 3 data structure + some robustness question
  • Date: Thu, 12 Nov 2009 00:59:33 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RWHWrHh3ZrflwTDHsv86nbdR+TfEXfoldOehioXX5T/50Rvt5hgygqNhpLdhawCu0C szTizSD994osQuxr85c9y5S59mnegSolLaiCVn9Fs7cPQz7CPjd8BsFssvoDiAPnJcvC OEKZWLc5Yf2WumqSX0vTsWorCEP99m0eHRf2o=

Hello everyone,

After I perform some operations on the Delaunay data structure, I want to remove certain vertices from it and then continue with the processing. To avoid removing the same vertex more than once, I compare the points, i.e. 

std::set<Vertex_handle> toRemove;
std::set<Point> seen;
for(std::list<Facet>::iterator iter = grown->facets->begin();
        iter != grown->facets->end(); ++iter) {

       Cell_handle c = (*iter).first;
   int index = (*iter).second;
   Point p1 = c->vertex((index+1)%4)->point();
   Point p2 = c->vertex((index+2)%4)->point();
            Point p3 = c->vertex((index+3)%4)->point();

   // Do not remove points already removed from a neighboring cell
   if(seen.insert(p1).second) {
   toRemove.insert(c->vertex((index+1)%4));
   }
   if(seen.insert(p2).second) {
   toRemove.insert(c->vertex((index+2)%4));
   }
   if(seen.insert(p3).second) {
   toRemove.insert(c->vertex((index+3)%4));
   }

}

T.remove(toRemove.begin(), toRemove.end());


However, I get the same error as before (but is_valid() returns true :/):

CGAL error: assertion violation!
Expr: v == V[3]
File: /usr/include/CGAL/Triangulation_ds_cell_base_3.h
Line: 98
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid

Then, I wanted to reconstruct the whole triangulation from scratch after every cycle of the algorithm (not practical, but in desperate times need desperate measures), and then this part causes trouble

if(T.is_infinite(*iter)) { continue; } Triangle triangle = T.triangle(*iter); if(triangle.is_degenerate() || TrigPerimeter(triangle) < 0.1) { continue; } Point circumcenter = CGAL::circumcenter(triangle);

The call to the circumcenter functions fails, and I suppose that this is because I'm using an inexact_constructions kernel. Is there any trick around this, i.e. some condition/heuristic that will skip these triangles? Changing the kernel itself is of course a possibility, however it will introduce a lot of changes in the whole project (because it is assumed in most of the code that some CGAL functions return something castable to double).

Thank you very much,
Josip



Archive powered by MHonArc 2.6.16.

Top of Page