set epsilons to 0 by default

This commit is contained in:
Laurent Rineau 2025-10-28 17:31:18 +01:00
parent fd21dfb67d
commit 6706e0468e
3 changed files with 60 additions and 11 deletions

View File

@ -381,7 +381,7 @@ protected:
template <typename Visitor>
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<Constraint_hierarchy>);
Bbox_3 bbox{};
double segment_vertex_epsilon = 1e-8;
mutable std::optional<double> max_bbox_edge_length;
using Pair_of_vertex_handles = std::pair<Vertex_handle, Vertex_handle>;
boost::container::map<Pair_of_vertex_handles, Constrained_polyline_id> pair_of_vertices_to_cid;

View File

@ -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()

View File

@ -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 {};