From 77f3df5934223dd66f66aa7c7c8fe70811beb778 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 25 Nov 2025 14:34:27 +0100 Subject: [PATCH] better debug messages --- ...forming_constrained_Delaunay_triangulation_3.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Constrained_triangulation_3/include/CGAL/Conforming_constrained_Delaunay_triangulation_3.h b/Constrained_triangulation_3/include/CGAL/Conforming_constrained_Delaunay_triangulation_3.h index 0203f8115a5..92b0f4b6f36 100644 --- a/Constrained_triangulation_3/include/CGAL/Conforming_constrained_Delaunay_triangulation_3.h +++ b/Constrained_triangulation_3/include/CGAL/Conforming_constrained_Delaunay_triangulation_3.h @@ -1827,6 +1827,9 @@ public: auto& border = borders.emplace_back(); border.reserve(std::size(vertex_handles)); const auto polygon_constraint_id = face_index.value_or(this->face_data.size() - 1); + if(this->debug().input_faces()) { + std::cerr << "insert_constrained_face: new polygon_constraint_id: " << polygon_constraint_id << '\n'; + } do { const auto va = *circ; ++circ; @@ -1845,6 +1848,10 @@ public: } while(circ != circ_end); if(this->debug().input_faces()) { + for(auto [c_id, is_reversed] : border) { + std::cerr << " - edge on constraint c_id #" << c_id.index() + << (is_reversed ? " (reversed)" : "") << '\n'; + } std::vector> single_polygon{std::vector(vertex_handles.begin(), vertex_handles.end())}; dump_face_polygons(single_polygon, polygon_constraint_id, "dump-input-face-" + std::to_string(polygon_constraint_id) + "_polygon_" + @@ -1855,9 +1862,6 @@ public: // Face_data already created above with emplace_back face_constraint_misses_subfaces.resize(face_data.size()); } - if(this->debug().input_faces()) { - std::cerr << "insert_constrained_face return the polygon_constraint_id: " << polygon_constraint_id << '\n'; - } return polygon_constraint_id; } @@ -2218,6 +2222,11 @@ private: } } } + } else { + std::cerr << "ERROR: edge between " + << tr().point(va) << " and " + << tr().point(vb) + << " is not a known constraint of the CDT_3.\n"; } auto vh_2d = it == end ? first_2d : insert_vertex_in_cdt_2(vb);