From 50793c99dd2b91c37518e0b07d09e3af6b44df56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 28 Jul 2025 09:20:31 +0200 Subject: [PATCH 1/4] make sure system is also found --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index eb4e9c5b57d..a97808d611f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -54,7 +54,7 @@ else() endif() find_package(Boost QUIET OPTIONAL_COMPONENTS filesystem system) -if(Boost_FILESYSTEM_FOUND) +if(Boost_FILESYSTEM_FOUND AND Boost_SYSTEM_FOUND ) qt5_wrap_ui( imgUI_FILES Image_res_dialog.ui raw_image.ui) polyhedron_demo_plugin(io_image_plugin Io_image_plugin Volume_plane_intersection.cpp @@ -66,7 +66,7 @@ if(Boost_FILESYSTEM_FOUND) if(VTK_LIBRARIES) target_compile_definitions(io_image_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) endif() - if(TARGET Boost::filesystem) + if(TARGET Boost::filesystem AND TARGET Boost::system) target_link_libraries(io_image_plugin PUBLIC Boost::filesystem Boost::system) else() From 7a08a00c7aea417f03c97dd4aa4192e3fc481ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 2 Sep 2025 10:54:45 +0200 Subject: [PATCH 2/4] tolerance for FT without sqrt --- Apollonius_graph_2/include/CGAL/Parabola_segment_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h index 7c03ff5d5e5..cb74c18204d 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h @@ -63,7 +63,7 @@ public: } int compute_k(const FT tt, const FT STEP) const { - return int(CGAL::to_double(CGAL::sqrt(tt / STEP))); + return int(CGAL::to_double(CGAL::approximate_sqrt(tt / STEP))); } // s0 and s1 define a desired drawing "range" From 37f90189970e9803ddafab00fbf14875bd8fcbba Mon Sep 17 00:00:00 2001 From: lvalque Date: Thu, 21 Aug 2025 19:01:39 +0200 Subject: [PATCH 3/4] Initialized the lower bound face in traversal of the AABB-tree to solve issue-7164 --- .../CGAL/Polygon_mesh_processing/distance.h | 3 +- .../Polygon_mesh_processing/CMakeLists.txt | 1 + .../Polygon_mesh_processing/issue_7164.cpp | 41 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index 4237fa85b6f..35fea731812 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -1687,8 +1687,9 @@ bounded_error_squared_Hausdorff_distance_impl(const TriangleMesh1& tm1, // Thus, subdivision can only decrease the min, and the upper bound. Local_bounds bounds(triangle_bounds.upper); - // Ensure 'uface' is initialized in case the upper bound is not changed by the subdivision + // Ensure 'lface' and 'uface' are initialized in case the bounds are not changed by the subdivision bounds.tm2_uface = triangle_bounds.tm2_uface; + bounds.tm2_lface = triangle_bounds.tm2_lface; TM2_hd_traits traversal_traits_tm2(sub_t1_bbox, tm2, vpm2, bounds, global_bounds, infinity_value); tm2_tree.traversal_with_priority(sub_triangles[i], traversal_traits_tm2); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 78fbd76a744..2303b918ceb 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -67,6 +67,7 @@ create_single_source_cgal_program("test_pmp_np_function.cpp") create_single_source_cgal_program("test_degenerate_pmp_clip_split_corefine.cpp") create_single_source_cgal_program("test_corefinement_cavities.cpp") create_single_source_cgal_program("issue_8730.cpp") +create_single_source_cgal_program("issue_7164.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp new file mode 100644 index 00000000000..2203ce61d8c --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_3 = Kernel::Point_3; +using Mesh = CGAL::Surface_mesh; +namespace PMP = CGAL::Polygon_mesh_processing; + +int main(/*int argc, char** argv*/) +{ + // A simple triangle + std::vector pts_A; + std::vector> trs_A; + pts_A.emplace_back( 0.26641936088212415, 0.2664193608821242, 0.73358063911787585); + pts_A.emplace_back(-0.14011519816541251, 0.6017979969632727, 1.1810107045967466); + pts_A.emplace_back(-0.14011519816541279,-0.1810107045967464, 0.39820200303672726); + trs_A.emplace_back(std::vector{0,1,2}); + Mesh A; + PMP::polygon_soup_to_polygon_mesh(pts_A, trs_A, A); + + // An open tetrahedron + std::vector pts_B; + std::vector> trs_B; + pts_B.emplace_back(0,0,0); + pts_B.emplace_back(1,1,0); + pts_B.emplace_back(1,0,1); + pts_B.emplace_back(0,1,1); + trs_B.emplace_back(std::vector{0,1,2}); + trs_B.emplace_back(std::vector{3,1,0}); + trs_B.emplace_back(std::vector{3,2,1}); + Mesh B; + PMP::polygon_soup_to_polygon_mesh(pts_B, trs_B, B); + + double bound = 0.01 * 0.42149467833714593; + PMP::bounded_error_Hausdorff_distance(A, B, bound); + PMP::bounded_error_Hausdorff_distance(B, A, bound); + + return EXIT_SUCCESS; +} From 24f70c8b3dc638ed9cc5a34d723f435239a5d74c Mon Sep 17 00:00:00 2001 From: lvalque Date: Fri, 22 Aug 2025 16:33:02 +0200 Subject: [PATCH 4/4] add an example of issue_7164 with a closed model --- .../Polygon_mesh_processing/issue_7164.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp index 2203ce61d8c..de4e16a74e6 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_7164.cpp @@ -37,5 +37,25 @@ int main(/*int argc, char** argv*/) PMP::bounded_error_Hausdorff_distance(A, B, bound); PMP::bounded_error_Hausdorff_distance(B, A, bound); + // The bug was possible with closed models + std::vector pts_C; + std::vector> trs_C; + pts_C.emplace_back(0,0,0); + pts_C.emplace_back(1,1,0); + pts_C.emplace_back(1,0,1); + pts_C.emplace_back(0,1,1); + pts_C.emplace_back(0.75,0.75,0); + trs_C.emplace_back(std::vector{0,1,2}); + trs_C.emplace_back(std::vector{3,1,0}); + trs_C.emplace_back(std::vector{3,2,1}); + trs_C.emplace_back(std::vector{0,2,4}); + trs_C.emplace_back(std::vector{3,0,4}); + trs_C.emplace_back(std::vector{3,4,2}); + Mesh C; + PMP::polygon_soup_to_polygon_mesh(pts_C, trs_C, C); + + PMP::bounded_error_Hausdorff_distance(A, C, bound); + PMP::bounded_error_Hausdorff_distance(C, A, bound); + return EXIT_SUCCESS; }