From a994933ccbc957496522775a94aac3a83b19839f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Jun 2022 11:44:09 +0100 Subject: [PATCH 1/8] Nef_3: Fix conversion to a FaceGraph --- .../include/CGAL/Nef_3/SNC_const_decorator.h | 10 +++++ .../convert_nef_polyhedron_to_polygon_mesh.h | 20 +++++---- Nef_3/test/Nef_3/issue_6423.cpp | 44 +++++++++++++++++++ 3 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 Nef_3/test/Nef_3/issue_6423.cpp 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 a8b0123f3df..910ba280e2f 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -535,6 +535,16 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const } Halffacet_handle f = ec->twin()->facet(); if ( Done[f] ) continue; + Halffacet_handle tf = f->twin(); + 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 a5e5e619120..f2a880c8872 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 @@ -351,18 +351,22 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typedef Cartesian_converter Converter; typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), vol_end = nef.volumes_end(); - if ( Nef_polyhedron::Infi_box::extended_kernel() ) ++vol_it; // skip Infi_box + + if (Nef_polyhedron::Infi_box::extended_kernel()) { + ++vol_it; // skip Infi_box + } + CGAL_assertion ( vol_it != vol_end ); - ++vol_it; // skip unbounded volume Converter to_output; for (;vol_it!=vol_end;++vol_it) - nef_to_pm::collect_polygon_mesh_info(points, - polygons, - nef, - vol_it->shells_begin(), - to_output, - triangulate_all_faces); + for(auto sit = vol_it->shells_begin(); sit != vol_it->shells_end(); ++sit) + nef_to_pm::collect_polygon_mesh_info(points, + polygons, + nef, + sit, + to_output, + triangulate_all_faces); } template diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp new file mode 100644 index 00000000000..0ffad5bf0e1 --- /dev/null +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh SurfaceMesh; +typedef CGAL::Nef_polyhedron_3 NefPolyhedron; + + +int main(int argc, char* argv[]) +{ + SurfaceMesh surfaceMesh; + SurfaceMesh::Vertex_index v0 = surfaceMesh.add_vertex(Point_3(-1, 0, 0)); + SurfaceMesh::Vertex_index v1 = surfaceMesh.add_vertex(Point_3(1, 0, 0)); + SurfaceMesh::Vertex_index v2 = surfaceMesh.add_vertex(Point_3(0, 1, 0)); + + SurfaceMesh::Vertex_index v3 = surfaceMesh.add_vertex(Point_3(-1, 0, 1)); + SurfaceMesh::Vertex_index v4 = surfaceMesh.add_vertex(Point_3(1, 0, 1)); + SurfaceMesh::Vertex_index v5 = surfaceMesh.add_vertex(Point_3(0, 1, 1)); + + surfaceMesh.add_face(v0, v1, v2); + surfaceMesh.add_face(v3, v4, v5); + + make_tetrahedron(Point_3(-1, 0, 10), + Point_3(1, 0, 10), + Point_3(0, 1, 10), + Point_3(-1, 0, 11), + surfaceMesh); + + std::cout << "Before conversion, number_of_faces: " << surfaceMesh.number_of_faces() << std::endl; + + NefPolyhedron nefPoly(surfaceMesh); + std::cout << "NefPolyhedron, number_of_faces: " << nefPoly.number_of_facets() << std::endl; + std::cout << nefPoly << std::endl; + SurfaceMesh convertedSurfaceMesh; + CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); + std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; + std::cout << convertedSurfaceMesh << std::endl; + return EXIT_SUCCESS; +} From 07b04366a0e01015f0ccf2f9f49a43d4a7331dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Jul 2022 17:09:55 +0200 Subject: [PATCH 2/8] WIP --- Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h | 6 ------ .../graph/convert_nef_polyhedron_to_polygon_mesh.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) 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 From 69c4af61a9a3aae06c00e79cada527659439f81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 09:21:10 +0200 Subject: [PATCH 3/8] fix types, still not valid --- .../CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 bb11c0daace..98fb89d7192 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 @@ -361,9 +361,9 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, Converter to_output; bool handling_unbounded_volume = true; - auto shell_is_closed = [](typename Nef_polyhedron::SFace_const_handle sfh) + auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_handle f = sfh; + typename Nef_polyhedron::Halffacet_const_handle f = sfh; return f->incident_volume()!=f->twin()->incident_volume(); }; From 744a9643722d2d8a17685b41b0bf6b29f1ca8e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 09:36:39 +0200 Subject: [PATCH 4/8] fix compilation errors --- .../boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 8 ++++++-- Nef_3/test/Nef_3/issue_6423.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) 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 98fb89d7192..c055798f877 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 @@ -363,8 +363,12 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_const_handle f = sfh; - return f->incident_volume()!=f->twin()->incident_volume(); + typename Nef_polyhedron::Halffacet_const_handle f; + + if (CGAL::assign(f,*sfh)) + return f->incident_volume()!=f->twin()->incident_volume(); + else + return false; }; for (;vol_it!=vol_end;++vol_it) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 0ffad5bf0e1..5eeb664f23b 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -11,7 +11,7 @@ typedef CGAL::Surface_mesh SurfaceMesh; typedef CGAL::Nef_polyhedron_3 NefPolyhedron; -int main(int argc, char* argv[]) +int main() { SurfaceMesh surfaceMesh; SurfaceMesh::Vertex_index v0 = surfaceMesh.add_vertex(Point_3(-1, 0, 0)); From 31868332680d0219bbe94500ea460f9bdbe1fef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Jul 2022 10:16:18 +0200 Subject: [PATCH 5/8] WIP working with simple soup example --- .../convert_nef_polyhedron_to_polygon_mesh.h | 80 +++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) 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 c055798f877..218e7210866 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 @@ -363,12 +363,82 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, auto shell_is_closed = [](typename Nef_polyhedron::Shell_entry_const_iterator sfh) { - typename Nef_polyhedron::Halffacet_const_handle f; + typename Nef_polyhedron::SFace_const_handle sf = sfh; - if (CGAL::assign(f,*sfh)) - return f->incident_volume()!=f->twin()->incident_volume(); - else - return false; + typename Nef_polyhedron::SFace_cycle_const_iterator fc; + for(fc = sf->sface_cycles_begin(); fc != sf->sface_cycles_end(); ++fc) + { + if (fc.is_shalfedge() ) { + typename Nef_polyhedron::SHalfedge_const_handle e(fc); + typename Nef_polyhedron::SHalfedge_around_sface_const_circulator ec(e),ee(e); + CGAL_For_all(ec,ee) + { + typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); + //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { + //~ V.visit(vv); // report edge + //~ Done[vv] = Done[vv->twin()] = true; + //~ } + typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); + return f->incident_volume()!=f->twin()->incident_volume(); + //~ if ( Done[f] ) continue; + //~ Halffacet_handle tf = f->twin(); + //~ } + //~ FacetCandidates.push_back(f); Done[f] = true; + } + } + +#if 0 + else if (fc.is_svertex() ) { + SVertex_handle v(fc); + if ( Done[v] ) continue; + V.visit(v); // report edge + V.visit(v->twin()); + Done[v] = Done[v->twin()] = true; + CGAL_assertion(SD.is_isolated(v)); + SFaceCandidates.push_back(v->twin()->incident_sface()); + Done[v->twin()->incident_sface()]=true; + // note that v is isolated, thus twin(v) is isolated too + // SM_const_decorator SD; + // SFace_const_handle fo; + // fo = v->twin()->incident_sface(); + /* + if(SD.is_isolated(v)) + fo = v->source()->sfaces_begin(); + else + fo = v->twin()->incident_sface(); + */ + } else if (fc.is_shalfloop() ) { + SHalfloop_handle l(fc); + V.visit(l); + Halffacet_handle f = l->twin()->facet(); + if ( Done[f] ) continue; + FacetCandidates.push_back(f); Done[f] = true; + } else CGAL_error_msg("Damn wrong handle."); +#endif + } + + return false; + + //~ typename Nef_polyhedron::SHalfedge_const_handle e(sf); + //~ typename Nef_polyhedron::SHalffacet_const_handle f = e->facet(); + //~ e->facet() + //~ SHalfedge_around_sface_circulator ec(e),ee(e); + //~ CGAL_For_all(ec,ee) { + //~ SVertex_handle vv = ec->twin()->source(); + //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { + //~ V.visit(vv); // report edge + //~ Done[vv] = Done[vv->twin()] = true; + //~ } + //~ Halffacet_handle f = ec->twin()->facet(); + //~ if ( Done[f] ) continue; + + //~ if (CGAL::assign(f,*sfh)) + //~ { + //~ std::cout << "COUCOU\n"; + //~ return f->incident_volume()!=f->twin()->incident_volume(); + //~ } + //~ else + //~ return false; }; for (;vol_it!=vol_end;++vol_it) From 403ec19f8a07f5e3a1a0e5f0477bbada3429574b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 18:18:26 +0200 Subject: [PATCH 6/8] clean up and move skip test to export header --- .../include/CGAL/Nef_3/SNC_const_decorator.h | 4 - .../convert_nef_polyhedron_to_polygon_mesh.h | 81 ++++--------------- Nef_3/test/Nef_3/issue_6423.cpp | 1 + 3 files changed, 18 insertions(+), 68 deletions(-) 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 c2c622a181e..a8b0123f3df 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -535,10 +535,6 @@ visit_shell_objects(typename Traits::SFace_handle f, Visitor& V) const } Halffacet_handle f = ec->twin()->facet(); if ( Done[f] ) continue; - Halffacet_handle tf = f->twin(); - 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 - } 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 218e7210866..8b03c755507 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 @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -81,6 +82,7 @@ struct Shell_polygons_visitor Vertex_index_map& vertex_indices; PolygonRange& polygons; bool triangulate_all_faces; + CGAL::Generic_handle_map Done; Shell_polygons_visitor(Vertex_index_map& vertex_indices, PolygonRange& polygons, @@ -88,6 +90,7 @@ struct Shell_polygons_visitor : vertex_indices( vertex_indices ) , polygons(polygons) , triangulate_all_faces(triangulate_all_faces) + , Done(false) {} std::size_t get_cycle_length( typename Nef_polyhedron::Halffacet_cycle_const_iterator hfc) const @@ -103,6 +106,14 @@ struct Shell_polygons_visitor void visit(typename Nef_polyhedron::Halffacet_const_handle opposite_facet) { + typename Nef_polyhedron::Halffacet_const_handle twin_facet = opposite_facet->twin(); + + // skip when we have to do with the unbounded volume and a surface with boundaries + if ((twin_facet->incident_volume() == opposite_facet->incident_volume()) && Done[twin_facet]) + return; + + Done[opposite_facet] = true; + bool is_marked=opposite_facet->incident_volume()->mark(); CGAL_assertion(Nef_polyhedron::Infi_box::is_standard(opposite_facet->plane())); @@ -352,11 +363,9 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), vol_end = nef.volumes_end(); - if (Nef_polyhedron::Infi_box::extended_kernel()) { - ++vol_it; // skip Infi_box - } + if (Nef_polyhedron::Infi_box::extended_kernel()) ++vol_it; // skip Infi_box - CGAL_assertion ( vol_it != vol_end ); + if ( vol_it == vol_end ) return; Converter to_output; bool handling_unbounded_volume = true; @@ -374,71 +383,15 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, CGAL_For_all(ec,ee) { typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); - //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { - //~ V.visit(vv); // report edge - //~ Done[vv] = Done[vv->twin()] = true; - //~ } + typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); - return f->incident_volume()!=f->twin()->incident_volume(); - //~ if ( Done[f] ) continue; - //~ Halffacet_handle tf = f->twin(); - //~ } - //~ FacetCandidates.push_back(f); Done[f] = true; + if (f->incident_volume()==f->twin()->incident_volume()) + return false; } } - -#if 0 - else if (fc.is_svertex() ) { - SVertex_handle v(fc); - if ( Done[v] ) continue; - V.visit(v); // report edge - V.visit(v->twin()); - Done[v] = Done[v->twin()] = true; - CGAL_assertion(SD.is_isolated(v)); - SFaceCandidates.push_back(v->twin()->incident_sface()); - Done[v->twin()->incident_sface()]=true; - // note that v is isolated, thus twin(v) is isolated too - // SM_const_decorator SD; - // SFace_const_handle fo; - // fo = v->twin()->incident_sface(); - /* - if(SD.is_isolated(v)) - fo = v->source()->sfaces_begin(); - else - fo = v->twin()->incident_sface(); - */ - } else if (fc.is_shalfloop() ) { - SHalfloop_handle l(fc); - V.visit(l); - Halffacet_handle f = l->twin()->facet(); - if ( Done[f] ) continue; - FacetCandidates.push_back(f); Done[f] = true; - } else CGAL_error_msg("Damn wrong handle."); -#endif } - return false; - - //~ typename Nef_polyhedron::SHalfedge_const_handle e(sf); - //~ typename Nef_polyhedron::SHalffacet_const_handle f = e->facet(); - //~ e->facet() - //~ SHalfedge_around_sface_circulator ec(e),ee(e); - //~ CGAL_For_all(ec,ee) { - //~ SVertex_handle vv = ec->twin()->source(); - //~ if ( !SD.is_isolated(vv) && !Done[vv] ) { - //~ V.visit(vv); // report edge - //~ Done[vv] = Done[vv->twin()] = true; - //~ } - //~ Halffacet_handle f = ec->twin()->facet(); - //~ if ( Done[f] ) continue; - - //~ if (CGAL::assign(f,*sfh)) - //~ { - //~ std::cout << "COUCOU\n"; - //~ return f->incident_volume()!=f->twin()->incident_volume(); - //~ } - //~ else - //~ return false; + return true; }; for (;vol_it!=vol_end;++vol_it) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 5eeb664f23b..87e7f7dff61 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -40,5 +40,6 @@ int main() CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; std::cout << convertedSurfaceMesh << std::endl; + std::ofstream("out.off") << convertedSurfaceMesh; return EXIT_SUCCESS; } From 30fc15064bc66a8f6bcf4222878139b201272d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 14 Aug 2024 18:22:04 +0200 Subject: [PATCH 7/8] add assertions --- Nef_3/test/Nef_3/issue_6423.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/test/Nef_3/issue_6423.cpp b/Nef_3/test/Nef_3/issue_6423.cpp index 87e7f7dff61..441dd0b7939 100644 --- a/Nef_3/test/Nef_3/issue_6423.cpp +++ b/Nef_3/test/Nef_3/issue_6423.cpp @@ -35,11 +35,11 @@ int main() NefPolyhedron nefPoly(surfaceMesh); std::cout << "NefPolyhedron, number_of_faces: " << nefPoly.number_of_facets() << std::endl; - std::cout << nefPoly << std::endl; SurfaceMesh convertedSurfaceMesh; CGAL::convert_nef_polyhedron_to_polygon_mesh(nefPoly, convertedSurfaceMesh, true); std::cout << "After conversion, number_of_faces: " << convertedSurfaceMesh.number_of_faces() << std::endl; - std::cout << convertedSurfaceMesh << std::endl; std::ofstream("out.off") << convertedSurfaceMesh; + assert(vertices(convertedSurfaceMesh).size()==10); + assert(faces(convertedSurfaceMesh).size()==6); return EXIT_SUCCESS; } From d20cef2f911a2e9773e6394708a14e5d3544222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Aug 2024 09:02:24 +0200 Subject: [PATCH 8/8] remove unused variable --- .../CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h | 2 -- 1 file changed, 2 deletions(-) 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 8b03c755507..3ecd0e1b805 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 @@ -382,8 +382,6 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, typename Nef_polyhedron::SHalfedge_around_sface_const_circulator ec(e),ee(e); CGAL_For_all(ec,ee) { - typename Nef_polyhedron::SVertex_const_handle vv = ec->twin()->source(); - typename Nef_polyhedron::Halffacet_const_handle f = ec->twin()->facet(); if (f->incident_volume()==f->twin()->incident_volume()) return false;