Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: "??????" <>
  • To: "cgal-discuss" <>
  • Subject: [cgal-discuss] Had any people get this precondition exception?
  • Date: Mon, 31 Dec 2012 00:33:56 +0800

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


  • [cgal-discuss] Had any people get this precondition exception?, ??????, 12/30/2012

Archive powered by MHonArc 2.6.18.

Top of Page