From 6706e0468e3d27398265ffb6d0e048d4612665f5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 28 Oct 2025 17:31:18 +0100 Subject: [PATCH] set epsilons to 0 by default --- .../Conforming_Delaunay_triangulation_3.h | 13 ++--- .../Thingi10k-CDT.cmake | 54 +++++++++++++++++++ .../cdt_3_from_off.cpp | 4 +- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/Constrained_triangulation_3/include/CGAL/Conforming_Delaunay_triangulation_3.h b/Constrained_triangulation_3/include/CGAL/Conforming_Delaunay_triangulation_3.h index 805726cfb4e..936273cb2fa 100644 --- a/Constrained_triangulation_3/include/CGAL/Conforming_Delaunay_triangulation_3.h +++ b/Constrained_triangulation_3/include/CGAL/Conforming_Delaunay_triangulation_3.h @@ -381,7 +381,7 @@ protected: template Constrained_polyline_id insert_constrained_edge_impl(Vertex_handle va, Vertex_handle vb, Visitor&) { if(va != vb) { - if(segment_vertex_epsilon != 0.) { + if(debug().segment_vertex_epsilon() != 0.) { auto [min_dist, min_vertex] = min_distance_and_vertex_between_constraint_and_encroaching_vertex(va, vb); check_segment_vertex_distance_or_throw(va, vb, min_vertex, CGAL::to_double(min_dist), Check_distance::NON_SQUARED_DISTANCE); @@ -514,10 +514,6 @@ protected: } public: - void set_segment_vertex_epsilon(double epsilon) { - segment_vertex_epsilon = epsilon; - } - CDT_3::Debug_options& debug() { return debug_options_; } const CDT_3::Debug_options& debug() const { return debug_options_; } @@ -603,9 +599,9 @@ public: update_max_bbox_edge_length(); } if((distance_type == Check_distance::NON_SQUARED_DISTANCE && - min_dist < segment_vertex_epsilon * *max_bbox_edge_length) || + min_dist < debug().segment_vertex_epsilon() * *max_bbox_edge_length) || (distance_type == Check_distance::SQUARED_DISTANCE && - min_dist < CGAL::square(segment_vertex_epsilon * *max_bbox_edge_length))) + min_dist < CGAL::square(debug().segment_vertex_epsilon() * *max_bbox_edge_length))) { std::stringstream ss; ss.precision(std::cerr.precision()); @@ -1065,7 +1061,7 @@ protected: return return_orig_result_point(lambda, orig_pb, orig_pa); } } else { - if(segment_vertex_epsilon > 0) { + if(debug().segment_vertex_epsilon() > 0) { if(!max_bbox_edge_length) { update_max_bbox_edge_length(); } @@ -1096,7 +1092,6 @@ protected: Constraint_hierarchy constraint_hierarchy = {comp}; static_assert(CGAL::cdt_3_msvc_2019_or_older() || CGAL::is_nothrow_movable_v); Bbox_3 bbox{}; - double segment_vertex_epsilon = 1e-8; mutable std::optional max_bbox_edge_length; using Pair_of_vertex_handles = std::pair; boost::container::map pair_of_vertices_to_cid; diff --git a/Constrained_triangulation_3/test/Constrained_triangulation_3/Thingi10k-CDT.cmake b/Constrained_triangulation_3/test/Constrained_triangulation_3/Thingi10k-CDT.cmake index f37a6708c88..5c83528f4df 100644 --- a/Constrained_triangulation_3/test/Constrained_triangulation_3/Thingi10k-CDT.cmake +++ b/Constrained_triangulation_3/test/Constrained_triangulation_3/Thingi10k-CDT.cmake @@ -118,6 +118,57 @@ set(thingi10k_FAILED_WITH_SEGFAULT_CTest_20251002 822697.stl ) +set(thingi10k_FAILED_CTest_20251002 +100606.stl +100644.stl +101955.stl +109130.stl +116873.stl +116876.stl +135777.stl +139737.stl +1439534.stl +145329.stl +145330.stl +1505036.stl +1514900.stl +196121.stl +196122.stl +196123.stl +196126.stl +196127.stl +199814.stl +199818.stl +200695.stl +215991.stl +230152.stl +230153.stl +239188.stl +276937.stl +285604.stl +285605.stl +288352.stl +288353.stl +288354.stl +288355.stl +39182.stl +39245.stl +472050.stl +55278.stl +61418.stl +622000.stl +669962.stl +67817.stl +702204.stl +723893.stl +822697.stl +904476.stl +91474.stl +95796.stl +95797.stl +97515.stl +) + set(thingi10k_FAILED_WITH_MERGE_FACETS_CTest_20251028 139765.stl 1452677.stl @@ -240,6 +291,9 @@ foreach(thingi_file_name ${thingi10k_max_10k_solid}) if(thingi_file_name IN_LIST thingi10k_FAILED_WITH_MERGE_FACETS_CTest_20240222_2201) list(APPEND LABELS "CTest_20240222_2201_failed_merge_facets") endif() + if(thingi_file_name IN_LIST thingi10k_FAILED_CTest_20251002) + list(APPEND LABELS "CTest_20251002_failed") + endif() if(thingi_file_name IN_LIST thingi10k_FAILED_WITH_SEGFAULT_CTest_20251002) list(APPEND LABELS "CTest_20251002_failed_segfault") endif() diff --git a/Constrained_triangulation_3/test/Constrained_triangulation_3/cdt_3_from_off.cpp b/Constrained_triangulation_3/test/Constrained_triangulation_3/cdt_3_from_off.cpp index 8b5b1679628..88124d7254e 100644 --- a/Constrained_triangulation_3/test/Constrained_triangulation_3/cdt_3_from_off.cpp +++ b/Constrained_triangulation_3/test/Constrained_triangulation_3/cdt_3_from_off.cpp @@ -136,8 +136,8 @@ struct CDT_options bool use_finite_edges_map = false; bool call_is_valid = true; double ratio = 0.1; - double vertex_vertex_epsilon = 1e-14; - double segment_vertex_epsilon = 1e-14; + double vertex_vertex_epsilon = 0.; // 1e-14; + double segment_vertex_epsilon = 0.; // 1e-14; double coplanar_polygon_max_angle = 5.1; double coplanar_polygon_max_distance = 1e-6; std::string failure_assertion_expression {};