Subject: CGAL users discussion list
List archive
- From: Ben Supnik <>
- To:
- Subject: Re: [cgal-discuss] insert_curve problem
- Date: Sun, 25 Oct 2009 15:45:34 -0400
You can't use arrangement_2 with an inexact constructions kernel, which is what cartesian double is. Version of CGAL doesn't matter, an extact constructions kernel is a requirement for the arrangement 2 package in all the versions I know of!
Ben Strasser wrote:
Hello,
the following program crashes for me:
#include <CGAL/Cartesian.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_segment_traits_2.h>
typedef CGAL::Cartesian<double> Kernel;
typedef CGAL::Point_2<Kernel> Point;
typedef CGAL::Segment_2<Kernel> Segment;
typedef CGAL::Ray_2<Kernel> Ray;
typedef CGAL::Vector_2<Kernel> Vector;
typedef CGAL::Arrangement_2<CGAL::Arr_segment_traits_2<Kernel> >
Arrangement;
int main(){
Arrangement arr;
CGAL::insert_curve(arr, Segment(Point(1.11414, 0.292881), Point(4.13119, 1.29114)));
CGAL::insert_curve(arr, Segment(Point(1.11414, 0.292881), Point(4.29535, 0.61658)));
CGAL::insert_curve(arr, Segment(Point(1.11414, 0.292881), Point(4.16702, 0.269299)));
CGAL::insert_curve(arr, Segment(Point(1.11414, 0.292881), Point(1.48276, -0.458071)));
}
The output is
CGAL error: precondition violation!
Expr: _locate_around_vertex (_vertex(prev->target()), cv, MAX_END) == _halfedge(prev)
File: /usr/include/CGAL/Arrangement_2/Arrangement_2_functions.h
Line: 1047
Explanation:In the clockwise order of curves around the vertex, cv must succeed the curve of prev.
terminate called after throwing an instance of 'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: _locate_around_vertex (_vertex(prev->target()), cv, MAX_END) == _halfedge(prev)
File: /usr/include/CGAL/Arrangement_2/Arrangement_2_functions.h
Line: 1047
Explanation: In the clockwise order of curves around the vertex, cv must succeed the curve of prev.
Aborted
I compile with
g++ -O2 bug.cpp -lCGAL -o prog
my compiler version is
g++ (Ubuntu 4.3.2-1ubuntu12) 4.3.2
What am I doing wrong?
I am uncertain as to what my exact cgal version is as I installed it through the package system. The package version is
3.3.1-2ubuntu1 (interpid)
I know it's not the newest version, however I'd hate to install cgal from the sources just to find out, that the code above still doesn't work. Could anyone please check if the code above works with newer versions?
Thanks for your time,
Ben Strasser
--
Scenery Home Page: http://scenery.x-plane.com/
Scenery blog: http://xplanescenery.blogspot.com/
Plugin SDK: http://www.xsquawkbox.net/xpsdk/
X-Plane Wiki: http://wiki.x-plane.com/
Scenery mailing list:
Developer mailing list:
- [cgal-discuss] insert_curve problem, Ben Strasser, 10/25/2009
- Re: [cgal-discuss] insert_curve problem, Ben Supnik, 10/25/2009
- Re: [cgal-discuss] insert_curve problem, Ben Strasser, 10/25/2009
- Re: [cgal-discuss] insert_curve problem, Eric Berberich, 10/26/2009
- Re: [cgal-discuss] insert_curve problem, Andreas Fabri, 10/26/2009
- Re: [cgal-discuss] insert_curve problem, Eric Berberich, 10/26/2009
- Re: [cgal-discuss] insert_curve problem, Ben Strasser, 10/25/2009
- Re: [cgal-discuss] insert_curve problem, Ben Supnik, 10/25/2009
Archive powered by MHonArc 2.6.16.