Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] insert_curve problem

Subject: CGAL users discussion list

List archive

[cgal-discuss] insert_curve problem


Chronological Thread 
  • From: Ben Strasser <>
  • To:
  • Subject: [cgal-discuss] insert_curve problem
  • Date: Sun, 25 Oct 2009 21:33:14 +0100

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



Archive powered by MHonArc 2.6.16.

Top of Page