diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 910ba280e2f..c2c622a181e 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -539,12 +539,6 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const if ((f->incident_volume() == tf->incident_volume()) && Done[tf]) { continue; // for example when we have to do with the unbounded volume and a surface with boundaries } - Volume_const_iterator unbounded = volumes_begin(); - Volume_const_iterator fit = f->incident_volume(); - Volume_const_iterator tfit = tf->incident_volume(); - if ((fit == unbounded) && (tfit != unbounded)) { - continue; // because we will later report it from the bounded side - } FacetCandidates.push_back(f); Done[f] = true; } } else if (fc.is_svertex() ) { diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index f2a880c8872..bb11c0daace 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -359,14 +359,28 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, CGAL_assertion ( vol_it != vol_end ); Converter to_output; + bool handling_unbounded_volume = true; + + auto shell_is_closed = [](typename Nef_polyhedron::SFace_const_handle sfh) + { + typename Nef_polyhedron::Halffacet_handle f = sfh; + return f->incident_volume()!=f->twin()->incident_volume(); + }; + for (;vol_it!=vol_end;++vol_it) + { for(auto sit = vol_it->shells_begin(); sit != vol_it->shells_end(); ++sit) + { + if ( (handling_unbounded_volume || sit!=vol_it->shells_begin()) && shell_is_closed(sit)) continue; nef_to_pm::collect_polygon_mesh_info(points, polygons, nef, sit, to_output, triangulate_all_faces); + } + handling_unbounded_volume = false; + } } template