Subject: CGAL users discussion list
List archive
- 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 <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_hierarchy_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
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<InitialisedInt,K>
Vbb;
typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
typedef CGAL::Triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
typedef CGAL::Delaunay_triangulation_2<K,Tds> 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.
- [cgal-discuss] Assertion_exception in Triangulation_2.h, gsoyez, 09/06/2011
- Re: [cgal-discuss] Assertion_exception in Triangulation_2.h, Olivier Devillers, 09/06/2011
- Re: [cgal-discuss] Assertion_exception in Triangulation_2.h, Olivier Devillers, 09/06/2011
- [cgal-discuss] Re: Assertion_exception in Triangulation_2.h, gsoyez, 09/06/2011
- Re: [cgal-discuss] Re: Assertion_exception in Triangulation_2.h, Olivier Devillers, 09/06/2011
- [cgal-discuss] Re: Assertion_exception in Triangulation_2.h, gsoyez, 09/06/2011
Archive powered by MHonArc 2.6.16.