From 24f70c8b3dc638ed9cc5a34d723f435239a5d74c Mon Sep 17 00:00:00 2001 From: lvalque Date: Fri, 22 Aug 2025 16:33:02 +0200 Subject: [PATCH] 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; }