Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Had any people get this precondition exception?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Had any people get this precondition exception?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Had any people get this precondition exception?
  • Date: Wed, 02 Jan 2013 09:35:42 +0100
  • Organization: GeometryFactory

Try using CGAL::Exact_predicates_exact_constructions_kernel as Kernel.

Sebastien.

On 12/30/2012 05:33 PM, ?????? wrote:
Hello, every one.
When I intserted 4 segments which form a rectange into a empty
arrangment_2, I got this exeption :
Precondition_exception
library: CGAL
expression: comp_f(object, parentP->object) != SMALLER
filename: f:\mydev\cgal-4.1\include\cgal\multiset.h
line_number: 2128
The under codes were rough wirted without compiling, but the positions
of the segments are extracted in my really code.

#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arrangement_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Point_3<Kernel> Point_3;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::X_monotone_curve_2 Segment_2;
typedef std::list<Segment_2> Segment_2_List;
typedef Traits_2::Point_2 SPoint_2;
typedef CGAL::Arrangement_2<Traits_2> SArrangement_2;
void main()
{
SArrangement_2 rArr;
Segment_2_List rSegList;
rSegList.push_back(Segment_2(SPoint_2(512921.36092875537
,512921.36092875537), SPoint_2(507017.01928130072, 41693.804962627386)));
rSegList.push_back(Segment_2(SPoint_2(507017.01928130072
,41693.804962627386), SPoint_2(508643.36489923624, 43320.150579188790)));
rSegList.push_back(Segment_2(SPoint_2(508643.36489923624
,43320.150579188790), SPoint_2(514547.70652221481, 37415.808925923731)));
rSegList.push_back(Segment_2(SPoint_2(514547.70652221481
,37415.808925923731), SPoint_2(512921.36092875537, 35789.463329528837)));

try
{
CGAL::insert(rArr, rSegList.begin(), rSegList.end());
}
catch (CGAL::Failure_exception e)
{
std::out<<"CGAL exception:\n library: "<<e.library()
<<"\n expression:"<<e.expression()
<<"\n filename:"<<e.filename()
<<"\n line_number:"<<e.line_number()
<<"\n message:"<<e.message();
}
}
Who can tell me the reason?
Is this a bug of arrangment_2 library?
best regards.
---------------------------------------
Linker Li



  • Re: [cgal-discuss] Had any people get this precondition exception?, Sebastien Loriot (GeometryFactory), 01/02/2013

Archive powered by MHonArc 2.6.18.

Top of Page