Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Asher Kamiraze <>
  • To:
  • Subject: [cgal-discuss] Problem with CGAL::insert in Arrangement_2
  • Date: Fri, 7 Oct 2011 21:47:38 +0200

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




Archive powered by MHonArc 2.6.16.

Top of Page