modify_vertex function

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

modify_vertex function

Mateus Bellomo
Hello,

I'm trying to use the modify_vertex function from Arrangement_2 but I'm getting segmentation fault. When I run through gdb, I'm getting this:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
terminate called after throwing an instance of 'CGAL::Precondition_exception'
  what():  CGAL ERROR: precondition violation!
Expr: m_geom_traits->equal_2_object()(vh->point(), p)
File: /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h
Line: 1468
Explanation: The new point is different from the current one.

Program received signal SIGABRT, Aborted.
0x00007ffff6b74c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6b74c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6b78028 in __GI_abort () at abort.c:89
#2  0x00007ffff747f535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff747d6d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff747d703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff747d922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff79568c9 in CGAL::precondition_fail(char const*, char const*, int, char const*) () from /usr/local/lib/libCGAL.so.11
#7  0x00000000009b7ccd in CGAL::Arrangement_on_surface_2<CGAL::Arr_segment_traits_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > >, CGAL::Arr_bounded_planar_topology_traits_2<CGAL::Arr_segment_traits_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > >, CGAL::Arr_extended_dcel<CGAL::Arr_segment_traits_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > >, vertex, bool, face, CGAL::Arr_vertex_base<CGAL::Point_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > > >, CGAL::Arr_halfedge_base<CGAL::Arr_segment_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > > >, CGAL::Arr_face_base> > >::modify_vertex (this=0x7fffffffd6f0, vh=..., p=...)
    at /usr/local/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h:1467
#8  0x000000000099f7fb in change_vertex_position (arr=0x7fffffffd6f0, v=..., pf=..., neighbours=std::vector of length 4, capacity 4 = {...},
    gridVertices=std::vector of length 25, capacity 32 = {...}, gridFaces=std::vector of length 17, capacity 32 = {...}, debugfile=...)
    at /home/mateus/Copy/IC/QuadrilateralPartition/algoritmos/solveGrid/solveGrid.cpp:2157
#9  0x0000000000996e0e in solve (arr=0x7fffffffd6f0, ans=0x7fffffffd7e0, gridVertices=std::vector of length 25, capacity 32 = {...},
    gridFaces=std::vector of length 17, capacity 32 = {...}, minFaceWeight=0x7fffffffd2f8, maxFaceWeight=0x7fffffffd2f4, res=0x7fffffffd660,
    prefix="ecw", debugfile=...) at /home/mateus/Copy/IC/QuadrilateralPartition/algoritmos/solveGrid/solveGrid.cpp:912
#10 0x000000000099e519 in main (argc=2, argv=0x7fffffffde08)
    at /home/mateus/Copy/IC/QuadrilateralPartition/algoritmos/solveGrid/solveGrid.cpp:2067


I have made sure that the vertex satisfies the preconditions (v is not a vertex at infinity and p is geometrically equivalent to the point currently associated with v)

I'm using the method like this:

  arr->modify_vertex(v, pf);

where arr is a pointer to an Arrangement_2 (I'm using an extended dcel here with more information in the vertex, face and edges), v is Vertex handle and pf is CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float>>::Point_2

Thanks in advance!
Loading...