Precondition violation in Delaunay_triangulation_3

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Precondition violation in Delaunay_triangulation_3

Brown, James 2

I am getting an assert on insert_in_hole when inserting a point after removal in Delaunay_triangulation_3:

 

CGAL error: precondition violation!

Expression: c->tds_data().is_in_conflict()

File: triangulation_data_structure_3.h

Line: 1478

 

The operation is as follows:

 

   Delaunay_triangulation_3<Kernel, Data> triangulation;

   Vertex_handle old_vertex = some_vertex();

   Point_3 new_point = some_point();

 

   triangulation.remove(old_vertex);

 

   int li = 0;

   int lj = 0;

   Delaunay_triangulation_3::Locate_type locate_type;

   Cell_handle cell = triangulation.locate(new_point, locate_type, li, lj);

 

   if (Tr::VERTEX == locate_type) return;

 

   Facet boundary;

   Cell_set conflicts;

   triangulation.find_conflicts(

      new_point,

      cell,

      CGAL::Oneset_iterator<Facet>(boundary),

      std::inserter(conflicts, conflicts.begin()));

 

   Vertex_handle new_vertex = triangulation.insert_in_hole(

      new_point,

      conflicts.begin(), conflicts.end(),

      boundary.first, boundary.second);

 

Not quite sure what I am doing wrong, any help is appreciated.

Reply | Threaded
Open this post in threaded view
|

Re: Precondition violation in Delaunay_triangulation_3

teillaud
Administrator
Hi,

If I am not mistaken, your code sample does not contain the definition of Cell_set. It is not defined by CGAL, is it?
Also, it is not clear to me how “conflicts" is constructed by your inserter.

Note that there is an example http://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation_3FindingtheCellsinConflict that seems to do what you need. 

Best,
--
Monique Teillaud 
https://members.loria.fr/Monique.Teillaud/
INRIA Nancy - Grand Est, LORIA 
Institut National de Recherche en Informatique et Automatique 

On 29 Sep 2016, at 22:04, Brown, James 2 <[hidden email]> wrote:

I am getting an assert on insert_in_hole when inserting a point after removal in Delaunay_triangulation_3:
 
CGAL error: precondition violation!
Expression: c->tds_data().is_in_conflict()
File: triangulation_data_structure_3.h
Line: 1478
 
The operation is as follows:
 
   Delaunay_triangulation_3<Kernel, Data> triangulation;
   Vertex_handle old_vertex = some_vertex();
   Point_3 new_point = some_point();
 
   triangulation.remove(old_vertex);
 
   int li = 0;
   int lj = 0;
   Delaunay_triangulation_3::Locate_type locate_type;
   Cell_handle cell = triangulation.locate(new_point, locate_type, li, lj);
 
   if (Tr::VERTEX == locate_type) return;
 
   Facet boundary;
   Cell_set conflicts;
   triangulation.find_conflicts(
      new_point,
      cell,
      CGAL::Oneset_iterator<Facet>(boundary),
      std::inserter(conflicts, conflicts.begin()));
 
   Vertex_handle new_vertex = triangulation.insert_in_hole(
      new_point,
      conflicts.begin(), conflicts.end(),
      boundary.first, boundary.second);
 
Not quite sure what I am doing wrong, any help is appreciated.