Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Problem with CGAL::insert in Arrangement_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Problem with CGAL::insert in Arrangement_2


Chronological Thread 
  • From: Asher Kamiraze <>
  • To: Ben Supnik <>
  • Cc:
  • Subject: Re: [cgal-discuss] Problem with CGAL::insert in Arrangement_2
  • Date: Fri, 7 Oct 2011 22:12:36 +0200

Le 7 octobre 2011 21:53, Ben Supnik <> a écrit :
What kernel are you templated against?

Oups, sorry, I forgive this part ... 
In the first version, I used a Cartesian<double> kernel. I then switched to an Exact_predicates_exact_constructions_kernel

I also forgive to mention that the crash appears in 

/// Arr_walk_along_line_pl_impl.h
template <class Arrangement>
bool Arr_walk_along_line_point_location<Arrangement>::
_is_in_connected_component (const Point_2& p,
                            Ccb_halfedge_const_circulator circ,
                            bool shoot_up,
                            bool inclusive,
                            Halfedge_const_handle& closest_he,
                            bool& is_on_edge,
                            bool& closest_to_target) const

line 525:

if (! is_vertical (first->curve()))

Regards,

Asher



On 10/7/11 3:47 PM, Asher Kamiraze wrote:
Hi all,

I am facing a problem with a piece which used to work but which now crashes.
Here is the method a segmentation fault:

void  myobject::build_arr(const  string&  path,  double  tolerance)

{

    /// Here, we read the polygons from a file -->  m_rectangles


    vector<Polygon_2>::const_iterator  itb  =  m_rectangles.begin(),  ite  =  m_rectangles.end();

    for(;itb!=ite;++itb)

    {

        Polygon_2::Edge_const_iterator  e  =  itb->edges_begin(),  ite_edges  =  itb->edges_end();

        for(;e!=ite_edges;++e)

        {

            Vector_2  v  =  e->to_vector();

            double  d  =  sqrt(CGAL::to_double(v.squared_length()));

            v  =  (tolerance  /  d)  *  v  ;

            std::cout  <<  v  <<  std::endl;

            std::cout  <<  Segment_2(e->source()-v,  e->target()+v)  <<  std::endl;

            CGAL::insert(m_arr,  Segment_2(e->source()-v,  e->target()+v)); /// Whatever the dataset is, the second call to CGAL::insert causes a segmentation fault

        }

    }

}


Here is the output on the console with one of my dataset:

45.5953 20.5199

387.269 239.624 506.547 293.304

-20.5199 45.5953

481.472 227.189 407.029 392.6


There is no duplicate point. I am on a linux ubuntu 11.04, g++ 4.5.2 and
CGAL 3.7 (I compiled it myself).
The same code used to work on the same machine, with an ubuntu 10.04
(cannot remember g++ version ...), and CGAL 3.7 also compiled by myself.

Do you have any idea on what the problem is?

Regards,

Asher


--
Scenery Home Page: http://scenery.x-plane.com/
Scenery blog: http://www.x-plane.com/blog/
Plugin SDK: http://www.xsquawkbox.net/xpsdk/
X-Plane Wiki: http://wiki.x-plane.com/
Scenery mailing list:
Developer mailing list:




Archive powered by MHonArc 2.6.16.

Top of Page