Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL fails with insertion operation in 2D arrangements

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL fails with insertion operation in 2D arrangements


Chronological Thread 
  • From: Dinesh Shetty <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL fails with insertion operation in 2D arrangements
  • Date: Wed, 25 Apr 2018 15:49:30 +0000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:pno6SBFy8DdDR3jqdT4KXJ1GYnF86YWxBRYc798ds5kLTJ78oM2wAkXT6L1XgUPTWs2DsrQY07GQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDSwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KODE38G7VisJ+gqFVrg+/qRNj2IPbep2ZOeBkc6/BYd8XR2xMVdtRWSxbBYO8apMCAeQAPeZesYb9vFsOpgajCwmsGuzv1iNIh3/r1qA9zushEAfG0xI7H9IOqnjUrdT1NLwOXu2uw6nIyC/Mb/JS2Tvn9IfIdRUhrOiKULltf8TRzkwvGBnEjlWWsYHlJC+V2f4RvGiY6OpgS/ygi3QpqwF1pTiuyN0ghZXOhoIQzF3P6CZ3wJ4tKNGmVEJ2ZcSoHZhQui2AKYd6X8IvT3t1tCs4zrALv4OwcjIQx5Q93RHfbuSKc4iW7RLnU+acOTJ4i2hkeLK7nhqy6FSgxvHlWsm6zVpHrC5InsPDtnAK0BzT5cyHReVn8ki93jaP0hjf6uBCIU8qiarWM4AtzqI0m5YJsknOHjX6lFvrgKKXbEko5+ql5uD/brXjvJCcNot0ig/kMqQpn8yyGfk3MgkIX2eF4uS81Kfv/Uz4QLVRkvI7iabZsJXAKsQaoq61GRNa0oEm6xqnFTepzMwYnWUbLFJCYB+Ik4fpNEvKIPzhEPi/gk+snyt2x/DdJb3sGY7NL3jGkLf5Z7lx8U9cyAwpzdBe/Z1YEL8BIOigEnP24dfXBxt8Pw2vyPv8E/180JkfUCSBGPy3KqTX5HOJ4O80I6G3ZIIJpCe1f/Qk4fP1jTk4mEQWVaas1JoTLnu/G6I1cA2ifXPwj4JZQi8xtQ0kQbmy0QzQYXtof3+3GpkEyHQ+AYOiA53EQ9n00rOE1Sa/WJZRYzIfUwzeITLTb4yBHsw0RmeKOMY4y24LULGgT8kq0hT87FanmYoiFfLd/2gjjbym1NVx4LeNxxQ79DgxFtjFlm/UEDAykWQPSDs7mqt4pB4lxw==

Well my version with 4.4 works

On Wed, Apr 25, 2018 at 3:31 AM Efi Fogel <> wrote:
This could have never worked.
You are using inexact construction.
Change the first line to:

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 24 April 2018 at 22:07, Dinesh Shetty <> wrote:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT                                        Number_type;

typedef CGAL::Arr_segment_traits_2<Kernel>              Traits;
typedef Traits::Point_2                                 Point;
typedef Traits::X_monotone_curve_2                      Segment;

typedef CGAL::Arrangement_2<Traits>                     Arrangement;
typedef Arrangement::Vertex_handle                      Vertex_handle;
typedef Arrangement::Halfedge_handle                    Halfedge_handle;
typedef Arrangement::Face_handle                        Face_handle;
typedef Arrangement::Vertex_const_handle                Vertex_const_handle;
typedef Arrangement::Halfedge_const_handle              Halfedge_const_handle;


typedef CGAL::Arr_consolidated_curve_data_traits_2<Traits, int>
Data_traits;
typedef Data_traits::Curve_2                               Numbered_segment;
typedef CGAL::Arrangement_2<Data_traits>                   Numbered_arr;

Numbered_arr   arr;


insert(arr, Numbered_segment(Segment(Point(1.6831200000000E+02,-1.3992000000000E+01), Point( 1.2253100000000E+02, -2.0889000000000E+01)), 6));
insert(arr, Numbered_segment(Segment(Point(1.6490200000000E+02, 1.0314000000000E+01), Point( 1.0342400000000E+02, 4.2850000000000E+00)), 11));
insert(arr, Numbered_segment(Segment(Point(1.7217000000000E+02,-3.2611000000000E+01), Point( 9.9756000000000E+01, -4.3728000000000E+01)), 16));
insert(arr, Numbered_segment(Segment(Point(1.4197300000000E+02, 5.4490000000000E+00), Point( 1.4887000000000E+02, -4.0331000000000E+01)), 51));
std::stringstream ss;
Numbered_arr::Vertex_const_iterator   vit;
for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) 
{
std::map<int, int> Frequency;
Numbered_arr::Halfedge_around_vertex_const_circulator eit, first;
eit = first = vit->incident_halfedges();
do 
{

++Frequency[eit->curve().data().front()];

} while (++eit != first);

ss << "@ ( " << vit->point() << ")" <<std::endl;
for(auto & itr : Frequency)
{
ss<<itr.first<<" apprears "<<itr.second<<"\n";
}

}


Numbered_arr::Edge_const_iterator eit;
std::vector<int> Pid;
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) 
{
Data_traits::Data_container::const_iterator  it;

if(eit->curve().data().size()> 1)
{
Pid.clear();
Pid.reserve(eit->curve().data().size());
for (it = eit->curve().data().begin(); it != eit->curve().data().end(); ++it)
{
Pid.push_back(*it);
}
ss<<"Overlap detected : ";
for(auto & itr : Pid)
ss<<itr<<" ";
ss<<"\n";
}
}



ss << arr.number_of_edges() << " edges:" << std::endl;
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit)
ss << "[" << eit->curve() << "]" << std::endl;

On Tue, Apr 24, 2018 at 12:33 PM, Efi Fogel <> wrote:
Please provide a test case that reproduces the problem.

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/



On 24 April 2018 at 17:32, Dinesh Shetty <> wrote:
When I switched to CGAL 4.12-beta2 from CGAL-4.4, I get following exception thrown
Exception: CGAL ERROR: precondition violation!
Expr: (m_traits.compare_y_at_x_2_object()(p, cv) == EQUAL) && compare_xy(cv.left(), p) == SMALLER && compare_xy(cv.right(), p) == LARGER
File: D:\PE\PE_Software\3rdParty\CGAL\CGAL-4.12-beta2\include\CGAL/Arr_segment_traits_2.h
Line: 714

Any help appreciated..

On stackExchange






Archive powered by MHonArc 2.6.18.

Top of Page