Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Assertion_exception in Triangulation_2.h

Subject: CGAL users discussion list

List archive

[cgal-discuss] Assertion_exception in Triangulation_2.h


Chronological Thread 
  • From: gsoyez <>
  • To:
  • Subject: [cgal-discuss] Assertion_exception in Triangulation_2.h
  • Date: Tue, 6 Sep 2011 01:53:45 -0700 (PDT)

Hello,

I am using CGAL to build 2D triangulations and I recently met the following
assertion violation with CGAL 3.8 when trying to remove a point:
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: false
File: .../include/CGAL/Triangulation_2.h
Line: 3345
Aborted

The code below does reproduce the issue. It has been tested with the
following setups:
- CGAL 3.8, gcc4.6, kernel 2.6.40, FC15, x86_64
- CGAL 3.8, gcc4.6, kernel 2.6.39, Debian sid, amd64
- CGAL 3.8, gcc4.6, kernel 2.6.38, FC15_i686
- CGAL 3.8, gcc4.1.2, kernel 2.6.18, SLC5_x86_64
- CGAL 3.7, gcc4.6, kernel 2.6.40, FC15_x86_64
- CGAL 3.9-beta1, gcc4.6, kernel 2.6.40, FC15_x86_64
But the code wirks fine with CGAL-3.6.1.

As far as I can tell the problem arises in situations with near degeneracy.
Is this behaviour the desired one?

Thanks in advance for the help,
Gregory

Code to reproduce the issue:
#include <iostream>
#include <vector>
#include &lt;CGAL/Exact_predicates_inexact_constructions_kernel.h&gt;
#include &lt;CGAL/Delaunay_triangulation_2.h&gt;
#include &lt;CGAL/Triangulation_hierarchy_2.h&gt;
#include &lt;CGAL/Triangulation_vertex_base_with_info_2.h&gt;

using namespace std;

struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};

const int NEW_VERTEX=-2;

/// \struct InitialisedInt
/// A class to provide an "int" with an initial value.
class InitialisedInt {
private:
int _val;
public:
inline InitialisedInt () {_val=NEW_VERTEX;};
inline InitialisedInt& operator= (int value) {_val = value; return
*this;};
inline int val() const {return _val;};
};

typedef CGAL::Triangulation_vertex_base_with_info_2&lt;InitialisedInt,K&gt;
Vbb;
typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
typedef CGAL::Triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2&lt;Vb,Fb&gt; Tds;
typedef CGAL::Delaunay_triangulation_2&lt;K,Tds&gt; Dt;
typedef CGAL::Triangulation_hierarchy_2<Dt> Triangulation;

typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Point Point; /// CGAL Point structure
typedef Triangulation::Vertex_circulator Vertex_circulator;
typedef Triangulation::Face_circulator Face_circulator;
typedef Triangulation::Face_handle Face_handle;

int main(){
Triangulation TR; // CGAL object for dealing with triangulations

// set the original VD
vector<Vertex_handle> vhs;
Vertex_handle to_remove;
cout << "inserting initial points" << endl;
vhs.push_back(TR.insert(Point(0.8348322547154467532237731575150974094868,
1.254124245528541514715925586642697453499 )));
vhs.push_back(TR.insert(Point(0.593123061879602953005985455092741176486 ,
0.5298490048003240415752657099801581352949)));
vhs.push_back(TR.insert(Point(0.5995001222161800980003931726969312876463,
5.597722151272678914324387733358889818192 )));
vhs.push_back(TR.insert(Point(-7.102324567908447683350914303446188569069,
0.0501146784479798157452279383505810983479)));
vhs.push_back(TR.insert(Point(-7.102324567908427255247261200565844774246,
0.0501146784479798226841218422578094759956)));
vhs.push_back(TR.insert(Point(-7.102324567991757930940366350114345550537,
0.0501146784479798226841218422578094759956)));
vhs.push_back(TR.insert(Point(-7.102324567948808287098927394254133105278,
0.0501146784479798226841218422578094759956)));
vhs.push_back(TR.insert(Point(-7.102324567930555332395670120604336261749,
0.0501146784479798226841218422578094759956)));

vhs.push_back(TR.insert(Point(0.5995001222161800980003931726969312876463,-0.6854631559069073176715392037294805049896)));

cout << "removing the 4th point" << endl;
TR.remove(vhs[3]);

return 0;
}


--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Assertion-exception-in-Triangulation-2-h-tp3792907p3792907.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page