Polygon Boolean Operation - !outer_ccbs_to_remove.empty()

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

Polygon Boolean Operation - !outer_ccbs_to_remove.empty()

Bryant
Hello all!
I've run into an issue while performing boolean difference (using the EPEC
Kernel) in CGAL-4.13.1. The assertion failure is:

terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
Expr: !outer_ccbs_to_remove.empty()
File:
[PATH_TO_CGAL]/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h
Line: 1254
Aborted (core dumped)

Disabling assertions, this issue results in a Segmentation fault.

My MWE is as follows:
    Polygon_2<K> ob;
    ob.push_back(Point_2<K>(1, 1));
    ob.push_back(Point_2<K>(1, 0));
    ob.push_back(Point_2<K>(6, 0));
    ob.push_back(Point_2<K>(6, 7));
    ob.push_back(Point_2<K>(0, 7));
    ob.push_back(Point_2<K>(0, 1));

    Polygon_2<K> h;
    h.push_back(Point_2<K>(2, 1));
    h.push_back(Point_2<K>(2, 1.25));
    h.push_back(Point_2<K>(2, 1.75));
    h.push_back(Point_2<K>(2, 2));
    h.push_back(Point_2<K>(3, 2));
    h.push_back(Point_2<K>(3, 3));
    h.push_back(Point_2<K>(2, 3));
    h.push_back(Point_2<K>(2, 3.25));
    h.push_back(Point_2<K>(2, 3.75));
    h.push_back(Point_2<K>(2, 4));
    h.push_back(Point_2<K>(3, 4));
    h.push_back(Point_2<K>(3, 5));
    h.push_back(Point_2<K>(3.25, 5));
    h.push_back(Point_2<K>(3.75, 5));
    h.push_back(Point_2<K>(4, 5));
    h.push_back(Point_2<K>(4, 1));

    Polygon_with_holes_2<K> ob_with_holes(ob);
    ob_with_holes.add_hole(h);
    Polygon_set_2 inter(ob_with_holes);

    Polygon_2<K> new_poly;
    new_poly.push_back(Point_2<K>(1, 1));
    new_poly.push_back(Point_2<K>(2, 1));
    new_poly.push_back(Point_2<K>(2, 1.25));
    new_poly.push_back(Point_2<K>(2, 1.75));
    new_poly.push_back(Point_2<K>(2, 2));
    new_poly.push_back(Point_2<K>(2, 3));
    new_poly.push_back(Point_2<K>(2, 3.25));
    new_poly.push_back(Point_2<K>(2, 3.75));
    new_poly.push_back(Point_2<K>(2, 4));
    new_poly.push_back(Point_2<K>(2, 5));
    new_poly.push_back(Point_2<K>(3, 5));
    new_poly.push_back(Point_2<K>(3.25, 5));
    new_poly.push_back(Point_2<K>(3.75, 5));
    new_poly.push_back(Point_2<K>(4, 5));
    new_poly.push_back(Point_2<K>(5, 5));
    new_poly.push_back(Point_2<K>(5, 6));
    new_poly.push_back(Point_2<K>(1, 6));

    inter.difference(new_poly);

Here's a crummy visualization of the MWE:
<http://cgal-discuss.949826.n4.nabble.com/file/t376080/Screen_Shot_2019-05-03_at_2.png>

I would really appreciate it if someone could give some insight as to what
is wrong/what I'm going wrong, or could give some insight into this
assertion failure.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss