From 8e5c5b84f30115e31983034852bd44ea5b2496d4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 May 2024 09:52:23 +0100 Subject: [PATCH 001/145] SMS: Fix placement --- .../CMakeLists.txt | 1 + .../data/issue_8213.off | 16 +++++++ .../issue_8213.cpp | 44 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off create mode 100644 Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 9c1e010e5ef..dabc2c49c08 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -6,6 +6,7 @@ project(Surface_mesh_simplification_Tests) find_package(CGAL REQUIRED) +create_single_source_cgal_program("issue_8213.cpp") create_single_source_cgal_program("edge_collapse_topology.cpp") create_single_source_cgal_program("test_edge_collapse_bounded_distance.cpp") create_single_source_cgal_program("test_edge_collapse_Envelope.cpp") diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off new file mode 100644 index 00000000000..4669828bf08 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off @@ -0,0 +1,16 @@ +OFF +5 4 0 + + 0.60153250345565623 3.2925554343503594 -0.93390733763467004 + 0.50125687092531912 3.266008536541555 -0.80580753798383942 + 0.57499779785916183 3.2558452065056969 -0.97860403852322797 + 0.56586410588624558 3.2541065339825863 -0.99341202997519495 + 0.56756366821062887 3.2478315549358072 -0.99100621040927039 + + 3 0 1 2 + 3 1 3 2 + 3 1 0 3 + 3 0 4 3 + + + diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp new file mode 100644 index 00000000000..be6b26d0fb7 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace SMS = CGAL::Surface_mesh_simplification; + +typedef CGAL::Simple_cartesian Kernel; +typedef CGAL::Surface_mesh Surface_mesh; + +int main() { + + std::string filename("data/issue_8213.off"); + + Surface_mesh surface_mesh; + + std::ifstream in(filename); + in >> surface_mesh; + + const size_t target_number_of_faces = 3; + SMS::Face_count_stop_predicate stop(target_number_of_faces); + + std::cout << "Input mesh number of faces: " << surface_mesh.number_of_faces() << ", target number of faces: " << target_number_of_faces << std::endl; + + SMS::edge_collapse( + surface_mesh, + stop, + CGAL::parameters:: + filter(SMS::Bounded_normal_change_filter<>()) + .get_cost(SMS::LindstromTurk_cost()) + .get_placement(SMS::LindstromTurk_placement()) + ); + + std::cout.precision(17); + std::cout << surface_mesh << std::endl; + return EXIT_SUCCESS; +} From 99613eb99c3bd0da0884916b1aef5e6af34badc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 30 May 2024 14:45:40 +0200 Subject: [PATCH 002/145] Generalize an expression to make it easier to use other kernels --- .../Policies/Edge_collapse/internal/Lindstrom_Turk_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index d97688dde8b..21f4018c0e3 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -190,7 +190,7 @@ private : const FT ax=a.x(), ay=a.y(), az=a.z(); const FT bx=b.x(), by=b.y(), bz=b.z(); - auto minor = [](double ai, double bi, double aj, double bj) + auto minor = [](auto ai, auto bi, auto aj, auto bj) { // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude // since this function is used to compute the cross product of two vectors that are defined From b80c1d8f482a38db3e0a7ee0d40668c9e4552455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 30 May 2024 14:46:19 +0200 Subject: [PATCH 003/145] Comments & debug code --- .../internal/Lindstrom_Turk_core.h | 7 ++-- .../internal/Edge_collapse.h | 32 +++++++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 21f4018c0e3..44691800463 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -394,11 +394,12 @@ compute_placement() // A1 * v = b1 // A2 * v = b2 // - // Which in matrix form is : A * v = b + // Which in matrix form is: A * v = b // // (with 'A' a 3x3 matrix and 'b' a vector) // - // The member variable mConstrinas contains A and b. Indidivual constraints (Ai,bi) can be added to it. + // The member variables mConstraints_A and mConstraints_b contain A and b. + // Indidivual constraints (Ai,bi) can be added to it. // Once 3 such constraints have been added 'v' is directly solved a: // // v = b*inverse(A) @@ -421,7 +422,7 @@ compute_placement() // In that case there is simply no good vertex placement if(mConstraints_n == 3) { - // If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned. + // If the matrix is singular its inverse cannot be computed so an 'absent' value is returned. std::optional lOptional_Ai = inverse_matrix(mConstraints_A); if(lOptional_Ai) { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index 5c23e83e94f..5d43f1d73cf 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -296,6 +296,8 @@ private: void insert_in_PQ(const halfedge_descriptor h, Edge_data& data) { + CGAL_SMS_TRACE(5, "Insert " << edge_to_string(h) << " in PQ"); + CGAL_assertion(is_primary_edge(h)); CGAL_expensive_assertion(!data.is_in_PQ()); CGAL_expensive_assertion(!mPQ->contains(h)); @@ -594,12 +596,33 @@ loop() std::optional opt_h; +// #define CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING #ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING int i_rm = 0; #endif - while((opt_h = pop_from_PQ())) + for(;;) { +#ifdef CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE + if(5 <= CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE) + { + CGAL_SMS_TRACE_IMPL("== Current queue =="); + + auto mPQ_clone = *mPQ; + std::optional opt_th; + while(opt_th = mPQ_clone.extract_top()) + { + CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th)); + Cost_type tcost = get_data(*opt_th).cost(); + if(tcost) + CGAL_SMS_TRACE_IMPL("\t" + std::to_string(CGAL::to_double(*tcost))); + } + } +#endif + + if(!(opt_h = pop_from_PQ())) + break; + CGAL_SMS_TRACE(1, "Popped " << edge_to_string(*opt_h)); CGAL_assertion(!is_constrained(*opt_h)); @@ -639,7 +662,7 @@ loop() m_visitor.OnNonCollapsable(profile); - CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); + CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (filter)" ); } #ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING @@ -660,7 +683,7 @@ loop() m_visitor.OnNonCollapsable(profile); - CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); + CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (topology)" ); } } else @@ -823,7 +846,10 @@ is_collapse_topologically_valid(const Profile& profile) { /// ensure two constrained edges cannot get merged if(is_edge_adjacent_to_a_constrained_edge(profile, m_ecm)) + { + CGAL_SMS_TRACE(3," edge to collapse is adjacent to a constrained edge."); return false; + } if(profile.is_v0_v1_a_border()) { From 24e1c96f62310164706bcec06e8520ebaf1a7b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 30 May 2024 14:46:30 +0200 Subject: [PATCH 004/145] Fix trace function --- .../CGAL/Surface_mesh_simplification/internal/Common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h index 4ed45a02d1e..a44f13d7770 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Common.h @@ -115,8 +115,9 @@ inline std::string optional_to_string(const std::optional& o) { namespace internal { namespace { bool cgal_enable_sms_trace = true; } } #define CGAL_SMS_TRACE_IMPL(m) \ if(::internal::cgal_enable_sms_trace) { \ - std::ostringstream ss; ss << m; std::string s = ss.str(); \ - /*Surface_simplification_external_trace(s)*/ std::cerr << s << std::endl; \ + std::ostringstream ss; ss << m; \ + std::string s = ss.str(); \ + Surface_simplification_external_trace(s); \ } #define CGAL_SMS_DEBUG_CODE(code) code From c40da7044175e1d52053ce3f13c407078cce46b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 30 May 2024 14:46:49 +0200 Subject: [PATCH 005/145] Enhance example --- .../issue_8213.cpp | 83 +++++++++++++------ 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp index be6b26d0fb7..ca4da904544 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -1,44 +1,75 @@ #include +#include + #include + +#define CGAL_CHECK_EXPENSIVE + +#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5 +#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_LT_TRACE 4 + +void Surface_simplification_external_trace(const std::string& s) +{ + std::cout << s << std::endl; +} + #include #include #include #include #include +#include + #include #include #include namespace SMS = CGAL::Surface_mesh_simplification; +namespace PMP = CGAL::Polygon_mesh_processing; -typedef CGAL::Simple_cartesian Kernel; -typedef CGAL::Surface_mesh Surface_mesh; - -int main() { - - std::string filename("data/issue_8213.off"); - - Surface_mesh surface_mesh; - - std::ifstream in(filename); - in >> surface_mesh; - - const size_t target_number_of_faces = 3; - SMS::Face_count_stop_predicate stop(target_number_of_faces); - - std::cout << "Input mesh number of faces: " << surface_mesh.number_of_faces() << ", target number of faces: " << target_number_of_faces << std::endl; - - SMS::edge_collapse( - surface_mesh, - stop, - CGAL::parameters:: - filter(SMS::Bounded_normal_change_filter<>()) - .get_cost(SMS::LindstromTurk_cost()) - .get_placement(SMS::LindstromTurk_placement()) - ); +using Kernel = CGAL::Simple_cartesian; +// using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Surface_mesh = CGAL::Surface_mesh; +int main(int argc, char** argv) +{ std::cout.precision(17); - std::cout << surface_mesh << std::endl; + std::cerr.precision(17); + + const char* filename = (argc > 1) ? argv[1] : "data/issue_8213.off"; + + Surface_mesh sm; + + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Error: failed to read input data" << std::endl; + return EXIT_FAILURE; + } + + CGAL::Bbox_3 bbox = PMP::bbox(sm); + + std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl; + std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; + + SMS::Face_count_stop_predicate stop(1); + SMS::edge_collapse(sm, stop, + CGAL::parameters::filter(SMS::Bounded_normal_change_filter<>()) + .get_cost(SMS::LindstromTurk_cost()) + .get_placement(SMS::LindstromTurk_placement())); + + CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); + + for(auto v : vertices(sm)) + { + // To be within the bounding box isn't a guarantee, but here it is a sufficient test + // to check if things went awry + if(!CGAL::do_overlap(bbox, sm.point(v).bbox())) + { + std::cerr << "Error: " << sm.point(v) << " is outside the initial bbox" << std::endl; + return EXIT_FAILURE; + } + } + return EXIT_SUCCESS; } From 042cb277fb5514226bb48cf06f335723ef4134d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 30 May 2024 14:58:00 +0200 Subject: [PATCH 006/145] Use the more robust formulation on another eligible cross product --- .../Policies/Edge_collapse/internal/Lindstrom_Turk_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 44691800463..8c04b537e7f 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -362,7 +362,7 @@ extract_triangle_data() Vector v01 = p1 - p0; Vector v02 = p2 - p0; - Vector lNormalV = cross_product(v01,v02); + Vector lNormalV = X_product(v01,v02); FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN); CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2 From b54a2eab1a056451a3ae6545d2824163623822e1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 May 2024 14:59:22 +0100 Subject: [PATCH 007/145] Add a filter --- .../Edge_collapse/Bounding_box_filter.h | 77 +++++++++++++++++++ .../issue_8213.cpp | 15 ++-- 2 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h new file mode 100644 index 00000000000..c8b534f0ee1 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h @@ -0,0 +1,77 @@ +// Copyright (c) 2024 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H + +#include +#include +#include + +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + + +template +class Bounding_box_filter +{ +public: + Bounding_box_filter(const BaseFilter& base_filter = BaseFilter()) + : m_base_filter(base_filter) + {} + + + template + std::optional + operator()(const Profile& profile, std::optional op) const + { + typedef typename Profile::VertexPointMap Vertex_point_map; + + typedef typename Profile::Geom_traits Geom_traits; + typedef typename Geom_traits::Vector_3 Vector; + + typedef typename boost::property_traits::value_type Point; + typedef typename boost::property_traits::reference Point_reference; + + const Geom_traits& gt = profile.geom_traits(); + const Vertex_point_map& vpm = profile.vertex_point_map(); + + op = m_base_filter(profile, op); + if(op) + { + const Point& placement = *op; + Bbox_3 bb; + for(auto vd : profile.link()){ + Point_reference p = get(vpm, vd); + bb += p.bbox(); + } + double wx = bb.xmax() - bb.xmin(); + double wy = bb.ymax() - bb.ymin(); + double wz = bb.zmax() - bb.zmin(); + bb = Bbox_3(bb.xmin()- wx/10.0, bb.ymin() - wy/10.0, bb.zmin()- wz/10.0, bb.xmax() + wx/10.0, bb.ymax() + wy/10.0, bb.zmax()+ wz/10.0); + if(!do_overlap(bb, placement.bbox())){ + return std::optional(); + } + } + return op; + } + + + +private: + const BaseFilter m_base_filter; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp index ca4da904544..b086fe22e73 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -15,6 +15,7 @@ void Surface_simplification_external_trace(const std::string& s) #include #include +#include #include #include #include @@ -52,12 +53,16 @@ int main(int argc, char** argv) std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl; std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; - SMS::Face_count_stop_predicate stop(1); - SMS::edge_collapse(sm, stop, - CGAL::parameters::filter(SMS::Bounded_normal_change_filter<>()) - .get_cost(SMS::LindstromTurk_cost()) - .get_placement(SMS::LindstromTurk_placement())); + SMS::Face_count_stop_predicate stop(1); + SMS::edge_collapse( + surface_mesh, + stop, + CGAL::parameters:: + filter(SMS::Bounded_normal_change_filter>(SMS::Bounding_box_filter<>())) + .get_cost(SMS::LindstromTurk_cost()) + .get_placement(SMS::LindstromTurk_placement()) + ); CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); for(auto v : vertices(sm)) From 924bfdf2c3fed4949321a679d89e3e36435070d6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 9 Jan 2025 14:00:52 +0000 Subject: [PATCH 008/145] PMP: Slow compute_vertex_normal() --- .../Polygon_mesh_processing/CMakeLists.txt | 1 + .../data/slow_compute_normal.off | 1202 +++++++++++++++++ .../slow_compute_normal.cpp | 39 + 3 files changed, 1242 insertions(+) create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 44b52f55548..08c24f62177 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -7,6 +7,7 @@ project(Polygon_mesh_processing_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS Core) +create_single_source_cgal_program("slow_compute_normal.cpp") create_single_source_cgal_program("test_pmp_triangle.cpp") create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp") create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp") diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off new file mode 100644 index 00000000000..5c09e19ef8f --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data/slow_compute_normal.off @@ -0,0 +1,1202 @@ +OFF +600 598 0 + +-103.33809661865234 -9.7869815826416016 -40 +-103.33809661865234 -71.779998779296875 -40 +-103.33809661865234 -72.139999389648438 -40 +-103.33809661865234 -44.599998474121094 -40 +-103.33809661865234 11.718429565429688 -40 +-103.33809661865234 5.2999997138977051 -40 +-103.33809661865234 -24.547355651855469 -40 +-103.33809661865234 -46.799999237060547 -40 +-103.33809661865234 -72.400001525878906 -40 +-103.33809661865234 -24.420000076293945 -40 +-103.33809661865234 2.4800000190734863 -40 +-103.33809661865234 8.5199995040893555 -40 +-103.33809661865234 -24.119998931884766 -40 +-103.33809661865234 -72.760002136230469 -40 +-103.33809661865234 -50.746982574462891 -40 +-103.33809661865234 -29.214235305786133 -40 +-103.33809661865234 -63.799999237060547 -40 +-103.33809661865234 -73.05999755859375 -40 +-103.33809661865234 -23.613948822021484 -40 +-103.33809661865234 5.0399999618530273 -40 +-103.33809661865234 -73.419998168945312 -40 +-103.33809661865234 -23.5 -40 +-103.33809661865234 4.679999828338623 -40 +-103.33809661865234 -50.486980438232422 -40 +-103.33809661865234 -15.819999694824219 -40 +-103.33809661865234 -41.05999755859375 -40 +-103.33809661865234 -50.126979827880859 -40 +-103.33809661865234 -23.139999389648438 -40 +-103.33809661865234 -18.639999389648438 -40 +-103.33809661865234 -45.259998321533203 -40 +-103.33809661865234 -16.079999923706055 -40 +-103.33809661865234 -73.680000305175781 -40 +-103.33809661865234 -22.680595397949219 -40 +-103.33809661865234 -74.040000915527344 -40 +-103.33809661865234 -46.539997100830078 -40 +-103.33809661865234 -22.479999542236328 -40 +-103.33809661865234 -64.099998474121094 -40 +-103.33809661865234 4.380000114440918 -40 +-103.33809661865234 4.0199999809265137 -40 +-103.33809661865234 -49.826980590820312 -40 +-103.33809661865234 -22.219999313354492 -40 +-103.33809661865234 -47.159999847412109 -40 +-103.33809661865234 -16.739999771118164 -40 +-103.33809661865234 -49.46697998046875 -40 +-103.33809661865234 -27.959999084472656 -40 +-103.33809661865234 -49.206981658935547 -40 +-103.33809661865234 -21.747188568115234 -40 +-103.33809661865234 10.159999847412109 -40 +-103.33809661865234 -17.08030891418457 -40 +-103.33809661865234 -21.559999465942383 -40 +-103.33809661865234 -41.348213195800781 -40 +-103.33809661865234 -64.459999084472656 -40 +-103.33809661865234 1.1999999284744263 -40 +-103.33809661865234 -57.039997100830078 -40 +-103.33809661865234 -20.813833236694336 -40 +-103.33809661865234 -31.799999237060547 -40 +-103.33809661865234 -74.339996337890625 -40 +-103.33809661865234 12.059999465942383 -40 +-103.33809661865234 -74.699996948242188 -40 +-103.33809661865234 -36.681282043457031 -40 +-103.33809661865234 3.7599999904632568 -40 +103.33809661865234 88.099998474121094 -90 +-103.33809661865234 1.8199999332427979 -40 +-103.33809661865234 3.3999998569488525 -40 +-103.33809661865234 -42.040000915527344 -40 +-103.33809661865234 -12.899999618530273 -40 +-103.33809661865234 -47.459999084472656 -40 +-103.33809661865234 -48.846981048583984 -40 +-103.33809661865234 -51 -40 +-103.33809661865234 -20.579999923706055 -40 +-103.33809661865234 15.539999961853027 -40 +-103.33809661865234 -48.546981811523438 -40 +-103.33809661865234 -36.55999755859375 -40 +-103.33809661865234 -19.880426406860352 -40 +-103.33809661865234 -51.299999237060547 -40 +-103.33809661865234 -48.186981201171875 -40 +-103.33809661865234 -19.659999847412109 -40 +-103.33809661865234 -25.039999008178711 -40 +-103.33809661865234 -57.699996948242188 -40 +-103.33809661865234 -36.299999237060547 -40 +-103.33809661865234 -56.779998779296875 -40 +-103.33809661865234 -18.947071075439453 -40 +-103.33809661865234 -50.639999389648438 -40 +-103.33809661865234 -0.71999996900558472 -40 +-103.33809661865234 -28.260000228881836 -40 +-103.33809661865234 -74.959999084472656 -40 +-103.33809661865234 -47.926982879638672 -40 +-103.33809661865234 1.4599999189376831 -40 +-103.33809661865234 -47.566982269287109 -40 +-103.33809661865234 -47.819999694824219 -40 +-103.33809661865234 -47.266983032226562 -40 +-103.33809661865234 -12.413379669189453 -40 +-103.33809661865234 -75.319999694824219 -40 +-103.33809661865234 -1.3799999952316284 -40 +-103.33809661865234 12.719999313354492 -40 +-103.33809661865234 -30.819999694824219 -40 +-103.33809661865234 16.385309219360352 -40 +-103.33809661865234 8.880000114440918 -40 +-103.33809661865234 12.979999542236328 -40 +-103.33809661865234 -35.279998779296875 -40 +-103.33809661865234 -64.720001220703125 -40 +-103.33809661865234 -7.4800000190734863 -40 +-103.33809661865234 -1.7400000095367432 -40 +-103.33809661865234 -46.906982421875 -40 +-103.33809661865234 -46.646980285644531 -40 +-103.33809661865234 -75.6199951171875 -40 +-103.33809661865234 -75.979995727539062 -40 +-103.33809661865234 -46.286979675292969 -40 +-103.33809661865234 -45.986980438232422 -40 +-103.33809661865234 -48.079998016357422 -40 +-103.33809661865234 -45.626979827880859 -40 +-103.33809661865234 -45.366981506347656 -40 +-103.33809661865234 -46.180000305175781 -40 +-103.33809661865234 -65.080001831054688 -40 +-103.33809661865234 -45.006980895996094 -40 +-103.33809661865234 -12.239999771118164 -40 +-103.33809661865234 -2 -40 +-103.33809661865234 -75.066978454589844 -40 +-103.33809661865234 -74.806983947753906 -40 +-103.33809661865234 -44.706981658935547 -40 +-103.33809661865234 -44.346981048583984 -40 +-103.33809661865234 -7.7799997329711914 -40 +-103.33809661865234 -44.086982727050781 -40 +-103.33809661865234 -43.726982116699219 -40 +-103.33809661865234 -8.1399993896484375 -40 +-103.33809661865234 -2.3599998950958252 -40 +-103.33809661865234 -76.239997863769531 -40 +-103.33809661865234 -43.066982269287109 -40 +-103.33809661865234 -42.806980133056641 -40 +-103.33809661865234 -54.219997406005859 -40 +-103.33809661865234 -42.146980285644531 -40 +-103.33809661865234 -65.379997253417969 -40 +-103.33809661865234 -48.439998626708984 -40 +-103.33809661865234 -76.599998474121094 -40 +-103.33809661865234 -44.239997863769531 -40 +-103.33809661865234 -41.166980743408203 -40 +-103.33809661865234 -53.55999755859375 -40 +-103.33809661865234 -76.900001525878906 -40 +-103.33809661865234 -40.866981506347656 -40 +-103.33809661865234 -26.979999542236328 -40 +-103.33809661865234 -65.739997863769531 -40 +-103.33809661865234 -40.246982574462891 -40 +-103.33809661865234 -74.446983337402344 -40 +-103.33809661865234 -39.919857025146484 -40 +-103.33809661865234 -77.259994506835938 -40 +-103.33809661865234 -53.199996948242188 -40 +-103.33809661865234 2.119999885559082 -40 +-103.33809661865234 -39.226982116699219 -40 +-103.33809661865234 -77.519996643066406 -40 +-103.33809661865234 -77.879997253417969 -40 +-103.33809661865234 -38.9864501953125 -40 +-103.33809661865234 -18.013666152954102 -40 +-103.33809661865234 -38.306980133056641 -40 +-103.33809661865234 16.559999465942383 -40 +-103.33809661865234 -66 -40 +-103.33809661865234 -2.6599998474121094 -40 +-103.33809661865234 -38.053092956542969 -40 +-103.33809661865234 -74.146980285644531 -40 +-103.33809661865234 -37.326980590820312 -40 +103.33809661865234 -88.099998474121094 -40 +-103.33809661865234 -3.0199999809265137 -40 +-103.33809661865234 -78.180000305175781 -40 +-103.33809661865234 -37.11968994140625 -40 +-103.33809661865234 -78.540000915527344 -40 +-103.33809661865234 -36.666980743408203 -40 +-103.33809661865234 8.2200002670288086 -40 +-103.33809661865234 14.619999885559082 -40 +-103.33809661865234 -66.360000610351562 -40 +-103.33809661865234 -36.406982421875 -40 +-103.33809661865234 -36.186336517333984 -40 +-103.33809661865234 -8.3999996185302734 -40 +-103.33809661865234 -35.746982574462891 -40 +-103.33809661865234 -78.799995422363281 -40 +-103.33809661865234 -73.786979675292969 -40 +-103.33809661865234 -58.05999755859375 -40 +-103.33809661865234 -35.386981964111328 -40 +-103.33809661865234 -48.739997863769531 -40 +-103.33809661865234 -28.879999160766602 -40 +-103.33809661865234 -35.2529296875 -40 +-103.33809661865234 -79.159996032714844 -40 +-103.33809661865234 -3.2799999713897705 -40 +-103.33809661865234 -34.766983032226562 -40 +-103.33809661865234 -8.7600002288818359 -40 +-103.33809661865234 -73.5269775390625 -40 +-103.33809661865234 -3.6399998664855957 -40 +-103.33809661865234 -34.46697998046875 -40 +-103.33809661865234 -71.479995727539062 -40 +-103.33809661865234 -32.947761535644531 -40 +-103.33809661865234 -34.319572448730469 -40 +-103.33809661865234 -73.166984558105469 -40 +-103.33809661865234 -33.739997863769531 -40 +-103.33809661865234 -79.459999084472656 -40 +-103.33809661865234 -33.846981048583984 -40 +-103.33809661865234 -72.866981506347656 -40 +-103.33809661865234 -9.0599994659423828 -40 +-103.33809661865234 -33.486980438232422 -40 +-103.33809661865234 -79.819999694824219 -40 +-103.33809661865234 -33.88116455078125 -40 +-103.33809661865234 -17.719999313354492 -40 +-103.33809661865234 -32.826980590820312 -40 +-103.33809661865234 -3.9399998188018799 -40 +-103.33809661865234 -72.506980895996094 -40 +-103.33809661865234 -32.566982269287109 -40 +-103.33809661865234 -9.4200000762939453 -40 +-103.33809661865234 -4.2999997138977051 -40 +-103.33809661865234 -32.452808380126953 -40 +-103.33809661865234 -80.080001831054688 -40 +-103.33809661865234 -80.439994812011719 -40 +-103.33809661865234 -49.099998474121094 -40 +-103.33809661865234 -31.906982421875 -40 +-103.33809661865234 -72.246978759765625 -40 +-103.33809661865234 -6.8599996566772461 -40 +-103.33809661865234 -31.546981811523438 -40 +-103.33809661865234 -4.559999942779541 -40 +-103.33809661865234 -71.886978149414062 -40 +-103.33809661865234 -30.926980972290039 -40 +-103.33809661865234 -9.6799993515014648 -40 +-103.33809661865234 -30.626981735229492 -40 +-103.33809661865234 -4.9200000762939453 -40 +-103.33809661865234 -80.739997863769531 -40 +-103.33809661865234 -10.039999961853027 -40 +-103.33809661865234 -30.006980895996094 -40 +-103.33809661865234 -71.586982727050781 -40 +-103.33809661865234 -29.652643203735352 -40 +-103.33809661865234 -71.226982116699219 -40 +-103.33809661865234 -81.099998474121094 -40 +-103.33809661865234 -28.986982345581055 -40 +-103.33809661865234 -5.2199997901916504 -40 +-103.33809661865234 -28.726982116699219 -40 +-103.33809661865234 -81.360000610351562 -40 +-103.33809661865234 -81.720001220703125 -40 +-103.33809661865234 -5.5799999237060547 -40 +-103.33809661865234 -28.066982269287109 -40 +-103.33809661865234 -70.96697998046875 -40 +-103.33809661865234 13.639999389648438 -40 +-103.33809661865234 -27.785881042480469 -40 +-103.33809661865234 -49.360000610351562 -40 +-103.33809661865234 -10.340000152587891 -40 +-103.33809661865234 -38.5 -40 +-103.33809661865234 -27.086982727050781 -40 +-103.33809661865234 5.9600000381469727 -40 +-103.33809661865234 -5.8399996757507324 -40 +-103.33809661865234 -26.852523803710938 -40 +-103.33809661865234 -70.606979370117188 -40 +-103.33809661865234 -10.54661750793457 -40 +-103.33809661865234 -26.166982650756836 -40 +-103.33809661865234 -6.1999998092651367 -40 +-103.33809661865234 -32.719997406005859 -40 +-103.33809661865234 -70.306983947753906 -40 +-103.33809661865234 -82.019996643066406 -40 +-103.33809661865234 -26.059999465942383 -40 +-103.33809661865234 -56.419998168945312 -40 +-103.33809661865234 -71.1199951171875 -40 +-103.33809661865234 -69.946983337402344 -40 +-103.33809661865234 -69.686981201171875 -40 +-103.33809661865234 -43.979999542236328 -40 +-103.33809661865234 -38.200000762939453 -40 +-103.33809661865234 -34.360000610351562 -40 +-103.33809661865234 -82.379997253417969 -40 +-103.33809661865234 -69.326980590820312 -40 +-103.33809661865234 2.7400000095367432 -40 +-103.33809661865234 -69.0269775390625 -40 +-103.33809661865234 -32.459999084472656 -40 +-103.33809661865234 -0.079999998211860657 -40 +-103.33809661865234 6.3199996948242188 -40 +-103.33809661865234 -34.659999847412109 -40 +-103.33809661865234 -52.939998626708984 -40 +-103.33809661865234 3.0999999046325684 -40 +-103.33809661865234 -82.639999389648438 -40 +-103.33809661865234 -6.5 -40 +-103.33809661865234 -1.0799999237060547 -40 +-103.33809661865234 -56.119998931884766 -40 +-103.33809661865234 -68.666984558105469 -40 +-103.33809661865234 -68.406982421875 -40 +-103.33809661865234 9.8000001907348633 -40 +-103.33809661865234 -83 -40 +-103.33809661865234 7.5999999046325684 -40 +-103.33809661865234 -35.639999389648438 -40 +-103.33809661865234 -68.046981811523438 -40 +-103.33809661865234 -49.719997406005859 -40 +-103.33809661865234 -58.319999694824219 -40 +-103.33809661865234 -83.299995422363281 -40 +-103.33809661865234 -7.119999885559082 -40 +-103.33809661865234 -67.746978759765625 -40 +-103.33809661865234 -67.386978149414062 -40 +-103.33809661865234 -83.659996032714844 -40 +-103.33809661865234 -67.126983642578125 -40 +-103.33809661865234 -55.759998321533203 -40 +-103.33809661865234 -25.919118881225586 -40 +-103.33809661865234 -58.680000305175781 -40 +-103.33809661865234 -66.766983032226562 -40 +-103.33809661865234 -66.46697998046875 -40 +-103.33809661865234 -66.106979370117188 -40 +-103.33809661865234 -35.747928619384766 -40 +-103.33809661865234 -55.5 -40 +-103.33809661865234 -65.846977233886719 -40 +-103.33809661865234 -65.486984252929688 -40 +-103.33809661865234 -65.186981201171875 -40 +-103.33809661865234 -55.139999389648438 -40 +-103.33809661865234 -83.919998168945312 -40 +-103.33809661865234 14.920000076293945 -40 +-103.33809661865234 -64.826980590820312 -40 +-103.33809661865234 -64.566978454589844 -40 +-103.33809661865234 -64.206977844238281 -40 +-103.33809661865234 -58.979999542236328 -40 +-103.33809661865234 -54.840000152587891 -40 +-103.33809661865234 -63.906982421875 -40 +-103.33809661865234 -29.899999618530273 -40 +-103.33809661865234 -63.546981811523438 -40 +-103.33809661865234 5.6599998474121094 -40 +-103.33809661865234 7.2399997711181641 -40 +-103.33809661865234 -63.286979675292969 -40 +-103.33809661865234 -59.340000152587891 -40 +-103.33809661865234 -84.279998779296875 -40 +-103.33809661865234 -15.159999847412109 -40 +-103.33809661865234 -62.926982879638672 -40 +-103.33809661865234 -41.786979675292969 -40 +-103.33809661865234 6.940000057220459 -40 +-103.33809661865234 -25.146982192993164 -40 +-103.33809661865234 -62.626979827880859 -40 +-103.33809661865234 -30.14764404296875 -40 +-103.33809661865234 -34.814521789550781 -40 +-103.33809661865234 -52.579998016357422 -40 +-103.33809661865234 11.079999923706055 -40 +-103.33809661865234 -62.266979217529297 -40 +-103.33809661865234 -84.580001831054688 -40 +-103.33809661865234 -62.006980895996094 -40 +-103.33809661865234 -45.520000457763672 -40 +-103.33809661865234 -63.439998626708984 -40 +-103.33809661865234 -59.599998474121094 -40 +-103.33809661865234 -61.646980285644531 -40 +-103.33809661865234 -61.346981048583984 -40 +-103.33809661865234 -42.281570434570312 -40 +-103.33809661865234 -60.986980438232422 -40 +-103.33809661865234 -60.726982116699219 -40 +-103.33809661865234 -9.1669816970825195 -40 +-103.33809661865234 -24.985763549804688 -40 +-103.33809661865234 -84.939994812011719 -40 +-103.33809661865234 -60.366981506347656 -40 +-103.33809661865234 16.819999694824219 -40 +-103.33809661865234 -60.066982269287109 -40 +-103.33809661865234 -59.959999084472656 -40 +-103.33809661865234 -59.706981658935547 -40 +-103.33809661865234 15.899999618530273 -40 +-103.33809661865234 -14.799999237060547 -40 +-103.33809661865234 -59.446979522705078 -40 +-103.33809661865234 -59.086982727050781 -40 +-103.33809661865234 -24.526981353759766 -40 +-103.33809661865234 -58.786979675292969 -40 +-103.33809661865234 -9.5269813537597656 -40 +-103.33809661865234 -85.199996948242188 -40 +-103.33809661865234 -37.579998016357422 -40 +-103.33809661865234 -58.426982879638672 -40 +-103.33809661865234 -0.45999997854232788 -40 +-103.33809661865234 -58.166980743408203 -40 +-103.33809661865234 -57.806980133056641 -40 +-103.33809661865234 -24.226982116699219 -40 +-103.33809661865234 -85.55999755859375 -40 +-103.33809661865234 -57.506980895996094 -40 +-103.33809661865234 -70.860000610351562 -40 +-103.33809661865234 7.8599996566772461 -40 +-103.33809661865234 -57.399997711181641 -40 +-103.33809661865234 -86.586982727050781 -40 +-103.33809661865234 -82.746978759765625 -40 +-103.33809661865234 -78.646980285644531 -40 +-103.33809661865234 -78.906982421875 -40 +-103.33809661865234 -86.946983337402344 -40 +-103.33809661865234 -83.106979370117188 -40 +-103.33809661865234 -79.266983032226562 -40 +-103.33809661865234 -87.246978759765625 -40 +-103.33809661865234 -83.406982421875 -40 +-103.33809661865234 -75.426979064941406 -40 +-103.33809661865234 -79.566978454589844 -40 +-103.33809661865234 -83.766983032226562 -40 +-103.33809661865234 -75.726982116699219 -40 +-103.33809661865234 -79.926979064941406 -40 +-103.33809661865234 -84.0269775390625 -40 +-103.33809661865234 -76.086982727050781 -40 +-103.33809661865234 -80.186981201171875 -40 +-103.33809661865234 -84.386978149414062 -40 +-103.33809661865234 -76.346977233886719 -40 +-103.33809661865234 -84.686981201171875 -40 +-103.33809661865234 -76.706977844238281 -40 +-103.33809661865234 -80.546981811523438 -40 +-103.33809661865234 -85.046981811523438 -40 +-103.33809661865234 -77.006980895996094 -40 +-103.33809661865234 -80.846977233886719 -40 +-103.33809661865234 -86.839996337890625 -40 +-103.33809661865234 -85.306983947753906 -40 +-103.33809661865234 -77.366981506347656 -40 +-103.33809661865234 -81.206977844238281 -40 +-103.33809661865234 -81.46697998046875 -40 +-103.33809661865234 -85.666976928710938 -40 +-103.33809661865234 -77.626983642578125 -40 +-103.33809661865234 -81.826980590820312 -40 +-103.33809661865234 -85.96697998046875 -40 +-103.33809661865234 -77.986984252929688 -40 +-103.33809661865234 -82.126983642578125 -40 +-103.33809661865234 -86.326980590820312 -40 +-103.33809661865234 -78.286979675292969 -40 +-103.33809661865234 -82.486984252929688 -40 +-103.33809661865234 -87.606979370117188 -40 +-103.33809661865234 -87.866981506347656 -40 +-103.33809661865234 -60.259998321533203 -40 +-103.33809661865234 -24.05235481262207 -40 +-103.33809661865234 -23.60698127746582 -40 +-103.33809661865234 -23.246982574462891 -40 +-103.33809661865234 -60.619998931884766 -40 +-103.33809661865234 10.814975738525391 -40 +-103.33809661865234 -23.119001388549805 -40 +-103.33809661865234 -22.586982727050781 -40 +-103.33809661865234 -22.326982498168945 -40 +-103.33809661865234 -54.479999542236328 -40 +-103.33809661865234 -60.879997253417969 -40 +-103.33809661865234 -22.18559455871582 -40 +-103.33809661865234 -21.666982650756836 -40 +-103.33809661865234 -21.306982040405273 -40 +-103.33809661865234 -61.239997863769531 -40 +-103.33809661865234 -45.879997253417969 -40 +-103.33809661865234 -20.686981201171875 -40 +-103.33809661865234 -20.386981964111328 -40 +-103.33809661865234 -19.76698112487793 -40 +-103.33809661865234 -40.399997711181641 -40 +-103.33809661865234 -61.539997100830078 -40 +-103.33809661865234 -19.406982421875 -40 +-103.33809661865234 -18.746982574462891 -40 +-103.33809661865234 -18.486982345581055 -40 +-103.33809661865234 -61.899997711181641 -40 +-103.33809661865234 -32.014404296875 -40 +-103.33809661865234 -17.826982498168945 -40 +-103.33809661865234 -17.518714904785156 -40 +-103.33809661865234 -16.846982955932617 -40 +-103.33809661865234 6.5799999237060547 -40 +-103.33809661865234 -62.159999847412109 -40 +-103.33809661865234 -16.585309982299805 -40 +-103.33809661865234 -15.926981925964355 -40 +-103.33809661865234 -15.65195369720459 -40 +-103.33809661865234 -62.520000457763672 -40 +-103.33809661865234 -40.139999389648438 -40 +-103.33809661865234 -14.906982421875 -40 +-103.33809661865234 -14.718546867370605 -40 +-103.33809661865234 -13.986982345581055 -40 +-103.33809661865234 -27.340000152587891 -40 +-103.33809661865234 -62.819999694824219 -40 +-103.33809661865234 -13.785191535949707 -40 +-103.33809661865234 -13.00698184967041 -40 +-103.33809661865234 -12.851785659790039 -40 +-103.33809661865234 -63.180000305175781 -40 +-103.33809661865234 0.53999996185302734 -40 +-103.33809661865234 -57.146980285644531 -40 +-103.33809661865234 -11.319999694824219 -40 +-103.33809661865234 -12.346982002258301 -40 +-103.33809661865234 -56.886981964111328 -40 +-103.33809661865234 -11.480024337768555 -40 +-103.33809661865234 -25.399999618530273 -40 +-103.33809661865234 -50.020000457763672 -40 +-103.33809661865234 -12.086981773376465 -40 +-103.33809661865234 -56.526981353759766 -40 +-103.33809661865234 -56.226982116699219 -40 +-103.33809661865234 -11.918430328369141 -40 +-103.33809661865234 -55.866981506347656 -40 +-103.33809661865234 -11.979999542236328 -40 +-103.33809661865234 -50.379997253417969 -40 +-103.33809661865234 -31.080997467041016 -40 +-103.33809661865234 -11.426981925964355 -40 +-103.33809661865234 0.8399999737739563 -40 +-103.33809661865234 -55.606979370117188 -40 +-103.33809661865234 -66.659996032714844 -40 +-103.33809661865234 -52.279998779296875 -40 +-103.33809661865234 -55.246982574462891 -40 +-103.33809661865234 -85.860000610351562 -40 +-103.33809661865234 -67.019996643066406 -40 +-103.33809661865234 -44.899997711181641 -40 +-103.33809661865234 -37.219997406005859 -40 +-103.33809661865234 -14.179999351501465 -40 +-103.33809661865234 -26.319999694824219 -40 +-103.33809661865234 -67.279998779296875 -40 +-103.33809661865234 -86.220001220703125 -40 +-103.33809661865234 -11.066982269287109 -40 +-103.33809661865234 -43.185024261474609 -40 +-103.33809661865234 -67.639999389648438 -40 +-103.33809661865234 -39.479999542236328 -40 +-103.33809661865234 -54.946979522705078 -40 +-103.33809661865234 -54.586982727050781 -40 +-103.33809661865234 -86.479995727539062 -40 +-103.33809661865234 0.17999999225139618 -40 +-103.33809661865234 -67.939994812011719 -40 +-103.33809661865234 -51.919998168945312 -40 +-103.33809661865234 -54.326980590820312 -40 +-103.33809661865234 9.1399993896484375 -40 +-103.33809661865234 -68.299995422363281 -40 +-103.33809661865234 -53.860000610351562 -40 +-103.33809661865234 -13.880000114440918 -40 +-103.33809661865234 -53.96697998046875 -40 +-103.33809661865234 -10.446982383728027 -40 +-103.33809661865234 -53.666980743408203 -40 +-103.33809661865234 -68.55999755859375 -40 +-103.33809661865234 -53.306980133056641 -40 +-103.33809661865234 -53.046981811523438 -40 +-103.33809661865234 -87.139999389648438 -40 +-103.33809661865234 -68.919998168945312 -40 +-103.33809661865234 -52.686981201171875 -40 +-103.33809661865234 -52.386981964111328 -40 +-103.33809661865234 14 -40 +-103.33809661865234 -87.5 -40 +103.33809661865234 -88.099998474121094 -90 +-103.33809661865234 -69.220001220703125 -40 +-103.33809661865234 9.5 -40 +-103.33809661865234 -51.659999847412109 -40 +-103.33809661865234 -10.146981239318848 -40 +-103.33809661865234 -69.580001831054688 -40 +-103.33809661865234 -70.5 -40 +-103.33809661865234 -52.026981353759766 -40 +-103.33809661865234 -87.759994506835938 -40 +-103.33809661865234 -88.099998474121094 -40 +-103.33809661865234 -39.119998931884766 -40 +-103.33809661865234 -69.839996337890625 -40 +-103.33809661865234 -51.106983184814453 -40 +-103.33809661865234 -13.25999927520752 -40 +-103.33809661865234 -42.959999084472656 -40 +-103.33809661865234 -70.199996948242188 -40 +-103.33809661865234 -51.766983032226562 -40 +-103.33809661865234 -51.406982421875 -40 +-103.33809661865234 -88.099998474121094 -90 +-103.33809661865234 16.88031005859375 -40 +-103.33809661865234 16.713016510009766 -40 +-103.33809661865234 16.45301628112793 -40 +-103.33809661865234 15.946902275085449 -40 +-103.33809661865234 15.793017387390137 -40 +-103.33809661865234 15.013546943664551 -40 +-103.33809661865234 14.813016891479492 -40 +-103.33809661865234 14.080141067504883 -40 +-103.33809661865234 13.893016815185547 -40 +-103.33809661865234 13.146785736083984 -40 +-103.33809661865234 12.873017311096191 -40 +-103.33809661865234 12.213379859924316 -40 +-103.33809661865234 11.953017234802246 -40 +-103.33809661865234 11.280024528503418 -40 +-103.33809661865234 10.973017692565918 -40 +-103.33809661865234 10.313016891479492 -40 +-103.33809661865234 10.053017616271973 -40 +-103.33809661865234 9.6930179595947266 -40 +-103.33809661865234 9.3930177688598633 -40 +-103.33809661865234 9.0330181121826172 -40 +-103.33809661865234 8.7730178833007812 -40 +-103.33809661865234 8.4130182266235352 -40 +-103.33809661865234 8.1130180358886719 -40 +-103.33809661865234 7.7530179023742676 -40 +-103.33809661865234 7.4930181503295898 -40 +-103.33809661865234 7.1330180168151855 -40 +-103.33809661865234 6.8330178260803223 -40 +-103.33809661865234 6.4730181694030762 -40 +-103.33809661865234 6.2130179405212402 -40 +-103.33809661865234 5.8530182838439941 -40 +-103.33809661865234 5.5530180931091309 -40 +-103.33809661865234 5.1930179595947266 -40 +-103.33809661865234 4.9330177307128906 -40 +-103.33809661865234 4.5730175971984863 -40 +-103.33809661865234 4.2730178833007812 -40 +-103.33809661865234 3.913017749786377 -40 +-103.33809661865234 3.6530177593231201 -40 +-103.33809661865234 3.2930178642272949 -40 +-103.33809661865234 2.9930179119110107 -40 +-103.33809661865234 2.6330177783966064 -40 +-103.33809661865234 2.3730180263519287 -40 +-103.33809661865234 2.0130178928375244 -40 +-103.33809661865234 1.7130179405212402 -40 +-103.33809661865234 1.353018045425415 -40 +-103.33809661865234 1.0930179357528687 -40 +-103.33809661865234 0.73301792144775391 -40 +-103.33809661865234 0.43301793932914734 -40 +-103.33809661865234 0.073017969727516174 -40 +-103.33809661865234 -0.18698202073574066 -40 +-103.33809661865234 -0.56698203086853027 -40 +-103.33809661865234 -0.82698202133178711 -40 +-103.33809661865234 -1.1869820356369019 -40 +-103.33809661865234 -1.486981987953186 -40 +-103.33809661865234 -1.8469818830490112 -40 +-103.33809661865234 -2.1069819927215576 -40 +-103.33809661865234 -2.4669818878173828 -40 +-103.33809661865234 -2.7669820785522461 -40 +-103.33809661865234 -3.1269819736480713 -40 +-103.33809661865234 -3.3869819641113281 -40 +-103.33809661865234 -3.7469820976257324 -40 +-103.33809661865234 -4.0469818115234375 -40 +-103.33809661865234 -4.4069819450378418 -40 +-103.33809661865234 -4.6669821739196777 -40 +-103.33809661865234 -5.0269818305969238 -40 +-103.33809661865234 -5.3269815444946289 -40 +-103.33809661865234 -5.6869816780090332 -40 +-103.33809661865234 -5.9469819068908691 -40 +-103.33809661865234 -6.3069815635681152 -40 +-103.33809661865234 -6.6069817543029785 -40 +-103.33809661865234 -6.9669818878173828 -40 +-103.33809661865234 -7.2269816398620605 -40 +-103.33809661865234 -7.5869817733764648 -40 +-103.33809661865234 -7.8869814872741699 -40 +-103.33809661865234 -8.2469816207885742 -40 +-103.33809661865234 -8.5069818496704102 -40 +-103.33809661865234 -8.8669815063476562 -40 +3 523 598 170 +3 523 170 597 +3 523 597 124 +3 523 124 596 +3 523 596 121 +3 523 121 595 +3 523 18 405 +3 523 404 18 +3 523 595 101 +3 523 101 594 +3 523 12 404 +3 523 594 282 +3 523 282 593 +3 523 593 211 +3 523 356 12 +3 523 9 356 +3 523 211 592 +3 523 592 269 +3 523 347 9 +3 523 6 347 +3 523 269 591 +3 523 591 246 +3 523 336 6 +3 523 77 336 +3 523 115 456 +3 523 246 590 +3 523 318 77 +3 523 456 461 +3 523 590 241 +3 523 241 589 +3 523 461 459 +3 523 92 117 +3 523 589 231 +3 523 231 588 +3 523 454 318 +3 523 288 454 +3 523 588 227 +3 523 227 587 +3 523 250 288 +3 523 446 91 +3 523 587 218 +3 523 245 250 +3 523 459 453 +3 523 218 586 +3 523 453 464 +3 523 586 213 +3 523 475 245 +3 523 242 475 +3 523 213 585 +3 523 585 204 +3 523 139 242 +3 523 239 139 +3 523 204 584 +3 523 584 200 +3 523 442 239 +3 523 235 442 +3 523 200 583 +3 523 583 184 +3 523 44 235 +3 523 232 44 +3 523 184 582 +3 523 117 85 +3 523 84 232 +3 523 228 84 +3 523 582 180 +3 523 180 581 +3 523 177 228 +3 523 226 177 +3 523 581 160 +3 523 464 450 +3 523 15 226 +3 523 223 15 +3 523 160 580 +3 523 580 155 +3 523 307 223 +3 523 221 307 +3 523 155 579 +3 523 579 125 +3 523 320 221 +3 523 217 320 +3 523 125 578 +3 523 85 118 +3 523 95 217 +3 523 215 95 +3 523 450 478 +3 523 478 244 +3 523 463 215 +3 523 212 463 +3 523 118 58 +3 523 578 116 +3 523 55 212 +3 523 209 55 +3 523 116 577 +3 523 577 102 +3 523 102 576 +3 523 428 209 +3 523 576 93 +3 523 93 575 +3 523 205 428 +3 523 262 205 +3 523 58 142 +3 523 142 56 +3 523 202 262 +3 523 247 202 +3 523 575 270 +3 523 244 494 +3 523 199 247 +3 523 187 199 +3 523 270 574 +3 523 574 83 +3 523 195 187 +3 523 190 195 +3 523 83 573 +3 523 573 353 +3 523 353 572 +3 523 192 190 +3 523 56 157 +3 523 405 21 +3 523 21 406 +3 523 406 27 +3 523 572 263 +3 523 263 571 +3 523 27 409 +3 523 409 32 +3 523 32 410 +3 523 410 35 +3 523 35 411 +3 523 411 40 +3 523 40 414 +3 523 414 46 +3 523 46 415 +3 523 415 49 +3 523 49 416 +3 523 416 54 +3 523 54 419 +3 523 419 69 +3 523 422 141 +3 523 69 420 +3 523 420 73 +3 523 73 421 +3 523 421 76 +3 523 76 424 +3 523 424 81 +3 523 571 485 +3 523 485 570 +3 523 494 237 +3 523 237 509 +3 523 509 220 +3 523 220 0 +3 523 0 216 +3 523 81 425 +3 523 425 28 +3 523 570 448 +3 523 448 569 +3 523 28 426 +3 523 216 349 +3 523 349 203 +3 523 451 115 +3 523 91 451 +3 523 203 335 +3 523 335 194 +3 523 194 599 +3 523 569 465 +3 523 599 182 +3 523 182 598 +3 523 339 524 +3 523 525 339 +3 523 141 438 +3 523 82 23 +3 523 14 82 +3 523 465 568 +3 523 568 52 +3 523 52 567 +3 523 153 525 +3 523 526 153 +3 523 96 526 +3 523 527 96 +3 523 426 151 +3 523 151 429 +3 523 343 527 +3 523 528 343 +3 523 429 198 +3 523 198 430 +3 523 68 14 +3 523 517 68 +3 523 567 87 +3 523 87 566 +3 61 505 523 +3 523 70 528 +3 159 523 505 +3 159 514 523 +3 523 430 48 +3 523 566 62 +3 523 529 70 +3 523 62 565 +3 523 565 146 +3 523 146 564 +3 523 197 192 +3 523 564 10 +3 523 300 529 +3 523 10 563 +3 523 157 33 +3 523 530 300 +3 523 33 173 +3 523 173 31 +3 523 31 183 +3 523 183 20 +3 523 563 260 +3 523 20 189 +3 523 260 562 +3 523 189 17 +3 523 17 193 +3 523 166 530 +3 523 193 13 +3 523 13 201 +3 523 531 166 +3 523 201 8 +3 523 8 210 +3 523 65 446 +3 523 503 531 +3 523 210 2 +3 523 2 214 +3 523 214 1 +3 523 562 267 +3 523 48 431 +3 523 1 222 +3 523 222 186 +3 523 186 224 +3 523 224 252 +3 523 252 233 +3 523 233 359 +3 523 431 42 +3 523 267 561 +3 523 359 243 +3 523 243 511 +3 523 511 248 +3 523 248 520 +3 523 520 253 +3 523 253 516 +3 523 561 63 +3 523 63 560 +3 523 516 254 +3 523 254 510 +3 523 510 259 +3 523 259 506 +3 523 506 261 +3 523 261 500 +3 523 560 60 +3 523 60 559 +3 523 500 272 +3 523 272 496 +3 523 496 273 +3 523 273 490 +3 523 42 434 +3 523 559 38 +3 523 434 30 +3 523 30 435 +3 523 435 24 +3 523 38 558 +3 523 24 436 +3 523 490 278 +3 523 278 486 +3 523 558 37 +3 523 436 314 +3 523 486 283 +3 523 283 480 +3 523 480 284 +3 523 284 476 +3 523 476 286 +3 523 286 471 +3 523 314 439 +3 523 37 557 +3 523 471 290 +3 523 557 22 +3 523 290 467 +3 523 467 291 +3 523 291 167 +3 523 167 292 +3 523 292 154 +3 523 154 295 +3 523 295 140 +3 523 140 296 +3 523 296 131 +3 523 131 297 +3 523 297 113 +3 523 113 301 +3 523 301 100 +3 523 100 302 +3 523 302 51 +3 523 51 303 +3 523 303 36 +3 523 36 306 +3 523 306 16 +3 523 16 308 +3 523 22 556 +3 523 308 328 +3 523 328 311 +3 523 311 447 +3 523 532 503 +3 523 447 315 +3 523 315 443 +3 523 443 319 +3 523 319 437 +3 523 437 324 +3 523 324 433 +3 523 234 532 +3 523 556 19 +3 523 19 555 +3 523 433 326 +3 523 326 427 +3 523 427 330 +3 523 330 423 +3 523 423 331 +3 523 533 234 +3 523 555 5 +3 523 331 417 +3 523 417 333 +3 523 333 413 +3 523 413 334 +3 523 334 407 +3 523 407 338 +3 523 98 533 +3 523 338 403 +3 523 5 554 +3 523 403 340 +3 523 340 341 +3 523 341 342 +3 523 342 329 +3 523 329 345 +3 523 554 309 +3 523 534 98 +3 523 345 312 +3 523 74 517 +3 523 309 553 +3 523 522 74 +3 523 312 346 +3 523 94 534 +3 523 535 94 +3 523 57 535 +3 523 553 240 +3 523 240 552 +3 523 536 57 +3 523 4 536 +3 523 537 4 +3 523 323 537 +3 523 445 65 +3 523 538 323 +3 523 439 344 +3 523 344 440 +3 523 408 538 +3 523 539 408 +3 523 47 539 +3 523 540 47 +3 523 274 540 +3 523 518 445 +3 523 552 264 +3 523 264 551 +3 523 188 197 +3 523 257 188 +3 523 185 257 +3 523 265 185 +3 523 181 265 +3 523 321 181 +3 523 551 432 +3 523 432 550 +3 523 178 321 +3 523 99 178 +3 523 175 99 +3 523 277 175 +3 523 171 277 +3 523 293 171 +3 523 550 317 +3 523 440 474 +3 523 169 293 +3 523 79 169 +3 523 168 79 +3 523 72 168 +3 523 164 72 +3 523 317 549 +3 523 59 164 +3 523 474 441 +3 523 162 59 +3 523 473 162 +3 523 158 473 +3 523 351 158 +3 523 156 351 +3 523 346 304 +3 523 304 348 +3 523 348 289 +3 523 289 352 +3 523 256 156 +3 523 152 256 +3 523 441 492 +3 523 549 310 +3 523 238 152 +3 523 150 238 +3 523 515 150 +3 523 147 515 +3 523 481 147 +3 523 143 481 +3 523 310 548 +3 523 352 280 +3 523 280 354 +3 523 548 276 +3 523 438 143 +3 523 354 174 +3 523 174 355 +3 523 276 547 +3 523 355 78 +3 523 547 360 +3 523 78 358 +3 523 358 361 +3 523 361 449 +3 523 449 53 +3 523 53 452 +3 523 452 80 +3 523 80 457 +3 523 457 251 +3 523 251 458 +3 523 458 271 +3 523 360 546 +3 523 546 165 +3 523 271 460 +3 523 460 287 +3 523 287 466 +3 523 466 294 +3 523 294 469 +3 523 469 298 +3 523 492 444 +3 523 165 545 +3 523 444 518 +3 523 298 482 +3 523 482 305 +3 523 545 11 +3 523 305 483 +3 523 483 412 +3 523 412 488 +3 523 488 129 +3 523 129 493 +3 523 493 491 +3 523 491 495 +3 523 495 136 +3 523 11 544 +3 523 136 497 +3 523 544 97 +3 523 97 543 +3 523 497 145 +3 523 145 498 +3 523 498 266 +3 523 266 501 +3 523 501 322 +3 523 322 502 +3 523 543 489 +3 523 489 542 +3 523 502 468 +3 523 468 512 +3 523 512 487 +3 523 487 521 +3 523 521 508 +3 523 508 522 +3 523 542 507 +3 523 507 541 +3 523 541 274 +3 523 362 484 +3 523 230 391 +3 523 363 268 +3 523 364 163 +3 523 249 394 +3 523 365 172 +3 523 366 387 +3 523 258 397 +3 523 268 400 +3 523 367 275 +3 523 275 363 +3 523 368 179 +3 523 369 499 +3 523 281 367 +3 523 370 281 +3 523 371 92 +3 523 285 370 +3 523 105 371 +3 523 372 191 +3 523 373 285 +3 523 299 373 +3 523 106 374 +3 523 374 105 +3 523 375 196 +3 523 313 376 +3 523 126 377 +3 523 376 299 +3 523 377 106 +3 523 325 379 +3 523 133 380 +3 523 378 206 +3 523 337 381 +3 523 137 382 +3 523 379 313 +3 523 380 126 +3 523 350 384 +3 523 144 385 +3 523 357 388 +3 523 148 389 +3 523 381 325 +3 523 382 133 +3 523 383 207 +3 523 470 392 +3 523 149 393 +3 523 477 395 +3 523 161 396 +3 523 384 337 +3 523 385 137 +3 523 386 219 +3 523 484 398 +3 523 163 399 +3 523 387 362 +3 523 172 364 +3 523 388 350 +3 523 389 144 +3 523 390 225 +3 523 499 366 +3 523 179 365 +3 523 391 229 +3 523 504 369 +3 523 191 368 +3 523 392 357 +3 523 393 148 +3 523 196 372 +3 523 394 230 +3 523 206 375 +3 523 395 470 +3 523 396 149 +3 523 207 378 +3 523 397 249 +3 523 398 477 +3 523 219 383 +3 523 225 386 +3 523 399 161 +3 523 229 390 +3 523 400 258 +3 401 504 523 +3 513 401 523 +3 402 513 523 +3 514 402 523 +3 523 23 462 +3 523 462 26 +3 523 26 455 +3 523 455 39 +3 523 39 279 +3 523 279 43 +3 523 43 236 +3 523 236 45 +3 523 45 208 +3 523 208 67 +3 523 67 176 +3 523 176 71 +3 523 71 132 +3 523 132 75 +3 523 75 109 +3 523 109 86 +3 523 86 89 +3 523 89 88 +3 523 88 66 +3 523 66 90 +3 523 90 41 +3 523 41 103 +3 523 103 7 +3 523 7 104 +3 523 104 34 +3 523 34 107 +3 523 107 112 +3 523 112 108 +3 523 108 418 +3 523 418 110 +3 523 110 327 +3 523 327 111 +3 523 111 29 +3 523 29 114 +3 523 114 472 +3 523 472 119 +3 523 119 3 +3 523 3 120 +3 523 120 134 +3 523 134 122 +3 523 122 255 +3 523 255 123 +3 523 123 479 +3 523 479 127 +3 523 127 519 +3 523 519 128 +3 523 128 332 +3 523 332 130 +3 523 130 64 +3 523 64 316 +3 523 316 50 +3 523 50 135 +3 523 135 25 +3 523 25 138 +3 523 138 422 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp new file mode 100644 index 00000000000..3b14b3f72d1 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + +typedef K::Point_3 Point; +typedef K::Vector_3 Vector; + +typedef CGAL::Surface_mesh Mesh; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +namespace PMP = CGAL::Polygon_mesh_processing; + +int main(int argc, char* argv[]) +{ + const std::string filename = "./data/slow_compute_normal.off"; + + Mesh mesh; + if(!PMP::IO::read_polygon_mesh(filename, mesh)) + { + std::cerr << "Invalid input." << std::endl; + return 1; + } + + CGAL::Timer t; + t.start(); + std::cout << "compute_vertex_normal" << std::endl; + PMP::compute_vertex_normal(vertex_descriptor(523), mesh); + std::cout << t.time() << " sec." << std::endl; + + return 0; +} From 125a0d60416973ad91096cf2fec7513f89cd2ff1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 10 Jan 2025 09:16:17 +0000 Subject: [PATCH 009/145] A trivial fix for the data set, but does not work when the face normals are slightly perturbed --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index dd77b2e9843..d1bf35fc630 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -516,6 +516,9 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits::null_face()) continue; + if((! incident_faces.empty()) && (get(face_normals, incident_faces.back()) == get(face_normals, f)) ) + continue; + incident_faces.push_back(f); } From be12df3dc1997f3183f603f35c8dcef8a1a8f7f6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 13 Jan 2025 07:18:26 +0000 Subject: [PATCH 010/145] A deviation of 0.1 degree can savely considered as zero here --- .../CGAL/Polygon_mesh_processing/compute_normal.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index d1bf35fc630..53c7a1e9cfa 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -509,6 +509,8 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits incident_faces; incident_faces.reserve(8); for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) @@ -516,9 +518,14 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits::null_face()) continue; - if((! incident_faces.empty()) && (get(face_normals, incident_faces.back()) == get(face_normals, f)) ) - continue; + if(! incident_faces.empty()){ + if((get(face_normals, incident_faces.back()) == get(face_normals, f)) ) + continue; + auto aa = approximate_angle(get(face_normals, incident_faces.back()) ,get(face_normals, f)); + if(aa < bound) + continue; + } incident_faces.push_back(f); } From 95b4eba11e8f83a6e7748ee34456dadf08b0bb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Thu, 6 Feb 2025 09:35:02 +0100 Subject: [PATCH 011/145] Fix of issue 8213 by consider length of a vector being zero if enough small, define diff_of_product in a specific file --- .../include/CGAL/Cartesian/CrossProduct.h | 60 +++++++++++++++++++ .../include/CGAL/Cartesian/MatrixC33.h | 14 +++++ .../internal/Lindstrom_Turk_core.h | 53 +++++----------- .../issue_8213.cpp | 16 ++--- 4 files changed, 99 insertions(+), 44 deletions(-) create mode 100644 Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h new file mode 100644 index 00000000000..ebaed862213 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h @@ -0,0 +1,60 @@ +// Copyright (c) 2025 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Mael Rouxel-Labbé +// +#ifndef CGAL_CARTESIAN_CROSSPRODUCT_H +#define CGAL_CARTESIAN_CROSSPRODUCT_H + +#include + +#include + +namespace CGAL { + +// a*b - c*d + // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products + static double diff_of_products_kahan(const double a, const double b, const double c, const double d) + { + double w = d * c; + double e = std::fma(c, -d, w); + double f = std::fma(a, b, -w); + return f + e; + } + + static double diff_of_products_cht(const double a, const double b, const double c, const double d) + { + double p1 = a * b; + double p2 = c * d; + double e1 = std::fma (a, b, -p1); + double e2 = std::fma (c, -d, p2); + double r = p1 - p2; + double e = e1 + e2; + return r + e; + } + + static double diff_of_products(const double a, const double b, const double c, const double d) + { + // return a*b - c*d; + // the next two are equivalent in results and speed + return diff_of_products_kahan(a, b, c, d); + // return diff_of_products_cht(a, b, c, d); + } + + template + static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) + { + return a*b - c*d; + } + +} // namespace CGAL + +#endif // CGAL_CARTESIAN_CROSSPRODUCT_H // +// EOF // + + diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 3c24abbc3c2..70399434bb2 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -219,6 +220,19 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) if(! CGAL_NTS is_zero(det)) { + + // RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; + // RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; + // RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; + + // RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; + // RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; + // RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; + + // RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; + // RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; + // RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; + RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det; RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det; RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 8c04b537e7f..247fa23381e 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -101,6 +102,8 @@ private : void extract_triangle_data(); void extract_boundary_data(); + double maxBb; + void add_boundary_preservation_constraints(const Boundary_data_vector& aBdry); void add_volume_preservation_constraints(const Triangle_data_vector& triangles); void add_boundary_and_volume_optimization_constraints(const Boundary_data_vector& aBdry, @@ -119,42 +122,6 @@ private : const Geom_traits& geom_traits() const { return mProfile.geom_traits(); } const TM& surface() const { return mProfile.surface(); } -#if 0 - // a*b - c*d - // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products - static double diff_of_products_kahan(const double a, const double b, const double c, const double d) - { - double w = d * c; - double e = std::fma(c, -d, w); - double f = std::fma(a, b, -w); - return f + e; - } - - static double diff_of_products_cht(const double a, const double b, const double c, const double d) - { - double p1 = a * b; - double p2 = c * d; - double e1 = std::fma (a, b, -p1); - double e2 = std::fma (c, -d, p2); - double r = p1 - p2; - double e = e1 + e2; - return r + e; - } - - static double diff_of_products(const double a, const double b, const double c, const double d) - { - // the next two are equivalent in results and speed - return diff_of_products_kahan(a, b, c, d); - // return diff_of_products_cht(a, b, c, d); - } - - template - static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) - { - return a*b - c*d; - } -#endif - #ifdef __AVX__ static Vector SL_cross_product_avx(const Vector& A, const Vector& B) { @@ -353,12 +320,18 @@ extract_triangle_data() { mTriangle_data.reserve(mProfile.triangles().size()); + //TODO for obscur reason, computing this abs_max increase running time by 10% + double abs_max; for(const Triangle& tri : mProfile.triangles()) { const Point_reference p0 = get_point(tri.v0); const Point_reference p1 = get_point(tri.v1); const Point_reference p2 = get_point(tri.v2); + abs_max=(std::max)({abs_max,std::abs(p0.x()),std::abs(p0.y()),std::abs(p0.z()), + std::abs(p1.x()),std::abs(p1.y()),std::abs(p1.z()), + std::abs(p2.x()),std::abs(p2.y()),std::abs(p2.z())}); + Vector v01 = p1 - p0; Vector v02 = p2 - p0; @@ -370,6 +343,7 @@ extract_triangle_data() mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL)); } + maxBb= abs_max; } template @@ -687,7 +661,11 @@ add_constraint_if_alpha_compatible(const Vector& Ai, FT l = CGAL_NTS sqrt(slai); CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l)); - if(!CGAL_NTS is_zero(l)) + // Due to double number type, l may have a small value instead of zero (example sum of the faces normals of a tetrahedra for volumic constraint) + // if bin is greater than maxBb, we consider that l is zero + CGAL_SMS_LT_TRACE(3, " error consider: " << (std::abs(bi) / (2*maxBb))); + if(l > (std::abs(bi) / (2*maxBb))) + // if(!CGAL_NTS is_zero(l)) { Vector Ain = Ai / l; FT bin = bi / l; @@ -862,6 +840,7 @@ add_constraint_from_gradient(const Matrix& H, } break; } + } } // namespace internal diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp index b086fe22e73..d8bd43e4a74 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -3,6 +3,8 @@ #include +CGAL::Bbox_3 bbox_g; +double max_bbox_g; #define CGAL_CHECK_EXPENSIVE #define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5 @@ -15,7 +17,7 @@ void Surface_simplification_external_trace(const std::string& s) #include #include -#include +// #include #include #include #include @@ -48,19 +50,19 @@ int main(int argc, char** argv) return EXIT_FAILURE; } - CGAL::Bbox_3 bbox = PMP::bbox(sm); - + auto bb=PMP::bbox(sm); + std::cout << "Bbox:" << bb << std::endl; std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl; std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; SMS::Face_count_stop_predicate stop(1); SMS::edge_collapse( - surface_mesh, + sm, stop, CGAL::parameters:: - filter(SMS::Bounded_normal_change_filter>(SMS::Bounding_box_filter<>())) - .get_cost(SMS::LindstromTurk_cost()) + // filter(SMS::Bounded_normal_change_filter<>()) //>(SMS::Bounding_box_filter<>())) + get_cost(SMS::LindstromTurk_cost()) .get_placement(SMS::LindstromTurk_placement()) ); CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); @@ -69,7 +71,7 @@ int main(int argc, char** argv) { // To be within the bounding box isn't a guarantee, but here it is a sufficient test // to check if things went awry - if(!CGAL::do_overlap(bbox, sm.point(v).bbox())) + if(!CGAL::do_overlap(bb, sm.point(v).bbox())) { std::cerr << "Error: " << sm.point(v) << " is outside the initial bbox" << std::endl; return EXIT_FAILURE; From cc5297554c7e2bee65cb44acd1866be58d1938bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Tue, 1 Apr 2025 09:48:25 +0200 Subject: [PATCH 012/145] Correct code with suggestion of sebastien --- .../Edge_collapse/internal/Lindstrom_Turk_core.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 247fa23381e..d9ea2691883 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -320,17 +320,16 @@ extract_triangle_data() { mTriangle_data.reserve(mProfile.triangles().size()); - //TODO for obscur reason, computing this abs_max increase running time by 10% - double abs_max; for(const Triangle& tri : mProfile.triangles()) { const Point_reference p0 = get_point(tri.v0); const Point_reference p1 = get_point(tri.v1); const Point_reference p2 = get_point(tri.v2); - abs_max=(std::max)({abs_max,std::abs(p0.x()),std::abs(p0.y()),std::abs(p0.z()), - std::abs(p1.x()),std::abs(p1.y()),std::abs(p1.z()), - std::abs(p2.x()),std::abs(p2.y()),std::abs(p2.z())}); + //TODO for obscur reason, computing this maxBb increase running time by 10% + maxBb=(std::max)({maxBb,std::abs(p0.x()),std::abs(p0.y()),std::abs(p0.z()), + std::abs(p1.x()),std::abs(p1.y()),std::abs(p1.z()), + std::abs(p2.x()),std::abs(p2.y()),std::abs(p2.z())}); Vector v01 = p1 - p0; Vector v02 = p2 - p0; @@ -343,7 +342,6 @@ extract_triangle_data() mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL)); } - maxBb= abs_max; } template @@ -662,7 +660,7 @@ add_constraint_if_alpha_compatible(const Vector& Ai, CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l)); // Due to double number type, l may have a small value instead of zero (example sum of the faces normals of a tetrahedra for volumic constraint) - // if bin is greater than maxBb, we consider that l is zero + // if bi is greater than maxBb, we consider that l is zero CGAL_SMS_LT_TRACE(3, " error consider: " << (std::abs(bi) / (2*maxBb))); if(l > (std::abs(bi) / (2*maxBb))) // if(!CGAL_NTS is_zero(l)) From e79ee242bd088dd2bdc4ed70296e6ee6dd2b358a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 09:37:39 +0100 Subject: [PATCH 013/145] Add code for FPG of Orientation_5 --- .../include/CGAL/NewKernel_d/orientationC5.h | 83 +++++++++++++++++++ .../benchmark/Triangulation/CMakeLists.txt | 2 + .../benchmark/Triangulation/bench5d.cpp | 56 +++++++++++++ .../benchmark/Triangulation/generate_d.cpp | 24 ++++++ 4 files changed, 165 insertions(+) create mode 100644 NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h create mode 100644 Triangulation/benchmark/Triangulation/bench5d.cpp create mode 100644 Triangulation/benchmark/Triangulation/generate_d.cpp diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h new file mode 100644 index 00000000000..dd663f4a9ee --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -0,0 +1,83 @@ + + + +typedef double RT; + +RT +determinant( + RT a00, RT a01, RT a02, RT a03, RT a04, + RT a10, RT a11, RT a12, RT a13, RT a14, + RT a20, RT a21, RT a22, RT a23, RT a24, + RT a30, RT a31, RT a32, RT a33, RT a34, + RT a40, RT a41, RT a42, RT a43, RT a44) +{ +// First compute the det2x2 + const RT m01 = a10*a01 - a00*a11; + const RT m02 = a20*a01 - a00*a21; + const RT m03 = a30*a01 - a00*a31; + const RT m04 = a40*a01 - a00*a41; + const RT m12 = a20*a11 - a10*a21; + const RT m13 = a30*a11 - a10*a31; + const RT m14 = a40*a11 - a10*a41; + const RT m23 = a30*a21 - a20*a31; + const RT m24 = a40*a21 - a20*a41; + const RT m34 = a40*a31 - a30*a41; +// Now compute the minors of rank 3 + const RT m012 = m12*a02 - m02*a12 + m01*a22; + const RT m013 = m13*a02 - m03*a12 + m01*a32; + const RT m014 = m14*a02 - m04*a12 + m01*a42; + const RT m023 = m23*a02 - m03*a22 + m02*a32; + const RT m024 = m24*a02 - m04*a22 + m02*a42; + const RT m034 = m34*a02 - m04*a32 + m03*a42; + const RT m123 = m23*a12 - m13*a22 + m12*a32; + const RT m124 = m24*a12 - m14*a22 + m12*a42; + const RT m134 = m34*a12 - m14*a32 + m13*a42; + const RT m234 = m34*a22 - m24*a32 + m23*a42; +// Now compute the minors of rank 4 + const RT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + const RT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + const RT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + const RT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + const RT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; +// Now compute the minors of rank 5 + const RT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + return m01234; +} + + + +int +orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, + RT q0, RT q1, RT q2, RT q3, RT q4, + RT r0, RT r1, RT r2, RT r3, RT r4, + RT s0, RT s1, RT s2, RT s3, RT s4, + RT t0, RT t1, RT t2, RT t3, RT t4) +{ + RT pq0 = q0 - p0; + RT pq1 = q1 - p1; + RT pq2 = q2 - p2; + RT pq3 = q3 - p3; + RT pq4 = q4 - p4; + RT pr0 = r0 - p0; + RT pr1 = r1 - p1; + RT pr2 = r2 - p2; + RT pr3 = r3 - p3; + RT pr4 = r4 - p4; + RT ps0 = s0 - p0; + RT ps1 = s1 - p1; + RT ps2 = s2 - p2; + RT ps3 = s3 - p3; + RT ps4 = s4 - p4; + RT pt0 = t0 - p0; + RT pt1 = t1 - p1; + RT pt2 = t2 - p2; + RT pt3 = t3 - p3; + RT pt4 = t4 - p4; + RT det = determinant(pq0, pq1, pq2, pq3, pq4, + pr0, pr1, pr2, pr3, pr4, + ps0, ps1, ps2, ps3, ps4, + pt0, pt1, pt2, pt3, pt4); + + if (det > 0) return 1; + if (det < 0) return -1; +} diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 5a3787259ee..befd92e97c5 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -11,10 +11,12 @@ include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") + create_single_source_cgal_program("bench5d.cpp") create_single_source_cgal_program("delaunay.cpp") target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support) create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support) else() message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/benchmark/Triangulation/bench5d.cpp b/Triangulation/benchmark/Triangulation/bench5d.cpp new file mode 100644 index 00000000000..cadef41b096 --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench5d.cpp @@ -0,0 +1,56 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 5; // we work in Euclidean 5-space + + std::vector points; + std::ifstream in("points.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0, 0 }; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/benchmark/Triangulation/generate_d.cpp b/Triangulation/benchmark/Triangulation/generate_d.cpp new file mode 100644 index 00000000000..32f8da1a300 --- /dev/null +++ b/Triangulation/benchmark/Triangulation/generate_d.cpp @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + CGAL::Random rng; + std::cout.precision(17); + std ::cout << 5 << std::endl; + std::cout << 100000 << std::endl; + for(int i = 0; i < 100000; ++i) { + std::array arr; + double slength = 0; + for(int i = 0; i < arr.size(); ++i) { + arr[i] = rng.get_double(-1, 1); + slength += arr[i] * arr[i]; + } + slength = std::sqrt(slength); + for(int i = 0; i < arr.size(); ++i) { + arr[i] /= slength; + } + std::cout << "5 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] << " " << arr[4] << std::endl; + } + return 0; +} From 8cacb534a562c99eacba0f46645d346914628110 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 09:42:15 +0100 Subject: [PATCH 014/145] needs one more point --- NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index dd663f4a9ee..a2a927aaf26 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -51,7 +51,8 @@ orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, RT q0, RT q1, RT q2, RT q3, RT q4, RT r0, RT r1, RT r2, RT r3, RT r4, RT s0, RT s1, RT s2, RT s3, RT s4, - RT t0, RT t1, RT t2, RT t3, RT t4) + RT t0, RT t1, RT t2, RT t3, RT t4, + RT u0, RT u1, RT u2, RT u3, RT u4) { RT pq0 = q0 - p0; RT pq1 = q1 - p1; @@ -73,10 +74,16 @@ orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, RT pt2 = t2 - p2; RT pt3 = t3 - p3; RT pt4 = t4 - p4; + RT pu0 = t0 - p0; + RT pu1 = u1 - p1; + RT pu2 = u2 - p2; + RT pu3 = u3 - p3; + RT pu4 = u4 - p4; RT det = determinant(pq0, pq1, pq2, pq3, pq4, pr0, pr1, pr2, pr3, pr4, ps0, ps1, ps2, ps3, ps4, - pt0, pt1, pt2, pt3, pt4); + pt0, pt1, pt2, pt3, pt4, + pu0, pu1, pu2, pu3, pu4); if (det > 0) return 1; if (det < 0) return -1; From f21e9b18ba6b3fb3d6af0626e6ab1676d86d0ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 23 Apr 2025 11:07:19 +0200 Subject: [PATCH 015/145] update predicate source --- .../include/CGAL/NewKernel_d/orientationC5.h | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index a2a927aaf26..cbe8e30c501 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -1,6 +1,3 @@ - - - typedef double RT; RT @@ -11,36 +8,35 @@ determinant( RT a30, RT a31, RT a32, RT a33, RT a34, RT a40, RT a41, RT a42, RT a43, RT a44) { -// First compute the det2x2 - const RT m01 = a10*a01 - a00*a11; - const RT m02 = a20*a01 - a00*a21; - const RT m03 = a30*a01 - a00*a31; - const RT m04 = a40*a01 - a00*a41; - const RT m12 = a20*a11 - a10*a21; - const RT m13 = a30*a11 - a10*a31; - const RT m14 = a40*a11 - a10*a41; - const RT m23 = a30*a21 - a20*a31; - const RT m24 = a40*a21 - a20*a41; - const RT m34 = a40*a31 - a30*a41; -// Now compute the minors of rank 3 - const RT m012 = m12*a02 - m02*a12 + m01*a22; - const RT m013 = m13*a02 - m03*a12 + m01*a32; - const RT m014 = m14*a02 - m04*a12 + m01*a42; - const RT m023 = m23*a02 - m03*a22 + m02*a32; - const RT m024 = m24*a02 - m04*a22 + m02*a42; - const RT m034 = m34*a02 - m04*a32 + m03*a42; - const RT m123 = m23*a12 - m13*a22 + m12*a32; - const RT m124 = m24*a12 - m14*a22 + m12*a42; - const RT m134 = m34*a12 - m14*a32 + m13*a42; - const RT m234 = m34*a22 - m24*a32 + m23*a42; -// Now compute the minors of rank 4 - const RT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; - const RT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; - const RT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; - const RT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; - const RT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; -// Now compute the minors of rank 5 - const RT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + RT m01 = a10*a01 - a00*a11; + RT m02 = a20*a01 - a00*a21; + RT m03 = a30*a01 - a00*a31; + RT m04 = a40*a01 - a00*a41; + RT m12 = a20*a11 - a10*a21; + RT m13 = a30*a11 - a10*a31; + RT m14 = a40*a11 - a10*a41; + RT m23 = a30*a21 - a20*a31; + RT m24 = a40*a21 - a20*a41; + RT m34 = a40*a31 - a30*a41; + + RT m012 = m12*a02 - m02*a12 + m01*a22; + RT m013 = m13*a02 - m03*a12 + m01*a32; + RT m014 = m14*a02 - m04*a12 + m01*a42; + RT m023 = m23*a02 - m03*a22 + m02*a32; + RT m024 = m24*a02 - m04*a22 + m02*a42; + RT m034 = m34*a02 - m04*a32 + m03*a42; + RT m123 = m23*a12 - m13*a22 + m12*a32; + RT m124 = m24*a12 - m14*a22 + m12*a42; + RT m134 = m34*a12 - m14*a32 + m13*a42; + RT m234 = m34*a22 - m24*a32 + m23*a42; + + RT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + RT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + RT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + RT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + RT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; + + RT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; return m01234; } @@ -53,6 +49,11 @@ orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, RT s0, RT s1, RT s2, RT s3, RT s4, RT t0, RT t1, RT t2, RT t3, RT t4, RT u0, RT u1, RT u2, RT u3, RT u4) +group p0 q0 r0 s0 t0 u0; +group p1 q1 r1 s1 t1 u1; +group p2 q2 r2 s2 t2 u2; +group p3 q3 r3 s3 t3 u3; +group p4 q4 r4 s4 t4 u4; { RT pq0 = q0 - p0; RT pq1 = q1 - p1; @@ -85,6 +86,5 @@ orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, pt0, pt1, pt2, pt3, pt4, pu0, pu1, pu2, pu3, pu4); - if (det > 0) return 1; - if (det < 0) return -1; + return sign(det); } From e622f3e03ebb86d1cc3a0ccb7dd1be236040eb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 23 Apr 2025 11:08:12 +0200 Subject: [PATCH 016/145] replace with FPG generated code --- .../include/CGAL/NewKernel_d/orientationC5.h | 356 +++++++++++++----- 1 file changed, 271 insertions(+), 85 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index cbe8e30c501..5a07bc09d5e 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -1,90 +1,276 @@ -typedef double RT; -RT -determinant( - RT a00, RT a01, RT a02, RT a03, RT a04, - RT a10, RT a11, RT a12, RT a13, RT a14, - RT a20, RT a21, RT a22, RT a23, RT a24, - RT a30, RT a31, RT a32, RT a33, RT a34, - RT a40, RT a41, RT a42, RT a43, RT a44) -{ - RT m01 = a10*a01 - a00*a11; - RT m02 = a20*a01 - a00*a21; - RT m03 = a30*a01 - a00*a31; - RT m04 = a40*a01 - a00*a41; - RT m12 = a20*a11 - a10*a21; - RT m13 = a30*a11 - a10*a31; - RT m14 = a40*a11 - a10*a41; - RT m23 = a30*a21 - a20*a31; - RT m24 = a40*a21 - a20*a41; - RT m34 = a40*a31 - a30*a41; - - RT m012 = m12*a02 - m02*a12 + m01*a22; - RT m013 = m13*a02 - m03*a12 + m01*a32; - RT m014 = m14*a02 - m04*a12 + m01*a42; - RT m023 = m23*a02 - m03*a22 + m02*a32; - RT m024 = m24*a02 - m04*a22 + m02*a42; - RT m034 = m34*a02 - m04*a32 + m03*a42; - RT m123 = m23*a12 - m13*a22 + m12*a32; - RT m124 = m24*a12 - m14*a22 + m12*a42; - RT m134 = m34*a12 - m14*a32 + m13*a42; - RT m234 = m34*a22 - m24*a32 + m23*a42; - - RT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; - RT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; - RT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; - RT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; - RT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; - - RT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; - return m01234; +inline double determinant( double a00, double a01, double a02, double a03, double a04, double a10, double a11, double a12, double a13, double a14, double a20, double a21, double a22, double a23, double a24, double a30, double a31, double a32, double a33, double a34, double a40, double a41, double a42, double a43, double a44) { + double m01; + m01 = ((a10 * a01) - (a00 * a11)); + double m02; + m02 = ((a20 * a01) - (a00 * a21)); + double m03; + m03 = ((a30 * a01) - (a00 * a31)); + double m04; + m04 = ((a40 * a01) - (a00 * a41)); + double m12; + m12 = ((a20 * a11) - (a10 * a21)); + double m13; + m13 = ((a30 * a11) - (a10 * a31)); + double m14; + m14 = ((a40 * a11) - (a10 * a41)); + double m23; + m23 = ((a30 * a21) - (a20 * a31)); + double m24; + m24 = ((a40 * a21) - (a20 * a41)); + double m34; + m34 = ((a40 * a31) - (a30 * a41)); + double m012; + m012 = (((m12 * a02) - (m02 * a12)) + (m01 * a22)); + double m013; + m013 = (((m13 * a02) - (m03 * a12)) + (m01 * a32)); + double m014; + m014 = (((m14 * a02) - (m04 * a12)) + (m01 * a42)); + double m023; + m023 = (((m23 * a02) - (m03 * a22)) + (m02 * a32)); + double m024; + m024 = (((m24 * a02) - (m04 * a22)) + (m02 * a42)); + double m034; + m034 = (((m34 * a02) - (m04 * a32)) + (m03 * a42)); + double m123; + m123 = (((m23 * a12) - (m13 * a22)) + (m12 * a32)); + double m124; + m124 = (((m24 * a12) - (m14 * a22)) + (m12 * a42)); + double m134; + m134 = (((m34 * a12) - (m14 * a32)) + (m13 * a42)); + double m234; + m234 = (((m34 * a22) - (m24 * a32)) + (m23 * a42)); + double m0123; + m0123 = ((((m123 * a03) - (m023 * a13)) + (m013 * a23)) - (m012 * a33)); + double m0124; + m0124 = ((((m124 * a03) - (m024 * a13)) + (m014 * a23)) - (m012 * a43)); + double m0134; + m0134 = ((((m134 * a03) - (m034 * a13)) + (m014 * a33)) - (m013 * a43)); + double m0234; + m0234 = ((((m234 * a03) - (m034 * a23)) + (m024 * a33)) - (m023 * a43)); + double m1234; + m1234 = ((((m234 * a13) - (m134 * a23)) + (m124 * a33)) - (m123 * a43)); + double m01234; + m01234 = (((((m1234 * a04) - (m0234 * a14)) + (m0134 * a24)) - (m0124 * a34)) + (m0123 * a44)); + return m01234; } - -int -orientationC5(RT p0, RT p1, RT p2, RT p3, RT p4, - RT q0, RT q1, RT q2, RT q3, RT q4, - RT r0, RT r1, RT r2, RT r3, RT r4, - RT s0, RT s1, RT s2, RT s3, RT s4, - RT t0, RT t1, RT t2, RT t3, RT t4, - RT u0, RT u1, RT u2, RT u3, RT u4) -group p0 q0 r0 s0 t0 u0; -group p1 q1 r1 s1 t1 u1; -group p2 q2 r2 s2 t2 u2; -group p3 q3 r3 s3 t3 u3; -group p4 q4 r4 s4 t4 u4; -{ - RT pq0 = q0 - p0; - RT pq1 = q1 - p1; - RT pq2 = q2 - p2; - RT pq3 = q3 - p3; - RT pq4 = q4 - p4; - RT pr0 = r0 - p0; - RT pr1 = r1 - p1; - RT pr2 = r2 - p2; - RT pr3 = r3 - p3; - RT pr4 = r4 - p4; - RT ps0 = s0 - p0; - RT ps1 = s1 - p1; - RT ps2 = s2 - p2; - RT ps3 = s3 - p3; - RT ps4 = s4 - p4; - RT pt0 = t0 - p0; - RT pt1 = t1 - p1; - RT pt2 = t2 - p2; - RT pt3 = t3 - p3; - RT pt4 = t4 - p4; - RT pu0 = t0 - p0; - RT pu1 = u1 - p1; - RT pu2 = u2 - p2; - RT pu3 = u3 - p3; - RT pu4 = u4 - p4; - RT det = determinant(pq0, pq1, pq2, pq3, pq4, - pr0, pr1, pr2, pr3, pr4, - ps0, ps1, ps2, ps3, ps4, - pt0, pt1, pt2, pt3, pt4, - pu0, pu1, pu2, pu3, pu4); - - return sign(det); +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { + double pq0; + pq0 = (q0 - p0); + double pq1; + pq1 = (q1 - p1); + double pq2; + pq2 = (q2 - p2); + double pq3; + pq3 = (q3 - p3); + double pq4; + pq4 = (q4 - p4); + double pr0; + pr0 = (r0 - p0); + double pr1; + pr1 = (r1 - p1); + double pr2; + pr2 = (r2 - p2); + double pr3; + pr3 = (r3 - p3); + double pr4; + pr4 = (r4 - p4); + double ps0; + ps0 = (s0 - p0); + double ps1; + ps1 = (s1 - p1); + double ps2; + ps2 = (s2 - p2); + double ps3; + ps3 = (s3 - p3); + double ps4; + ps4 = (s4 - p4); + double pt0; + pt0 = (t0 - p0); + double pt1; + pt1 = (t1 - p1); + double pt2; + pt2 = (t2 - p2); + double pt3; + pt3 = (t3 - p3); + double pt4; + pt4 = (t4 - p4); + double pu0; + pu0 = (t0 - p0); + double pu1; + pu1 = (u1 - p1); + double pu2; + pu2 = (u2 - p2); + double pu3; + pu3 = (u3 - p3); + double pu4; + pu4 = (u4 - p4); + double det; + det = determinant( pq0, pq1, pq2, pq3, pq4, pr0, pr1, pr2, pr3, pr4, ps0, ps1, ps2, ps3, ps4, pt0, pt1, pt2, pt3, pt4, pu0, pu1, pu2, pu3, pu4 ); + int int_tmp_result; + double eps; + double max1 = fabs(pq0); + if( (max1 < fabs(pr0)) ) + { + max1 = fabs(pr0); + } + if( (max1 < fabs(ps0)) ) + { + max1 = fabs(ps0); + } + if( (max1 < fabs(pt0)) ) + { + max1 = fabs(pt0); + } + if( (max1 < fabs(pu0)) ) + { + max1 = fabs(pu0); + } + double max2 = fabs(pq1); + if( (max2 < fabs(pr1)) ) + { + max2 = fabs(pr1); + } + if( (max2 < fabs(ps1)) ) + { + max2 = fabs(ps1); + } + if( (max2 < fabs(pt1)) ) + { + max2 = fabs(pt1); + } + if( (max2 < fabs(pu1)) ) + { + max2 = fabs(pu1); + } + double max3 = fabs(pq2); + if( (max3 < fabs(pr2)) ) + { + max3 = fabs(pr2); + } + if( (max3 < fabs(ps2)) ) + { + max3 = fabs(ps2); + } + if( (max3 < fabs(pt2)) ) + { + max3 = fabs(pt2); + } + if( (max3 < fabs(pu2)) ) + { + max3 = fabs(pu2); + } + double max4 = fabs(pq3); + if( (max4 < fabs(pr3)) ) + { + max4 = fabs(pr3); + } + if( (max4 < fabs(ps3)) ) + { + max4 = fabs(ps3); + } + if( (max4 < fabs(pt3)) ) + { + max4 = fabs(pt3); + } + if( (max4 < fabs(pu3)) ) + { + max4 = fabs(pu3); + } + double max5 = fabs(pq4); + if( (max5 < fabs(pr4)) ) + { + max5 = fabs(pr4); + } + if( (max5 < fabs(ps4)) ) + { + max5 = fabs(ps4); + } + if( (max5 < fabs(pt4)) ) + { + max5 = fabs(pt4); + } + if( (max5 < fabs(pu4)) ) + { + max5 = fabs(pu4); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 9.99657131447050328602e-60) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (2.22889232457534740153e-13 * ((((max1 * max2) * max3) * max4) * max5)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; } + From b9f983a5150cc48e99b44f2aa9b367271a220609 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 11:00:43 +0100 Subject: [PATCH 017/145] Add static filter for Orientation_5 --- .../internal/Static_filters/Orientation_5.h | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h new file mode 100644 index 00000000000..fea94f5307e --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -0,0 +1,279 @@ +// Copyright (c) 20025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H + +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + +template < typename K_base > +class Orientation_5 + : public K_base::Orientation_5 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_5 Point_5; + typedef typename K_base::Orientation_5 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_5 &p, const Point_5 &q, + const Point_5 &r, const Point_5 &s, + const Point_5 &t, const Point_5 &u) const + { + CGAL_BRANCH_PROFILER_5("semi-static failures/attempts/calls to : Orientation_5", tmp); + + double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4; + + if (fit_in_double(p.c0(), po) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(p.c4(), p4) && + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(q.c4(), q4) && + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(r.c4(), r4) && + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(s.c4(), s4)) + { + double pq0; + pq0 = (q0 - p0); + double pq1; + pq1 = (q1 - p1); + double pq2; + pq2 = (q2 - p2); + double pq3; + pq3 = (q3 - p3); + double pq4; + pq4 = (q4 - p4); + double pr0; + pr0 = (r0 - p0); + double pr1; + pr1 = (r1 - p1); + double pr2; + pr2 = (r2 - p2); + double pr3; + pr3 = (r3 - p3); + double pr4; + pr4 = (r4 - p4); + double ps0; + ps0 = (s0 - p0); + double ps1; + ps1 = (s1 - p1); + double ps2; + ps2 = (s2 - p2); + double ps3; + ps3 = (s3 - p3); + double ps4; + ps4 = (s4 - p4); + double pt0; + pt0 = (t0 - p0); + double pt1; + pt1 = (t1 - p1); + double pt2; + pt2 = (t2 - p2); + double pt3; + pt3 = (t3 - p3); + double pt4; + pt4 = (t4 - p4); + double pu0; + pu0 = (t0 - p0); + double pu1; + pu1 = (u1 - p1); + double pu2; + pu2 = (u2 - p2); + double pu3; + pu3 = (u3 - p3); + double pu4; + pu4 = (u4 - p4); + double det; + det = determinant( pq0, pq1, pq2, pq3, pq4, pr0, pr1, pr2, pr3, pr4, ps0, ps1, ps2, ps3, ps4, pt0, pt1, pt2, pt3, pt4, pu0, pu1, pu2, pu3, pu4 ); + Orientation result = ZERO; + double eps; + double max1 = CGAL::abs(pq0); + if( (max1 < CGAL::abs(pr0)) ) + { + max1 = CGAL::abs(pr0); + } + if( (max1 < CGAL::abs(ps0)) ) + { + max1 = CGAL::abs(ps0); + } + if( (max1 < CGAL::abs(pt0)) ) + { + max1 = CGAL::abs(pt0); + } + if( (max1 < CGAL::abs(pu0)) ) + { + max1 = CGAL::abs(pu0); + } + double max2 = CGAL::abs(pq1); + if( (max2 < CGAL::abs(pr1)) ) + { + max2 = CGAL::abs(pr1); + } + if( (max2 < CGAL::abs(ps1)) ) + { + max2 = CGAL::abs(ps1); + } + if( (max2 < CGAL::abs(pt1)) ) + { + max2 = CGAL::abs(pt1); + } + if( (max2 < CGAL::abs(pu1)) ) + { + max2 = CGAL::abs(pu1); + } + double max3 = CGAL::abs(pq2); + if( (max3 < CGAL::abs(pr2)) ) + { + max3 = CGAL::abs(pr2); + } + if( (max3 < CGAL::abs(ps2)) ) + { + max3 = CGAL::abs(ps2); + } + if( (max3 < CGAL::abs(pt2)) ) + { + max3 = CGAL::abs(pt2); + } + if( (max3 < CGAL::abs(pu2)) ) + { + max3 = CGAL::abs(pu2); + } + double max4 = CGAL::abs(pq3); + if( (max4 < CGAL::abs(pr3)) ) + { + max4 = CGAL::abs(pr3); + } + if( (max4 < CGAL::abs(ps3)) ) + { + max4 = CGAL::abs(ps3); + } + if( (max4 < CGAL::abs(pt3)) ) + { + max4 = CGAL::abs(pt3); + } + if( (max4 < CGAL::abs(pu3)) ) + { + max4 = CGAL::abs(pu3); + } + double max5 = CGAL::abs(pq4); + if( (max5 < CGAL::abs(pr4)) ) + { + max5 = CGAL::abs(pr4); + } + if( (max5 < CGAL::abs(ps4)) ) + { + max5 = CGAL::abs(ps4); + } + if( (max5 < CGAL::abs(pt4)) ) + { + max5 = CGAL::abs(pt4); + } + if( (max5 < CGAL::abs(pu4)) ) + { + max5 = CGAL::abs(pu4); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 9.99657131447050328602e-60) ) + { + return Base::operator()(p, q, r, s, t, u); + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) + { + return Base::operator()(p, q, r, s, t, u); + } + eps = (2.22889232457534740153e-13 * ((((max1 * max2) * max3) * max4) * max5)); + if( (det > eps) ) + { + result = POSITIVE; + } + else + { + if( (det < -eps) ) + { + result = NEGATIVE; + } + else + { + return Base::operator()(p, q, r, s, t, u); + } + } + } + return result; + } + return Base::operator()(p, q, r, s, t, u); + } + + +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H From 2d0dfd2822651cf162a79e2a2ff1d6238a3d248e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 11:53:03 +0100 Subject: [PATCH 018/145] Compiles but segfault --- .../internal/Static_filters/Orientation_5.h | 38 +++++++----- .../NewKernel_d/Cartesian_static_filters.h | 62 +++++++++++++++++++ 2 files changed, 85 insertions(+), 15 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index fea94f5307e..f939914b51b 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -35,11 +35,13 @@ public: const Point_5 &r, const Point_5 &s, const Point_5 &t, const Point_5 &u) const { - CGAL_BRANCH_PROFILER_5("semi-static failures/attempts/calls to : Orientation_5", tmp); - double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4; + // return Base::operator()(p, q, r, s, t, u); + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_5", tmp); - if (fit_in_double(p.c0(), po) && fit_in_double(p.c1(), p1) && + double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4; + + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && fit_in_double(p.c4(), p4) && fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && @@ -50,8 +52,15 @@ public: fit_in_double(r.c4(), r4) && fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && - fit_in_double(s.c4(), s4)) + fit_in_double(s.c4(), s4) && + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && + fit_in_double(t.c4(), t4) && + fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) && + fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && + fit_in_double(u.c4(), u4)) { + Orientation should_be = Base::operator()(p, q, r, s, t, u); double pq0; pq0 = (q0 - p0); double pq1; @@ -252,21 +261,20 @@ public: eps = (2.22889232457534740153e-13 * ((((max1 * max2) * max3) * max4) * max5)); if( (det > eps) ) { - result = POSITIVE; + if(should_be != POSITIVE){ + std::cout << "result should not be POSITIVE" << std::endl; + } + return POSITIVE; } - else + + if( (det < -eps) ) { - if( (det < -eps) ) - { - result = NEGATIVE; - } - else - { - return Base::operator()(p, q, r, s, t, u); - } + if(should_be != NEGATIVE){ + std::cout << "result should not be NEGATIVE" << std::endl; + } + return NEGATIVE; } } - return result; } return Base::operator()(p, q, r, s, t, u); } diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index cd870c938e6..5ff54ab1450 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -18,6 +18,7 @@ #include #include #include +#include namespace CGAL { namespace SFA { // static filter adapter @@ -151,6 +152,54 @@ template struct Side_of_oriented_sphere_3 : private Store return typename internal::Static_filters_predicates::Side_of_oriented_sphere_3()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),P(this->kernel(),c,D),P(this->kernel(),c,E)); } }; + + +template struct Adapter_5 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_5 { + R_ const&r; CC const&c; Point const& p; + Point_5(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + decltype(auto) c4()const{return c(p,4);} + }; + struct Orientation_5 { + typedef typename Get_type::type result_type; + auto operator()(Point_5 const&A, Point_5 const&B, Point_5 const&C, + Point_5 const&D, Point_5 const&E, Point_5 const&F)const{ + Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+6)); + } + }; +}; +template struct Orientation_of_points_5 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_5) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_5 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + Point const& F=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_5 P; + return typename internal::Static_filters_predicates::Orientation_5()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F)); + } +}; + + } // namespace SFA template @@ -194,5 +243,18 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { typedef SFA::Side_of_oriented_sphere_3 type; }; }; + + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_5 type; + }; +}; } // namespace CGAL #endif From f747db2774c88c88bbf77aecfe89bcadef7069ef Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 13:48:57 +0100 Subject: [PATCH 019/145] rewrite predicate --- .../internal/Static_filters/Orientation_5.h | 2 +- .../include/CGAL/NewKernel_d/orientationC5.h | 373 +++++------------- 2 files changed, 104 insertions(+), 271 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index f939914b51b..0a19e729751 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -1,4 +1,4 @@ -// Copyright (c) 20025 GeometryFactory (France). +// Copyright (c) 2025 GeometryFactory (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index 5a07bc09d5e..295b9698ec2 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -1,276 +1,109 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri -inline double determinant( double a00, double a01, double a02, double a03, double a04, double a10, double a11, double a12, double a13, double a14, double a20, double a21, double a22, double a23, double a24, double a30, double a31, double a32, double a33, double a34, double a40, double a41, double a42, double a43, double a44) { - double m01; - m01 = ((a10 * a01) - (a00 * a11)); - double m02; - m02 = ((a20 * a01) - (a00 * a21)); - double m03; - m03 = ((a30 * a01) - (a00 * a31)); - double m04; - m04 = ((a40 * a01) - (a00 * a41)); - double m12; - m12 = ((a20 * a11) - (a10 * a21)); - double m13; - m13 = ((a30 * a11) - (a10 * a31)); - double m14; - m14 = ((a40 * a11) - (a10 * a41)); - double m23; - m23 = ((a30 * a21) - (a20 * a31)); - double m24; - m24 = ((a40 * a21) - (a20 * a41)); - double m34; - m34 = ((a40 * a31) - (a30 * a41)); - double m012; - m012 = (((m12 * a02) - (m02 * a12)) + (m01 * a22)); - double m013; - m013 = (((m13 * a02) - (m03 * a12)) + (m01 * a32)); - double m014; - m014 = (((m14 * a02) - (m04 * a12)) + (m01 * a42)); - double m023; - m023 = (((m23 * a02) - (m03 * a22)) + (m02 * a32)); - double m024; - m024 = (((m24 * a02) - (m04 * a22)) + (m02 * a42)); - double m034; - m034 = (((m34 * a02) - (m04 * a32)) + (m03 * a42)); - double m123; - m123 = (((m23 * a12) - (m13 * a22)) + (m12 * a32)); - double m124; - m124 = (((m24 * a12) - (m14 * a22)) + (m12 * a42)); - double m134; - m134 = (((m34 * a12) - (m14 * a32)) + (m13 * a42)); - double m234; - m234 = (((m34 * a22) - (m24 * a32)) + (m23 * a42)); - double m0123; - m0123 = ((((m123 * a03) - (m023 * a13)) + (m013 * a23)) - (m012 * a33)); - double m0124; - m0124 = ((((m124 * a03) - (m024 * a13)) + (m014 * a23)) - (m012 * a43)); - double m0134; - m0134 = ((((m134 * a03) - (m034 * a13)) + (m014 * a33)) - (m013 * a43)); - double m0234; - m0234 = ((((m234 * a03) - (m034 * a23)) + (m024 * a33)) - (m023 * a43)); - double m1234; - m1234 = ((((m234 * a13) - (m134 * a23)) + (m124 * a33)) - (m123 * a43)); - double m01234; - m01234 = (((((m1234 * a04) - (m0234 * a14)) + (m0134 * a24)) - (m0124 * a34)) + (m0123 * a44)); - return m01234; +typedef double RT; + +RT +determinant_with_1_in_row_0( + RT a01, RT a02, RT a03, RT a04, RT a05, + RT a11, RT a12, RT a13, RT a14, RT a15, + RT a21, RT a22, RT a23, RT a24, RT a25, + RT a31, RT a32, RT a33, RT a34, RT a35, + RT a41, RT a42, RT a43, RT a44, RT a45, + RT a51, RT a52, RT a53, RT a54, RT a55) +{ +// First compute the det2x2 + const RT m01 = a11 - a01; + const RT m02 = a21 - a01; + const RT m03 = a31 - a01; + const RT m04 = a41 - a01; + const RT m05 = a51 - a01; + const RT m12 = a21 - a11; + const RT m13 = a31 - a11; + const RT m14 = a41 - a11; + const RT m15 = a51 - a11; + const RT m23 = a31 - a21; + const RT m24 = a41 - a21; + const RT m25 = a51 - a21; + const RT m34 = a41 - a31; + const RT m35 = a51 - a31; + const RT m45 = a51 - a41; +// Now compute the minors of rank 3 + const RT m012 = m01*a22 - m02*a12 + m12*a02; + const RT m013 = m01*a32 - m03*a12 + m13*a02; + const RT m014 = m01*a42 - m04*a12 + m14*a02; + const RT m015 = m01*a52 - m05*a12 + m15*a02; + const RT m023 = m02*a32 - m03*a22 + m23*a02; + const RT m024 = m02*a42 - m04*a22 + m24*a02; + const RT m025 = m02*a52 - m05*a22 + m25*a02; + const RT m034 = m03*a42 - m04*a32 + m34*a02; + const RT m035 = m03*a52 - m05*a32 + m35*a02; + const RT m045 = m04*a52 - m05*a42 + m45*a02; + const RT m123 = m12*a32 - m13*a22 + m23*a12; + const RT m124 = m12*a42 - m14*a22 + m24*a12; + const RT m125 = m12*a52 - m15*a22 + m25*a12; + const RT m134 = m13*a42 - m14*a32 + m34*a12; + const RT m135 = m13*a52 - m15*a32 + m35*a12; + const RT m145 = m14*a52 - m15*a42 + m45*a12; + const RT m234 = m23*a42 - m24*a32 + m34*a22; + const RT m235 = m23*a52 - m25*a32 + m35*a22; + const RT m245 = m24*a52 - m25*a42 + m45*a22; + const RT m345 = m34*a52 - m35*a42 + m45*a32; +// Now compute the minors of rank 4 + const RT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + const RT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + const RT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + const RT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + const RT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + const RT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + const RT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + const RT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + const RT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + const RT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + const RT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + const RT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + const RT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + const RT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + const RT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; +// Now compute the minors of rank 5 + const RT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + const RT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + const RT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + const RT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + const RT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + const RT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; +// Now compute the minors of rank 6 + const RT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + + m02345*a15 - m12345*a05; + return m012345; } -inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { - double pq0; - pq0 = (q0 - p0); - double pq1; - pq1 = (q1 - p1); - double pq2; - pq2 = (q2 - p2); - double pq3; - pq3 = (q3 - p3); - double pq4; - pq4 = (q4 - p4); - double pr0; - pr0 = (r0 - p0); - double pr1; - pr1 = (r1 - p1); - double pr2; - pr2 = (r2 - p2); - double pr3; - pr3 = (r3 - p3); - double pr4; - pr4 = (r4 - p4); - double ps0; - ps0 = (s0 - p0); - double ps1; - ps1 = (s1 - p1); - double ps2; - ps2 = (s2 - p2); - double ps3; - ps3 = (s3 - p3); - double ps4; - ps4 = (s4 - p4); - double pt0; - pt0 = (t0 - p0); - double pt1; - pt1 = (t1 - p1); - double pt2; - pt2 = (t2 - p2); - double pt3; - pt3 = (t3 - p3); - double pt4; - pt4 = (t4 - p4); - double pu0; - pu0 = (t0 - p0); - double pu1; - pu1 = (u1 - p1); - double pu2; - pu2 = (u2 - p2); - double pu3; - pu3 = (u3 - p3); - double pu4; - pu4 = (u4 - p4); - double det; - det = determinant( pq0, pq1, pq2, pq3, pq4, pr0, pr1, pr2, pr3, pr4, ps0, ps1, ps2, ps3, ps4, pt0, pt1, pt2, pt3, pt4, pu0, pu1, pu2, pu3, pu4 ); - int int_tmp_result; - double eps; - double max1 = fabs(pq0); - if( (max1 < fabs(pr0)) ) - { - max1 = fabs(pr0); - } - if( (max1 < fabs(ps0)) ) - { - max1 = fabs(ps0); - } - if( (max1 < fabs(pt0)) ) - { - max1 = fabs(pt0); - } - if( (max1 < fabs(pu0)) ) - { - max1 = fabs(pu0); - } - double max2 = fabs(pq1); - if( (max2 < fabs(pr1)) ) - { - max2 = fabs(pr1); - } - if( (max2 < fabs(ps1)) ) - { - max2 = fabs(ps1); - } - if( (max2 < fabs(pt1)) ) - { - max2 = fabs(pt1); - } - if( (max2 < fabs(pu1)) ) - { - max2 = fabs(pu1); - } - double max3 = fabs(pq2); - if( (max3 < fabs(pr2)) ) - { - max3 = fabs(pr2); - } - if( (max3 < fabs(ps2)) ) - { - max3 = fabs(ps2); - } - if( (max3 < fabs(pt2)) ) - { - max3 = fabs(pt2); - } - if( (max3 < fabs(pu2)) ) - { - max3 = fabs(pu2); - } - double max4 = fabs(pq3); - if( (max4 < fabs(pr3)) ) - { - max4 = fabs(pr3); - } - if( (max4 < fabs(ps3)) ) - { - max4 = fabs(ps3); - } - if( (max4 < fabs(pt3)) ) - { - max4 = fabs(pt3); - } - if( (max4 < fabs(pu3)) ) - { - max4 = fabs(pu3); - } - double max5 = fabs(pq4); - if( (max5 < fabs(pr4)) ) - { - max5 = fabs(pr4); - } - if( (max5 < fabs(ps4)) ) - { - max5 = fabs(ps4); - } - if( (max5 < fabs(pt4)) ) - { - max5 = fabs(pt4); - } - if( (max5 < fabs(pu4)) ) - { - max5 = fabs(pu4); - } - double lower_bound_1; - double upper_bound_1; - lower_bound_1 = max5; - upper_bound_1 = max5; - if( (max1 < lower_bound_1) ) - { - lower_bound_1 = max1; - } - else - { - if( (max1 > upper_bound_1) ) - { - upper_bound_1 = max1; - } - } - if( (max2 < lower_bound_1) ) - { - lower_bound_1 = max2; - } - else - { - if( (max2 > upper_bound_1) ) - { - upper_bound_1 = max2; - } - } - if( (max3 < lower_bound_1) ) - { - lower_bound_1 = max3; - } - else - { - if( (max3 > upper_bound_1) ) - { - upper_bound_1 = max3; - } - } - if( (max4 < lower_bound_1) ) - { - lower_bound_1 = max4; - } - else - { - if( (max4 > upper_bound_1) ) - { - upper_bound_1 = max4; - } - } - if( (lower_bound_1 < 9.99657131447050328602e-60) ) - { - return FPG_UNCERTAIN_VALUE; - } - else - { - if( (upper_bound_1 > 3.21387608851797912384e+60) ) - { - return FPG_UNCERTAIN_VALUE; - } - eps = (2.22889232457534740153e-13 * ((((max1 * max2) * max3) * max4) * max5)); - if( (det > eps) ) - { - int_tmp_result = 1; - } - else - { - if( (det < -eps) ) - { - int_tmp_result = -1; - } - else - { - return FPG_UNCERTAIN_VALUE; - } - } - } - return int_tmp_result; + +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, + double q0, double q1, double q2, double q3, double q4, + double r0, double r1, double r2, double r3, double r4, + double s0, double s1, double s2, double s3, double s4, + double t0, double t1, double t2, double t3, double t4, + double u0, double u1, double u2, double u3, double u4) +{ + RT det = determinant_with_1_in_row_0(p0, p1, p2, p3, p4, + q0, q1, q2, q3, q4, + r0, r1, r2, r3, r4, + s0, s1, s2, s3, s4, + t0, t1, t2, t3, t4, + u0, u1, u2, u3, u4); + if (det > 0) return 1; + if (det < 0) return -1; + return 0; } From 1c07d4c3b49124ac78e0bbf77479c6c07a2668c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 23 Apr 2025 14:55:29 +0200 Subject: [PATCH 020/145] FPG generated version --- .../include/CGAL/NewKernel_d/orientationC5.h | 549 +++++++++++++++--- 1 file changed, 457 insertions(+), 92 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index 295b9698ec2..6433d905b4f 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -10,100 +10,465 @@ // // Author(s) : Andreas Fabri -typedef double RT; -RT -determinant_with_1_in_row_0( - RT a01, RT a02, RT a03, RT a04, RT a05, - RT a11, RT a12, RT a13, RT a14, RT a15, - RT a21, RT a22, RT a23, RT a24, RT a25, - RT a31, RT a32, RT a33, RT a34, RT a35, - RT a41, RT a42, RT a43, RT a44, RT a45, - RT a51, RT a52, RT a53, RT a54, RT a55) -{ -// First compute the det2x2 - const RT m01 = a11 - a01; - const RT m02 = a21 - a01; - const RT m03 = a31 - a01; - const RT m04 = a41 - a01; - const RT m05 = a51 - a01; - const RT m12 = a21 - a11; - const RT m13 = a31 - a11; - const RT m14 = a41 - a11; - const RT m15 = a51 - a11; - const RT m23 = a31 - a21; - const RT m24 = a41 - a21; - const RT m25 = a51 - a21; - const RT m34 = a41 - a31; - const RT m35 = a51 - a31; - const RT m45 = a51 - a41; -// Now compute the minors of rank 3 - const RT m012 = m01*a22 - m02*a12 + m12*a02; - const RT m013 = m01*a32 - m03*a12 + m13*a02; - const RT m014 = m01*a42 - m04*a12 + m14*a02; - const RT m015 = m01*a52 - m05*a12 + m15*a02; - const RT m023 = m02*a32 - m03*a22 + m23*a02; - const RT m024 = m02*a42 - m04*a22 + m24*a02; - const RT m025 = m02*a52 - m05*a22 + m25*a02; - const RT m034 = m03*a42 - m04*a32 + m34*a02; - const RT m035 = m03*a52 - m05*a32 + m35*a02; - const RT m045 = m04*a52 - m05*a42 + m45*a02; - const RT m123 = m12*a32 - m13*a22 + m23*a12; - const RT m124 = m12*a42 - m14*a22 + m24*a12; - const RT m125 = m12*a52 - m15*a22 + m25*a12; - const RT m134 = m13*a42 - m14*a32 + m34*a12; - const RT m135 = m13*a52 - m15*a32 + m35*a12; - const RT m145 = m14*a52 - m15*a42 + m45*a12; - const RT m234 = m23*a42 - m24*a32 + m34*a22; - const RT m235 = m23*a52 - m25*a32 + m35*a22; - const RT m245 = m24*a52 - m25*a42 + m45*a22; - const RT m345 = m34*a52 - m35*a42 + m45*a32; -// Now compute the minors of rank 4 - const RT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; - const RT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; - const RT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; - const RT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; - const RT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; - const RT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; - const RT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; - const RT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; - const RT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; - const RT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; - const RT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; - const RT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; - const RT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; - const RT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; - const RT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; -// Now compute the minors of rank 5 - const RT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; - const RT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; - const RT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; - const RT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; - const RT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; - const RT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; -// Now compute the minors of rank 6 - const RT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 - + m02345*a15 - m12345*a05; - return m012345; +inline double determinant_with_1_in_row_0( double a01, double a02, double a03, double a04, double a05, double a11, double a12, double a13, double a14, double a15, double a21, double a22, double a23, double a24, double a25, double a31, double a32, double a33, double a34, double a35, double a41, double a42, double a43, double a44, double a45, double a51, double a52, double a53, double a54, double a55) { + double m01; + m01 = (a11 - a01); + double m02; + m02 = (a21 - a01); + double m03; + m03 = (a31 - a01); + double m04; + m04 = (a41 - a01); + double m05; + m05 = (a51 - a01); + double m12; + m12 = (a21 - a11); + double m13; + m13 = (a31 - a11); + double m14; + m14 = (a41 - a11); + double m15; + m15 = (a51 - a11); + double m23; + m23 = (a31 - a21); + double m24; + m24 = (a41 - a21); + double m25; + m25 = (a51 - a21); + double m34; + m34 = (a41 - a31); + double m35; + m35 = (a51 - a31); + double m45; + m45 = (a51 - a41); + double m012; + m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); + double m013; + m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); + double m014; + m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); + double m015; + m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); + double m023; + m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); + double m024; + m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); + double m025; + m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); + double m034; + m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); + double m035; + m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); + double m045; + m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); + double m123; + m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); + double m124; + m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); + double m125; + m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); + double m134; + m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); + double m135; + m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); + double m145; + m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); + double m234; + m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); + double m235; + m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); + double m245; + m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); + double m345; + m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); + double m0123; + m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); + double m0124; + m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); + double m0125; + m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); + double m0134; + m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); + double m0135; + m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); + double m0145; + m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); + double m0234; + m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); + double m0235; + m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); + double m0245; + m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); + double m0345; + m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); + double m1234; + m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); + double m1235; + m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); + double m1245; + m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); + double m1345; + m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); + double m2345; + m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); + double m01234; + m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); + double m01235; + m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); + double m01245; + m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); + double m01345; + m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); + double m02345; + m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); + double m12345; + m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); + double m012345; + m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); + return m012345; +} + + +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { + double det; + double determinant_with_1_in_row_0_return_value; + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m12; + m12 = (r0 - q0); + double m13; + m13 = (s0 - q0); + double m14; + m14 = (t0 - q0); + double m15; + m15 = (u0 - q0); + double m23; + m23 = (s0 - r0); + double m24; + m24 = (t0 - r0); + double m25; + m25 = (u0 - r0); + double m34; + m34 = (t0 - s0); + double m35; + m35 = (u0 - s0); + double m45; + m45 = (u0 - t0); + double m012; + m012 = (((m01 * r1) - (m02 * q1)) + (m12 * p1)); + double m013; + m013 = (((m01 * s1) - (m03 * q1)) + (m13 * p1)); + double m014; + m014 = (((m01 * t1) - (m04 * q1)) + (m14 * p1)); + double m015; + m015 = (((m01 * u1) - (m05 * q1)) + (m15 * p1)); + double m023; + m023 = (((m02 * s1) - (m03 * r1)) + (m23 * p1)); + double m024; + m024 = (((m02 * t1) - (m04 * r1)) + (m24 * p1)); + double m025; + m025 = (((m02 * u1) - (m05 * r1)) + (m25 * p1)); + double m034; + m034 = (((m03 * t1) - (m04 * s1)) + (m34 * p1)); + double m035; + m035 = (((m03 * u1) - (m05 * s1)) + (m35 * p1)); + double m045; + m045 = (((m04 * u1) - (m05 * t1)) + (m45 * p1)); + double m123; + m123 = (((m12 * s1) - (m13 * r1)) + (m23 * q1)); + double m124; + m124 = (((m12 * t1) - (m14 * r1)) + (m24 * q1)); + double m125; + m125 = (((m12 * u1) - (m15 * r1)) + (m25 * q1)); + double m134; + m134 = (((m13 * t1) - (m14 * s1)) + (m34 * q1)); + double m135; + m135 = (((m13 * u1) - (m15 * s1)) + (m35 * q1)); + double m145; + m145 = (((m14 * u1) - (m15 * t1)) + (m45 * q1)); + double m234; + m234 = (((m23 * t1) - (m24 * s1)) + (m34 * r1)); + double m235; + m235 = (((m23 * u1) - (m25 * s1)) + (m35 * r1)); + double m245; + m245 = (((m24 * u1) - (m25 * t1)) + (m45 * r1)); + double m345; + m345 = (((m34 * u1) - (m35 * t1)) + (m45 * s1)); + double m0123; + m0123 = ((((m012 * s2) - (m013 * r2)) + (m023 * q2)) - (m123 * p2)); + double m0124; + m0124 = ((((m012 * t2) - (m014 * r2)) + (m024 * q2)) - (m124 * p2)); + double m0125; + m0125 = ((((m012 * u2) - (m015 * r2)) + (m025 * q2)) - (m125 * p2)); + double m0134; + m0134 = ((((m013 * t2) - (m014 * s2)) + (m034 * q2)) - (m134 * p2)); + double m0135; + m0135 = ((((m013 * u2) - (m015 * s2)) + (m035 * q2)) - (m135 * p2)); + double m0145; + m0145 = ((((m014 * u2) - (m015 * t2)) + (m045 * q2)) - (m145 * p2)); + double m0234; + m0234 = ((((m023 * t2) - (m024 * s2)) + (m034 * r2)) - (m234 * p2)); + double m0235; + m0235 = ((((m023 * u2) - (m025 * s2)) + (m035 * r2)) - (m235 * p2)); + double m0245; + m0245 = ((((m024 * u2) - (m025 * t2)) + (m045 * r2)) - (m245 * p2)); + double m0345; + m0345 = ((((m034 * u2) - (m035 * t2)) + (m045 * s2)) - (m345 * p2)); + double m1234; + m1234 = ((((m123 * t2) - (m124 * s2)) + (m134 * r2)) - (m234 * q2)); + double m1235; + m1235 = ((((m123 * u2) - (m125 * s2)) + (m135 * r2)) - (m235 * q2)); + double m1245; + m1245 = ((((m124 * u2) - (m125 * t2)) + (m145 * r2)) - (m245 * q2)); + double m1345; + m1345 = ((((m134 * u2) - (m135 * t2)) + (m145 * s2)) - (m345 * q2)); + double m2345; + m2345 = ((((m234 * u2) - (m235 * t2)) + (m245 * s2)) - (m345 * r2)); + double m01234; + m01234 = (((((m0123 * t3) - (m0124 * s3)) + (m0134 * r3)) - (m0234 * q3)) + (m1234 * p3)); + double m01235; + m01235 = (((((m0123 * u3) - (m0125 * s3)) + (m0135 * r3)) - (m0235 * q3)) + (m1235 * p3)); + double m01245; + m01245 = (((((m0124 * u3) - (m0125 * t3)) + (m0145 * r3)) - (m0245 * q3)) + (m1245 * p3)); + double m01345; + m01345 = (((((m0134 * u3) - (m0135 * t3)) + (m0145 * s3)) - (m0345 * q3)) + (m1345 * p3)); + double m02345; + m02345 = (((((m0234 * u3) - (m0235 * t3)) + (m0245 * s3)) - (m0345 * r3)) + (m2345 * p3)); + double m12345; + m12345 = (((((m1234 * u3) - (m1235 * t3)) + (m1245 * s3)) - (m1345 * r3)) + (m2345 * q3)); + double m012345; + m012345 = ((((((m01234 * u4) - (m01235 * t4)) + (m01245 * s4)) - (m01345 * r4)) + (m02345 * q4)) - (m12345 * p4)); + determinant_with_1_in_row_0_return_value = m012345; + det = determinant_with_1_in_row_0_return_value; + int int_tmp_result; + double eps; + double max1 = fabs(p1); + if( (max1 < fabs(q1)) ) + { + max1 = fabs(q1); + } + if( (max1 < fabs(r1)) ) + { + max1 = fabs(r1); + } + if( (max1 < fabs(s1)) ) + { + max1 = fabs(s1); + } + if( (max1 < fabs(t1)) ) + { + max1 = fabs(t1); + } + if( (max1 < fabs(u1)) ) + { + max1 = fabs(u1); + } + double max2 = fabs(p2); + if( (max2 < fabs(q2)) ) + { + max2 = fabs(q2); + } + if( (max2 < fabs(r2)) ) + { + max2 = fabs(r2); + } + if( (max2 < fabs(s2)) ) + { + max2 = fabs(s2); + } + if( (max2 < fabs(t2)) ) + { + max2 = fabs(t2); + } + if( (max2 < fabs(u2)) ) + { + max2 = fabs(u2); + } + double max3 = fabs(p3); + if( (max3 < fabs(q3)) ) + { + max3 = fabs(q3); + } + if( (max3 < fabs(r3)) ) + { + max3 = fabs(r3); + } + if( (max3 < fabs(s3)) ) + { + max3 = fabs(s3); + } + if( (max3 < fabs(t3)) ) + { + max3 = fabs(t3); + } + if( (max3 < fabs(u3)) ) + { + max3 = fabs(u3); + } + double max4 = fabs(p4); + if( (max4 < fabs(q4)) ) + { + max4 = fabs(q4); + } + if( (max4 < fabs(r4)) ) + { + max4 = fabs(r4); + } + if( (max4 < fabs(s4)) ) + { + max4 = fabs(s4); + } + if( (max4 < fabs(t4)) ) + { + max4 = fabs(t4); + } + if( (max4 < fabs(u4)) ) + { + max4 = fabs(u4); + } + double max5 = fabs(m01); + if( (max5 < fabs(m05)) ) + { + max5 = fabs(m05); + } + if( (max5 < fabs(m04)) ) + { + max5 = fabs(m04); + } + if( (max5 < fabs(m03)) ) + { + max5 = fabs(m03); + } + if( (max5 < fabs(m02)) ) + { + max5 = fabs(m02); + } + if( (max5 < fabs(m15)) ) + { + max5 = fabs(m15); + } + if( (max5 < fabs(m14)) ) + { + max5 = fabs(m14); + } + if( (max5 < fabs(m13)) ) + { + max5 = fabs(m13); + } + if( (max5 < fabs(m12)) ) + { + max5 = fabs(m12); + } + if( (max5 < fabs(m34)) ) + { + max5 = fabs(m34); + } + if( (max5 < fabs(m25)) ) + { + max5 = fabs(m25); + } + if( (max5 < fabs(m24)) ) + { + max5 = fabs(m24); + } + if( (max5 < fabs(m23)) ) + { + max5 = fabs(m23); + } + if( (max5 < fabs(m45)) ) + { + max5 = fabs(m45); + } + if( (max5 < fabs(m35)) ) + { + max5 = fabs(m35); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 8.19482853969781542511e-60) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (6.02067348555779570000e-13 * ((((max5 * max1) * max2) * max3) * max4)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; } -inline int orientationC5( double p0, double p1, double p2, double p3, double p4, - double q0, double q1, double q2, double q3, double q4, - double r0, double r1, double r2, double r3, double r4, - double s0, double s1, double s2, double s3, double s4, - double t0, double t1, double t2, double t3, double t4, - double u0, double u1, double u2, double u3, double u4) -{ - RT det = determinant_with_1_in_row_0(p0, p1, p2, p3, p4, - q0, q1, q2, q3, q4, - r0, r1, r2, r3, r4, - s0, s1, s2, s3, s4, - t0, t1, t2, t3, t4, - u0, u1, u2, u3, u4); - if (det > 0) return 1; - if (det < 0) return -1; - return 0; -} - From 23526e4c3bd27d646834f814cf9ebde5d090bdf3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 14:23:54 +0100 Subject: [PATCH 021/145] Static filter works but is slower than unfiltered :< --- .../internal/Static_filters/Orientation_5.h | 518 +++++++++++------- 1 file changed, 319 insertions(+), 199 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index 0a19e729751..0ddf9dfb364 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -19,6 +19,8 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { + + template < typename K_base > class Orientation_5 : public K_base::Orientation_5 @@ -35,8 +37,6 @@ public: const Point_5 &r, const Point_5 &s, const Point_5 &t, const Point_5 &u) const { - - // return Base::operator()(p, q, r, s, t, u); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_5", tmp); double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4; @@ -60,222 +60,342 @@ public: fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && fit_in_double(u.c4(), u4)) { - Orientation should_be = Base::operator()(p, q, r, s, t, u); - double pq0; - pq0 = (q0 - p0); - double pq1; - pq1 = (q1 - p1); - double pq2; - pq2 = (q2 - p2); - double pq3; - pq3 = (q3 - p3); - double pq4; - pq4 = (q4 - p4); - double pr0; - pr0 = (r0 - p0); - double pr1; - pr1 = (r1 - p1); - double pr2; - pr2 = (r2 - p2); - double pr3; - pr3 = (r3 - p3); - double pr4; - pr4 = (r4 - p4); - double ps0; - ps0 = (s0 - p0); - double ps1; - ps1 = (s1 - p1); - double ps2; - ps2 = (s2 - p2); - double ps3; - ps3 = (s3 - p3); - double ps4; - ps4 = (s4 - p4); - double pt0; - pt0 = (t0 - p0); - double pt1; - pt1 = (t1 - p1); - double pt2; - pt2 = (t2 - p2); - double pt3; - pt3 = (t3 - p3); - double pt4; - pt4 = (t4 - p4); - double pu0; - pu0 = (t0 - p0); - double pu1; - pu1 = (u1 - p1); - double pu2; - pu2 = (u2 - p2); - double pu3; - pu3 = (u3 - p3); - double pu4; - pu4 = (u4 - p4); + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u)); double det; - det = determinant( pq0, pq1, pq2, pq3, pq4, pr0, pr1, pr2, pr3, pr4, ps0, ps1, ps2, ps3, ps4, pt0, pt1, pt2, pt3, pt4, pu0, pu1, pu2, pu3, pu4 ); - Orientation result = ZERO; - double eps; - double max1 = CGAL::abs(pq0); - if( (max1 < CGAL::abs(pr0)) ) + double determinant_with_1_in_row_0_return_value; + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m12; + m12 = (r0 - q0); + double m13; + m13 = (s0 - q0); + double m14; + m14 = (t0 - q0); + double m15; + m15 = (u0 - q0); + double m23; + m23 = (s0 - r0); + double m24; + m24 = (t0 - r0); + double m25; + m25 = (u0 - r0); + double m34; + m34 = (t0 - s0); + double m35; + m35 = (u0 - s0); + double m45; + m45 = (u0 - t0); + double m012; + m012 = (((m01 * r1) - (m02 * q1)) + (m12 * p1)); + double m013; + m013 = (((m01 * s1) - (m03 * q1)) + (m13 * p1)); + double m014; + m014 = (((m01 * t1) - (m04 * q1)) + (m14 * p1)); + double m015; + m015 = (((m01 * u1) - (m05 * q1)) + (m15 * p1)); + double m023; + m023 = (((m02 * s1) - (m03 * r1)) + (m23 * p1)); + double m024; + m024 = (((m02 * t1) - (m04 * r1)) + (m24 * p1)); + double m025; + m025 = (((m02 * u1) - (m05 * r1)) + (m25 * p1)); + double m034; + m034 = (((m03 * t1) - (m04 * s1)) + (m34 * p1)); + double m035; + m035 = (((m03 * u1) - (m05 * s1)) + (m35 * p1)); + double m045; + m045 = (((m04 * u1) - (m05 * t1)) + (m45 * p1)); + double m123; + m123 = (((m12 * s1) - (m13 * r1)) + (m23 * q1)); + double m124; + m124 = (((m12 * t1) - (m14 * r1)) + (m24 * q1)); + double m125; + m125 = (((m12 * u1) - (m15 * r1)) + (m25 * q1)); + double m134; + m134 = (((m13 * t1) - (m14 * s1)) + (m34 * q1)); + double m135; + m135 = (((m13 * u1) - (m15 * s1)) + (m35 * q1)); + double m145; + m145 = (((m14 * u1) - (m15 * t1)) + (m45 * q1)); + double m234; + m234 = (((m23 * t1) - (m24 * s1)) + (m34 * r1)); + double m235; + m235 = (((m23 * u1) - (m25 * s1)) + (m35 * r1)); + double m245; + m245 = (((m24 * u1) - (m25 * t1)) + (m45 * r1)); + double m345; + m345 = (((m34 * u1) - (m35 * t1)) + (m45 * s1)); + double m0123; + m0123 = ((((m012 * s2) - (m013 * r2)) + (m023 * q2)) - (m123 * p2)); + double m0124; + m0124 = ((((m012 * t2) - (m014 * r2)) + (m024 * q2)) - (m124 * p2)); + double m0125; + m0125 = ((((m012 * u2) - (m015 * r2)) + (m025 * q2)) - (m125 * p2)); + double m0134; + m0134 = ((((m013 * t2) - (m014 * s2)) + (m034 * q2)) - (m134 * p2)); + double m0135; + m0135 = ((((m013 * u2) - (m015 * s2)) + (m035 * q2)) - (m135 * p2)); + double m0145; + m0145 = ((((m014 * u2) - (m015 * t2)) + (m045 * q2)) - (m145 * p2)); + double m0234; + m0234 = ((((m023 * t2) - (m024 * s2)) + (m034 * r2)) - (m234 * p2)); + double m0235; + m0235 = ((((m023 * u2) - (m025 * s2)) + (m035 * r2)) - (m235 * p2)); + double m0245; + m0245 = ((((m024 * u2) - (m025 * t2)) + (m045 * r2)) - (m245 * p2)); + double m0345; + m0345 = ((((m034 * u2) - (m035 * t2)) + (m045 * s2)) - (m345 * p2)); + double m1234; + m1234 = ((((m123 * t2) - (m124 * s2)) + (m134 * r2)) - (m234 * q2)); + double m1235; + m1235 = ((((m123 * u2) - (m125 * s2)) + (m135 * r2)) - (m235 * q2)); + double m1245; + m1245 = ((((m124 * u2) - (m125 * t2)) + (m145 * r2)) - (m245 * q2)); + double m1345; + m1345 = ((((m134 * u2) - (m135 * t2)) + (m145 * s2)) - (m345 * q2)); + double m2345; + m2345 = ((((m234 * u2) - (m235 * t2)) + (m245 * s2)) - (m345 * r2)); + double m01234; + m01234 = (((((m0123 * t3) - (m0124 * s3)) + (m0134 * r3)) - (m0234 * q3)) + (m1234 * p3)); + double m01235; + m01235 = (((((m0123 * u3) - (m0125 * s3)) + (m0135 * r3)) - (m0235 * q3)) + (m1235 * p3)); + double m01245; + m01245 = (((((m0124 * u3) - (m0125 * t3)) + (m0145 * r3)) - (m0245 * q3)) + (m1245 * p3)); + double m01345; + m01345 = (((((m0134 * u3) - (m0135 * t3)) + (m0145 * s3)) - (m0345 * q3)) + (m1345 * p3)); + double m02345; + m02345 = (((((m0234 * u3) - (m0235 * t3)) + (m0245 * s3)) - (m0345 * r3)) + (m2345 * p3)); + double m12345; + m12345 = (((((m1234 * u3) - (m1235 * t3)) + (m1245 * s3)) - (m1345 * r3)) + (m2345 * q3)); + double m012345; + m012345 = ((((((m01234 * u4) - (m01235 * t4)) + (m01245 * s4)) - (m01345 * r4)) + (m02345 * q4)) - (m12345 * p4)); + determinant_with_1_in_row_0_return_value = m012345; + det = determinant_with_1_in_row_0_return_value; + double eps; + double max1 = CGAL::abs(p1); + if( (max1 < CGAL::abs(q1)) ) + { + max1 = CGAL::abs(q1); + } + if( (max1 < CGAL::abs(r1)) ) + { + max1 = CGAL::abs(r1); + } + if( (max1 < CGAL::abs(s1)) ) + { + max1 = CGAL::abs(s1); + } + if( (max1 < CGAL::abs(t1)) ) + { + max1 = CGAL::abs(t1); + } + if( (max1 < CGAL::abs(u1)) ) + { + max1 = CGAL::abs(u1); + } + double max2 = CGAL::abs(p2); + if( (max2 < CGAL::abs(q2)) ) + { + max2 = CGAL::abs(q2); + } + if( (max2 < CGAL::abs(r2)) ) + { + max2 = CGAL::abs(r2); + } + if( (max2 < CGAL::abs(s2)) ) + { + max2 = CGAL::abs(s2); + } + if( (max2 < CGAL::abs(t2)) ) + { + max2 = CGAL::abs(t2); + } + if( (max2 < CGAL::abs(u2)) ) + { + max2 = CGAL::abs(u2); + } + double max3 = CGAL::abs(p3); + if( (max3 < CGAL::abs(q3)) ) + { + max3 = CGAL::abs(q3); + } + if( (max3 < CGAL::abs(r3)) ) + { + max3 = CGAL::abs(r3); + } + if( (max3 < CGAL::abs(s3)) ) + { + max3 = CGAL::abs(s3); + } + if( (max3 < CGAL::abs(t3)) ) + { + max3 = CGAL::abs(t3); + } + if( (max3 < CGAL::abs(u3)) ) + { + max3 = CGAL::abs(u3); + } + double max4 = CGAL::abs(p4); + if( (max4 < CGAL::abs(q4)) ) + { + max4 = CGAL::abs(q4); + } + if( (max4 < CGAL::abs(r4)) ) + { + max4 = CGAL::abs(r4); + } + if( (max4 < CGAL::abs(s4)) ) + { + max4 = CGAL::abs(s4); + } + if( (max4 < CGAL::abs(t4)) ) + { + max4 = CGAL::abs(t4); + } + if( (max4 < CGAL::abs(u4)) ) + { + max4 = CGAL::abs(u4); + } + double max5 = CGAL::abs(m01); + if( (max5 < CGAL::abs(m05)) ) + { + max5 = CGAL::abs(m05); + } + if( (max5 < CGAL::abs(m04)) ) + { + max5 = CGAL::abs(m04); + } + if( (max5 < CGAL::abs(m03)) ) + { + max5 = CGAL::abs(m03); + } + if( (max5 < CGAL::abs(m02)) ) + { + max5 = CGAL::abs(m02); + } + if( (max5 < CGAL::abs(m15)) ) + { + max5 = CGAL::abs(m15); + } + if( (max5 < CGAL::abs(m14)) ) + { + max5 = CGAL::abs(m14); + } + if( (max5 < CGAL::abs(m13)) ) + { + max5 = CGAL::abs(m13); + } + if( (max5 < CGAL::abs(m12)) ) + { + max5 = CGAL::abs(m12); + } + if( (max5 < CGAL::abs(m34)) ) + { + max5 = CGAL::abs(m34); + } + if( (max5 < CGAL::abs(m25)) ) + { + max5 = CGAL::abs(m25); + } + if( (max5 < CGAL::abs(m24)) ) + { + max5 = CGAL::abs(m24); + } + if( (max5 < CGAL::abs(m23)) ) + { + max5 = CGAL::abs(m23); + } + if( (max5 < CGAL::abs(m45)) ) + { + max5 = CGAL::abs(m45); + } + if( (max5 < CGAL::abs(m35)) ) + { + max5 = CGAL::abs(m35); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max5; + upper_bound_1 = max5; + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) { - max1 = CGAL::abs(pr0); + upper_bound_1 = max1; } - if( (max1 < CGAL::abs(ps0)) ) + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) { - max1 = CGAL::abs(ps0); + upper_bound_1 = max2; } - if( (max1 < CGAL::abs(pt0)) ) + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) { - max1 = CGAL::abs(pt0); + upper_bound_1 = max3; } - if( (max1 < CGAL::abs(pu0)) ) + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) { - max1 = CGAL::abs(pu0); + upper_bound_1 = max4; } - double max2 = CGAL::abs(pq1); - if( (max2 < CGAL::abs(pr1)) ) - { - max2 = CGAL::abs(pr1); - } - if( (max2 < CGAL::abs(ps1)) ) - { - max2 = CGAL::abs(ps1); - } - if( (max2 < CGAL::abs(pt1)) ) - { - max2 = CGAL::abs(pt1); - } - if( (max2 < CGAL::abs(pu1)) ) - { - max2 = CGAL::abs(pu1); - } - double max3 = CGAL::abs(pq2); - if( (max3 < CGAL::abs(pr2)) ) - { - max3 = CGAL::abs(pr2); - } - if( (max3 < CGAL::abs(ps2)) ) - { - max3 = CGAL::abs(ps2); - } - if( (max3 < CGAL::abs(pt2)) ) - { - max3 = CGAL::abs(pt2); - } - if( (max3 < CGAL::abs(pu2)) ) - { - max3 = CGAL::abs(pu2); - } - double max4 = CGAL::abs(pq3); - if( (max4 < CGAL::abs(pr3)) ) - { - max4 = CGAL::abs(pr3); - } - if( (max4 < CGAL::abs(ps3)) ) - { - max4 = CGAL::abs(ps3); - } - if( (max4 < CGAL::abs(pt3)) ) - { - max4 = CGAL::abs(pt3); - } - if( (max4 < CGAL::abs(pu3)) ) - { - max4 = CGAL::abs(pu3); - } - double max5 = CGAL::abs(pq4); - if( (max5 < CGAL::abs(pr4)) ) - { - max5 = CGAL::abs(pr4); - } - if( (max5 < CGAL::abs(ps4)) ) - { - max5 = CGAL::abs(ps4); - } - if( (max5 < CGAL::abs(pt4)) ) - { - max5 = CGAL::abs(pt4); - } - if( (max5 < CGAL::abs(pu4)) ) - { - max5 = CGAL::abs(pu4); - } - double lower_bound_1; - double upper_bound_1; - lower_bound_1 = max5; - upper_bound_1 = max5; - if( (max1 < lower_bound_1) ) - { - lower_bound_1 = max1; - } - else - { - if( (max1 > upper_bound_1) ) - { - upper_bound_1 = max1; - } - } - if( (max2 < lower_bound_1) ) - { - lower_bound_1 = max2; - } - else - { - if( (max2 > upper_bound_1) ) - { - upper_bound_1 = max2; - } - } - if( (max3 < lower_bound_1) ) - { - lower_bound_1 = max3; - } - else - { - if( (max3 > upper_bound_1) ) - { - upper_bound_1 = max3; - } - } - if( (max4 < lower_bound_1) ) - { - lower_bound_1 = max4; - } - else - { - if( (max4 > upper_bound_1) ) - { - upper_bound_1 = max4; - } - } - if( (lower_bound_1 < 9.99657131447050328602e-60) ) + } + if( (lower_bound_1 < 8.19482853969781542511e-60) ) + { + return Base::operator()(p, q, r, s, t, u); + } + else + { + if( (upper_bound_1 > 3.21387608851797912384e+60) ) { return Base::operator()(p, q, r, s, t, u); } + eps = (6.02067348555779570000e-13 * ((((max5 * max1) * max2) * max3) * max4)); + if( (det > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } else { - if( (upper_bound_1 > 3.21387608851797912384e+60) ) - { - return Base::operator()(p, q, r, s, t, u); - } - eps = (2.22889232457534740153e-13 * ((((max1 * max2) * max3) * max4) * max5)); - if( (det > eps) ) - { - if(should_be != POSITIVE){ - std::cout << "result should not be POSITIVE" << std::endl; - } - return POSITIVE; - } - if( (det < -eps) ) { - if(should_be != NEGATIVE){ - std::cout << "result should not be NEGATIVE" << std::endl; - } + CGAL_assertion(should_be == NEGATIVE); return NEGATIVE; } + } - } + } + } return Base::operator()(p, q, r, s, t, u); } From 41ecef0fa3a87972b5acb04fe78af163204e2373 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 14:51:31 +0100 Subject: [PATCH 022/145] Add macro for disabling filtering CGAL_NO_STATIC_FILTER_5 --- .../include/CGAL/NewKernel_d/Cartesian_static_filters.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index 5ff54ab1450..160c3206276 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -244,7 +244,7 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { }; }; - +#ifndef CGAL_NO_STATIC_FILTER_5 template struct Cartesian_static_filters, R_, Derived_> : public R_ { constexpr Cartesian_static_filters(){} @@ -256,5 +256,6 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { typedef SFA::Orientation_of_points_5 type; }; }; +#endif } // namespace CGAL #endif From 0e61fdc8e18c3d1f599729c21fa27702104d9e92 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 15:44:20 +0100 Subject: [PATCH 023/145] vector for visited cells --- .../include/CGAL/Triangulation_data_structure.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index c93ddb76507..507ae9fd0b1 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -138,7 +138,7 @@ protected: // DATA MEMBERS int dmax_, dcur_; // dimension of the current triangulation Vertex_container vertices_; // list of all vertices Full_cell_container full_cells_; // list of all full cells - + mutable std::vector visited; private: void clean_dynamic_memory() @@ -667,8 +667,10 @@ Triangulation_data_structure TraversalPredicate & tp, OutputIterator & out) const /* Concept */ { + CGAL_precondition(visited.empty()); std::queue queue; set_visited(start, true); + visited.push_back(start); queue.push(start); const int cur_dim = current_dimension(); Facet ft; @@ -684,6 +686,7 @@ Triangulation_data_structure if( ! get_visited(n) ) { set_visited(n, true); + visited.push_back(n); if( tp(Facet(s, i)) ) queue.push(n); else @@ -691,7 +694,9 @@ Triangulation_data_structure } } } - clear_visited_marks(start); + for(auto fch : visited) + set_visited(fch, false); + visited.clear(); return ft; } From 9f07b04778e65b24f59dae13a9ef929d51b816b2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 17:41:25 +0100 Subject: [PATCH 024/145] Replace queue with stack> in insert_in_tagged_hole. static/data member would give even more speed --- Triangulation/include/CGAL/Triangulation_data_structure.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 507ae9fd0b1..130d8e4f2fd 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -30,6 +30,7 @@ #include #include #include +#include #include namespace CGAL { @@ -939,13 +940,13 @@ Triangulation_data_structure const int cur_dim = current_dimension(); Full_cell_handle new_s; - std::queue task_queue; + std::stack> task_queue; task_queue.push( IITH_task(f, mirror_index(full_cell(f), index_of_covertex(f))) ); while (!task_queue.empty()) { - IITH_task task = task_queue.front(); + IITH_task task = task_queue.top(); task_queue.pop(); Full_cell_handle old_s = full_cell(task.boundary_facet); From d9c4f603ee8511579cd4247a4b029ba84c9003ce Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 17:47:47 +0100 Subject: [PATCH 025/145] const& --- .../include/CGAL/Triangulation_data_structure.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 130d8e4f2fd..dfd59e7b978 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -375,12 +375,12 @@ public: Vertex_handle insert_in_face(const Face &); /* Concept */ Vertex_handle insert_in_facet(const Facet &); /* Concept */ template< typename Forward_iterator > - Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet); /* Concept */ + Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&); /* Concept */ template< typename Forward_iterator, typename OutputIterator > - Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet, OutputIterator); /* Concept */ + Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&, OutputIterator); /* Concept */ template< typename OutputIterator > - Full_cell_handle insert_in_tagged_hole(Vertex_handle, Facet, OutputIterator); + Full_cell_handle insert_in_tagged_hole(Vertex_handle, const Facet&, OutputIterator); Vertex_handle insert_increase_dimension(Vertex_handle=Vertex_handle()); /* Concept */ @@ -932,7 +932,7 @@ template template < typename OutputIterator > typename Triangulation_data_structure::Full_cell_handle Triangulation_data_structure -::insert_in_tagged_hole(Vertex_handle v, Facet f, +::insert_in_tagged_hole(Vertex_handle v, const Facet& f, OutputIterator new_full_cells) { CGAL_assertion_msg(is_boundary_facet(f), "starting facet should be on the hole boundary"); @@ -1034,7 +1034,7 @@ template< class Dim, class Vb, class Fcb > template< typename Forward_iterator, typename OutputIterator > typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f, +::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f, OutputIterator out) /* Concept */ { CGAL_expensive_precondition( @@ -1053,7 +1053,7 @@ template< class Dim, class Vb, class Fcb > template< typename Forward_iterator > typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f) /* Concept */ +::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f) /* Concept */ { Emptyset_iterator out; return insert_in_hole(start, end, f, out); From f147e0f0cc623ada42de78cbb5a625dd2eae79a0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 23 Apr 2025 20:54:42 +0100 Subject: [PATCH 026/145] Use TDS_full_cell_mirror_storage_policy --- Triangulation/benchmark/Triangulation/bench5d.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Triangulation/benchmark/Triangulation/bench5d.cpp b/Triangulation/benchmark/Triangulation/bench5d.cpp index cadef41b096..2bf6fc90bfc 100644 --- a/Triangulation/benchmark/Triangulation/bench5d.cpp +++ b/Triangulation/benchmark/Triangulation/bench5d.cpp @@ -9,7 +9,13 @@ #include typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K; -typedef CGAL::Triangulation Triangulation; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; int main() From eef2bea7b1ad389465cd6f1829fa15b0499649b2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 08:11:39 +0100 Subject: [PATCH 027/145] Add doc for storage policies --- .../CGAL/TDS_full_cell_default_storage_policy.h | 10 ++++++++++ .../CGAL/TDS_full_cell_mirror_storage_policy.h | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h create mode 100644 Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h new file mode 100644 index 00000000000..b6ed9765723 --- /dev/null +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h @@ -0,0 +1,10 @@ + +namespace CGAL { + + /*! + \ingroup PkgTriangulationsRef + A tag class to indicate that mirror indices are not stored in full cells. + */ +class TDS_full_cell_mirror_storage_policy +{}; +} \ No newline at end of file diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h new file mode 100644 index 00000000000..6b4136dd777 --- /dev/null +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h @@ -0,0 +1,11 @@ + +namespace CGAL { + + /*! + \ingroup PkgTriangulationsRef + A tag class to indicate that mirror indices are stored in full cells. + \precondition The dimension is not larger than 127. + */ +class TDS_full_cell_mirror_storage_policy +{}; +} \ No newline at end of file From 90a376de1796deb54fc853f57155d4429466713b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 08:39:07 +0100 Subject: [PATCH 028/145] Add to package description --- Triangulation/doc/Triangulation/PackageDescription.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Triangulation/doc/Triangulation/PackageDescription.txt b/Triangulation/doc/Triangulation/PackageDescription.txt index 2ef98bf9d84..ac8983ce685 100644 --- a/Triangulation/doc/Triangulation/PackageDescription.txt +++ b/Triangulation/doc/Triangulation/PackageDescription.txt @@ -101,6 +101,8 @@ The latter two concepts are also abbreviated respectively as `TrVertex` and `TrF - `CGAL::Triangulation_ds_vertex` - `CGAL::Triangulation_ds_full_cell` - `CGAL::Triangulation_face` +- `CGAL::TDS_full_cell_default_storage_policy` +- `CGAL::TDS_full_cell_mirror_storage_policy` \cgalCRPSection{(Geometric) Triangulations} From 3d0a5e54a2106de1b571a25eae472c256554495c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 09:19:00 +0100 Subject: [PATCH 029/145] Add source of Orientation_6 for FPG --- .../include/CGAL/NewKernel_d/orientationC6.h | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h new file mode 100644 index 00000000000..63ba8232f6f --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -0,0 +1,211 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +typedef double RT; + +int +orientation( + RT a01,RT a02,RT a03,RT a04,RT a05,RT a06, + RT a11,RT a12,RT a13,RT a14,RT a15,RT a16, + RT a21,RT a22,RT a23,RT a24,RT a25,RT a26, + RT a31,RT a32,RT a33,RT a34,RT a35,RT a36, + RT a41,RT a42,RT a43,RT a44,RT a45,RT a46, + RT a51,RT a52,RT a53,RT a54,RT a55,RT a56, + RT a61,RT a62,RT a63,RT a64,RT a65,RT a66) +{ +// First compute the det2x2 + const RT m01 = a11 - a01; + const RT m02 = a21 - a01; + const RT m03 = a31 - a01; + const RT m04 = a41 - a01; + const RT m05 = a51 - a01; + const RT m06 = a61 - a01; + + const RT m12 = a21 - a11; + const RT m13 = a31 - a11; + const RT m14 = a41 - a11; + const RT m15 = a51 - a11; + const RT m16 = a61 - a11; + + const RT m23 = a31 - a21; + const RT m24 = a41 - a21; + const RT m25 = a51 - a21; + const RT m26 = a61 - a21; + + const RT m34 = a41 - a31; + const RT m35 = a51 - a31; + const RT m36 = a61 - a31; + + const RT m45 = a51 - a41; + const RT m46 = a61 - a41; + + const RT m56 = a61 - a51; + +// Now compute the minors of rank 3 + const RT m012 = m01*a22 - m02*a12 + m12*a02; + const RT m013 = m01*a32 - m03*a12 + m13*a02; + const RT m014 = m01*a42 - m04*a12 + m14*a02; + const RT m015 = m01*a52 - m05*a12 + m15*a02; + const RT m016 = m01*a62 - m06*a12 + m16*a02; + + const RT m023 = m02*a32 - m03*a22 + m23*a02; + const RT m024 = m02*a42 - m04*a22 + m24*a02; + const RT m025 = m02*a52 - m05*a22 + m25*a02; + const RT m026 = m02*a62 - m06*a22 + m26*a02; + const RT m034 = m03*a42 - m04*a32 + m34*a02; + const RT m035 = m03*a52 - m05*a32 + m35*a02; + const RT m036 = m03*a62 - m06*a32 + m36*a02; + + const RT m045 = m04*a52 - m05*a42 + m45*a02; + const RT m046 = m04*a62 - m06*a42 + m46*a02; + + const RT m056 = m05*a62 - m06*a52 + m56*a02; + + + const RT m123 = m12*a32 - m13*a22 + m23*a12; + const RT m124 = m12*a42 - m14*a22 + m24*a12; + const RT m125 = m12*a52 - m15*a22 + m25*a12; + const RT m126 = m12*a62 - m16*a22 + m26*a12; + + const RT m134 = m13*a42 - m14*a32 + m34*a12; + const RT m135 = m13*a52 - m15*a32 + m35*a12; + const RT m136 = m13*a62 - m16*a32 + m36*a12; + + const RT m145 = m14*a52 - m15*a42 + m45*a12; + const RT m146 = m14*a62 - m16*a42 + m46*a12; + + const RT m156 = m15*a62 - m16*a52 + m56*a12; + + const RT m234 = m23*a42 - m24*a32 + m34*a22; + const RT m235 = m23*a52 - m25*a32 + m35*a22; + const RT m236 = m23*a62 - m26*a32 + m36*a22; + + const RT m245 = m24*a52 - m25*a42 + m45*a22; + const RT m246 = m24*a62 - m26*a42 + m46*a22; + + const RT m256 = m25*a62 - m26*a52 + m56*a22; + + const RT m345 = m34*a52 - m35*a42 + m45*a32; + const RT m346 = m34*a62 - m36*a42 + m46*a32; + + const RT m356 = m35*a62 - m36*a52 + m56*a32; + + const RT m456 = m45*a62 - m46*a52 + m56*a42; + +// Now compute the minors of rank 4 + const RT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + + const RT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + const RT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + const RT m0126 = m012*a63 - m016*a23 + m026*a13 - m126*a03; + + const RT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + const RT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + const RT m0136 = m013*a63 - m016*a33 + m036*a13 - m136*a03; + + const RT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + const RT m0146 = m014*a63 - m016*a43 + m046*a13 - m146*a03; + + const RT m0156 = m015*a63 - m016*a53 + m056*a13 - m156*a03; + + const RT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + const RT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + const RT m0236 = m023*a63 - m026*a33 + m036*a23 - m236*a03; + + const RT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + const RT m0246 = m024*a63 - m026*a43 + m046*a23 - m246*a03; + + const RT m0256 = m025*a63 - m026*a53 + m056*a23 - m256*a03; + + const RT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + const RT m0346 = m034*a63 - m036*a43 + m046*a33 - m346*a03; + + const RT m0356 = m035*a63 - m036*a53 + m056*a33 - m356*a03; + + const RT m0456 = m045*a63 - m046*a53 + m056*a43 - m456*a03; + + const RT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + const RT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + const RT m1236 = m123*a63 - m126*a33 + m136*a23 - m236*a13; + + const RT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + const RT m1246 = m124*a63 - m126*a43 + m146*a23 - m246*a13; + + const RT m1256 = m125*a63 - m126*a53 + m156*a23 - m256*a13; + + const RT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + const RT m1346 = m134*a63 - m136*a43 + m146*a33 - m346*a13; + + const RT m1356 = m135*a63 - m136*a53 + m156*a33 - m356*a13; + const RT m1456 = m145*a63 - m146*a53 + m156*a43 - m456*a13; + + const RT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; + const RT m2346 = m234*a63 - m236*a43 + m246*a33 - m346*a23; + + const RT m2356 = m235*a63 - m236*a53 + m256*a33 - m356*a23; + const RT m2456 = m245*a63 - m246*a53 + m256*a43 - m456*a23; + + const RT m3456 = m345*a63 - m346*a53 + m356*a43 - m456*a33; + + + // Now compute the minors of rank 5 + const RT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + + const RT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + + const RT m01236 = m0123*a64 - m0126*a34 + m0136*a24 - m0236*a14 + m1236*a04; + + const RT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + const RT m01246 = m0124*a64 - m0126*a44 + m0146*a24 - m0246*a14 + m1246*a04; + + const RT m01256 = m0125*a64 - m0126*a54 + m0156*a24 - m0256*a14 + m1256*a04; + + const RT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + const RT m01346 = m0134*a64 - m0136*a44 + m0146*a34 - m0346*a14 + m1346*a04; + + const RT m01356 = m0135*a64 - m0136*a54 + m0156*a34 - m0356*a14 + m1356*a04; + const RT m01456 = m0145*a64 - m0146*a54 + m0156*a44 - m0456*a14 + m1456*a04; + + const RT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + const RT m02346 = m0234*a64 - m0236*a44 + m0246*a34 - m0346*a24 + m2346*a04; + + const RT m02356 = m0235*a64 - m0236*a54 + m0256*a34 - m0356*a24 + m2356*a04; + const RT m02456 = m0245*a64 - m0246*a54 + m0256*a44 - m0456*a24 + m2456*a04; + const RT m03456 = m0345*a64 - m0346*a54 + m0356*a44 - m0456*a34 + m3456*a04; + + const RT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; + const RT m12346 = m1234*a64 - m1236*a44 + m1246*a34 - m1346*a24 + m2346*a14; + + + const RT m12356 = m1235*a64 - m1236*a54 + m1256*a34 - m1356*a24 + m2356*a14; + const RT m12456 = m1245*a64 - m1246*a54 + m1256*a44 - m1456*a24 + m2456*a14; + const RT m13456 = m1345*a64 - m1346*a54 + m1356*a44 - m1456*a34 + m3456*a14; + + const RT m23456 = m2345*a64 - m2346*a54 + m2356*a44 - m2456*a34 + m3456*a24; + +// Now compute the minors of rank 6 + const RT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + m02345*a15 - m12345*a05; + const RT m012346 = m01234*a65 - m01236*a45 + m01246*a35 - m01346*a25 + m02346*a15 - m12346*a05; + const RT m012356 = m01235*a65 - m01236*a55 + m01256*a35 - m01356*a25 + m02356*a15 - m12356*a05; + const RT m012456 = m01245*a65 - m01246*a55 + m01256*a45 - m01456*a25 + m02456*a15 - m12456*a05; + const RT m013456 = m01345*a65 - m01346*a55 + m01356*a45 - m01456*a35 + m03456*a15 - m13456*a05; + const RT m023456 = m02345*a65 - m02346*a55 + m02356*a45 - m02456*a35 + m03456*a25 - m23456*a05; + const RT m123456 = m12345*a65 - m12346*a55 + m12356*a45 - m12456*a35 + m13456*a25 - m23456*a15; + + + // Now compute the minors of rank 7 + const RT m0123456 = m012345 * a66 - m012346 * a56 + m012356 * a46 - m012456 * a36 + m013456 * a26 - m023456 * a16 + m123456 * a06; + + if(m0123456 > 0) return 1; + if(m0123456 < 0) return -1; + return 0; +} From c75cc8aabddc864616527444c5714c442d5fd1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 24 Apr 2025 10:23:25 +0200 Subject: [PATCH 030/145] FPG output for the orientationC6 --- .../include/CGAL/NewKernel_d/orientationC6.h | 734 +++++++++++++----- 1 file changed, 537 insertions(+), 197 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h index 63ba8232f6f..77525c8a21b 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -10,202 +10,542 @@ // // Author(s) : Andreas Fabri -typedef double RT; -int -orientation( - RT a01,RT a02,RT a03,RT a04,RT a05,RT a06, - RT a11,RT a12,RT a13,RT a14,RT a15,RT a16, - RT a21,RT a22,RT a23,RT a24,RT a25,RT a26, - RT a31,RT a32,RT a33,RT a34,RT a35,RT a36, - RT a41,RT a42,RT a43,RT a44,RT a45,RT a46, - RT a51,RT a52,RT a53,RT a54,RT a55,RT a56, - RT a61,RT a62,RT a63,RT a64,RT a65,RT a66) -{ -// First compute the det2x2 - const RT m01 = a11 - a01; - const RT m02 = a21 - a01; - const RT m03 = a31 - a01; - const RT m04 = a41 - a01; - const RT m05 = a51 - a01; - const RT m06 = a61 - a01; - - const RT m12 = a21 - a11; - const RT m13 = a31 - a11; - const RT m14 = a41 - a11; - const RT m15 = a51 - a11; - const RT m16 = a61 - a11; - - const RT m23 = a31 - a21; - const RT m24 = a41 - a21; - const RT m25 = a51 - a21; - const RT m26 = a61 - a21; - - const RT m34 = a41 - a31; - const RT m35 = a51 - a31; - const RT m36 = a61 - a31; - - const RT m45 = a51 - a41; - const RT m46 = a61 - a41; - - const RT m56 = a61 - a51; - -// Now compute the minors of rank 3 - const RT m012 = m01*a22 - m02*a12 + m12*a02; - const RT m013 = m01*a32 - m03*a12 + m13*a02; - const RT m014 = m01*a42 - m04*a12 + m14*a02; - const RT m015 = m01*a52 - m05*a12 + m15*a02; - const RT m016 = m01*a62 - m06*a12 + m16*a02; - - const RT m023 = m02*a32 - m03*a22 + m23*a02; - const RT m024 = m02*a42 - m04*a22 + m24*a02; - const RT m025 = m02*a52 - m05*a22 + m25*a02; - const RT m026 = m02*a62 - m06*a22 + m26*a02; - const RT m034 = m03*a42 - m04*a32 + m34*a02; - const RT m035 = m03*a52 - m05*a32 + m35*a02; - const RT m036 = m03*a62 - m06*a32 + m36*a02; - - const RT m045 = m04*a52 - m05*a42 + m45*a02; - const RT m046 = m04*a62 - m06*a42 + m46*a02; - - const RT m056 = m05*a62 - m06*a52 + m56*a02; - - - const RT m123 = m12*a32 - m13*a22 + m23*a12; - const RT m124 = m12*a42 - m14*a22 + m24*a12; - const RT m125 = m12*a52 - m15*a22 + m25*a12; - const RT m126 = m12*a62 - m16*a22 + m26*a12; - - const RT m134 = m13*a42 - m14*a32 + m34*a12; - const RT m135 = m13*a52 - m15*a32 + m35*a12; - const RT m136 = m13*a62 - m16*a32 + m36*a12; - - const RT m145 = m14*a52 - m15*a42 + m45*a12; - const RT m146 = m14*a62 - m16*a42 + m46*a12; - - const RT m156 = m15*a62 - m16*a52 + m56*a12; - - const RT m234 = m23*a42 - m24*a32 + m34*a22; - const RT m235 = m23*a52 - m25*a32 + m35*a22; - const RT m236 = m23*a62 - m26*a32 + m36*a22; - - const RT m245 = m24*a52 - m25*a42 + m45*a22; - const RT m246 = m24*a62 - m26*a42 + m46*a22; - - const RT m256 = m25*a62 - m26*a52 + m56*a22; - - const RT m345 = m34*a52 - m35*a42 + m45*a32; - const RT m346 = m34*a62 - m36*a42 + m46*a32; - - const RT m356 = m35*a62 - m36*a52 + m56*a32; - - const RT m456 = m45*a62 - m46*a52 + m56*a42; - -// Now compute the minors of rank 4 - const RT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; - - const RT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; - const RT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; - const RT m0126 = m012*a63 - m016*a23 + m026*a13 - m126*a03; - - const RT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; - const RT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; - const RT m0136 = m013*a63 - m016*a33 + m036*a13 - m136*a03; - - const RT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; - const RT m0146 = m014*a63 - m016*a43 + m046*a13 - m146*a03; - - const RT m0156 = m015*a63 - m016*a53 + m056*a13 - m156*a03; - - const RT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; - const RT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; - const RT m0236 = m023*a63 - m026*a33 + m036*a23 - m236*a03; - - const RT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; - const RT m0246 = m024*a63 - m026*a43 + m046*a23 - m246*a03; - - const RT m0256 = m025*a63 - m026*a53 + m056*a23 - m256*a03; - - const RT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; - const RT m0346 = m034*a63 - m036*a43 + m046*a33 - m346*a03; - - const RT m0356 = m035*a63 - m036*a53 + m056*a33 - m356*a03; - - const RT m0456 = m045*a63 - m046*a53 + m056*a43 - m456*a03; - - const RT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; - const RT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; - const RT m1236 = m123*a63 - m126*a33 + m136*a23 - m236*a13; - - const RT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; - const RT m1246 = m124*a63 - m126*a43 + m146*a23 - m246*a13; - - const RT m1256 = m125*a63 - m126*a53 + m156*a23 - m256*a13; - - const RT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; - const RT m1346 = m134*a63 - m136*a43 + m146*a33 - m346*a13; - - const RT m1356 = m135*a63 - m136*a53 + m156*a33 - m356*a13; - const RT m1456 = m145*a63 - m146*a53 + m156*a43 - m456*a13; - - const RT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; - const RT m2346 = m234*a63 - m236*a43 + m246*a33 - m346*a23; - - const RT m2356 = m235*a63 - m236*a53 + m256*a33 - m356*a23; - const RT m2456 = m245*a63 - m246*a53 + m256*a43 - m456*a23; - - const RT m3456 = m345*a63 - m346*a53 + m356*a43 - m456*a33; - - - // Now compute the minors of rank 5 - const RT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; - - const RT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; - - const RT m01236 = m0123*a64 - m0126*a34 + m0136*a24 - m0236*a14 + m1236*a04; - - const RT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; - const RT m01246 = m0124*a64 - m0126*a44 + m0146*a24 - m0246*a14 + m1246*a04; - - const RT m01256 = m0125*a64 - m0126*a54 + m0156*a24 - m0256*a14 + m1256*a04; - - const RT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; - const RT m01346 = m0134*a64 - m0136*a44 + m0146*a34 - m0346*a14 + m1346*a04; - - const RT m01356 = m0135*a64 - m0136*a54 + m0156*a34 - m0356*a14 + m1356*a04; - const RT m01456 = m0145*a64 - m0146*a54 + m0156*a44 - m0456*a14 + m1456*a04; - - const RT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; - const RT m02346 = m0234*a64 - m0236*a44 + m0246*a34 - m0346*a24 + m2346*a04; - - const RT m02356 = m0235*a64 - m0236*a54 + m0256*a34 - m0356*a24 + m2356*a04; - const RT m02456 = m0245*a64 - m0246*a54 + m0256*a44 - m0456*a24 + m2456*a04; - const RT m03456 = m0345*a64 - m0346*a54 + m0356*a44 - m0456*a34 + m3456*a04; - - const RT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; - const RT m12346 = m1234*a64 - m1236*a44 + m1246*a34 - m1346*a24 + m2346*a14; - - - const RT m12356 = m1235*a64 - m1236*a54 + m1256*a34 - m1356*a24 + m2356*a14; - const RT m12456 = m1245*a64 - m1246*a54 + m1256*a44 - m1456*a24 + m2456*a14; - const RT m13456 = m1345*a64 - m1346*a54 + m1356*a44 - m1456*a34 + m3456*a14; - - const RT m23456 = m2345*a64 - m2346*a54 + m2356*a44 - m2456*a34 + m3456*a24; - -// Now compute the minors of rank 6 - const RT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + m02345*a15 - m12345*a05; - const RT m012346 = m01234*a65 - m01236*a45 + m01246*a35 - m01346*a25 + m02346*a15 - m12346*a05; - const RT m012356 = m01235*a65 - m01236*a55 + m01256*a35 - m01356*a25 + m02356*a15 - m12356*a05; - const RT m012456 = m01245*a65 - m01246*a55 + m01256*a45 - m01456*a25 + m02456*a15 - m12456*a05; - const RT m013456 = m01345*a65 - m01346*a55 + m01356*a45 - m01456*a35 + m03456*a15 - m13456*a05; - const RT m023456 = m02345*a65 - m02346*a55 + m02356*a45 - m02456*a35 + m03456*a25 - m23456*a05; - const RT m123456 = m12345*a65 - m12346*a55 + m12356*a45 - m12456*a35 + m13456*a25 - m23456*a15; - - - // Now compute the minors of rank 7 - const RT m0123456 = m012345 * a66 - m012346 * a56 + m012356 * a46 - m012456 * a36 + m013456 * a26 - m023456 * a16 + m123456 * a06; - - if(m0123456 > 0) return 1; - if(m0123456 < 0) return -1; - return 0; +inline int orientation( double a01, double a02, double a03, double a04, double a05, double a06, double a11, double a12, double a13, double a14, double a15, double a16, double a21, double a22, double a23, double a24, double a25, double a26, double a31, double a32, double a33, double a34, double a35, double a36, double a41, double a42, double a43, double a44, double a45, double a46, double a51, double a52, double a53, double a54, double a55, double a56, double a61, double a62, double a63, double a64, double a65, double a66) { + double m01; + m01 = (a11 - a01); + double m02; + m02 = (a21 - a01); + double m03; + m03 = (a31 - a01); + double m04; + m04 = (a41 - a01); + double m05; + m05 = (a51 - a01); + double m06; + m06 = (a61 - a01); + double m12; + m12 = (a21 - a11); + double m13; + m13 = (a31 - a11); + double m14; + m14 = (a41 - a11); + double m15; + m15 = (a51 - a11); + double m16; + m16 = (a61 - a11); + double m23; + m23 = (a31 - a21); + double m24; + m24 = (a41 - a21); + double m25; + m25 = (a51 - a21); + double m26; + m26 = (a61 - a21); + double m34; + m34 = (a41 - a31); + double m35; + m35 = (a51 - a31); + double m36; + m36 = (a61 - a31); + double m45; + m45 = (a51 - a41); + double m46; + m46 = (a61 - a41); + double m56; + m56 = (a61 - a51); + double m012; + m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); + double m013; + m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); + double m014; + m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); + double m015; + m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); + double m016; + m016 = (((m01 * a62) - (m06 * a12)) + (m16 * a02)); + double m023; + m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); + double m024; + m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); + double m025; + m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); + double m026; + m026 = (((m02 * a62) - (m06 * a22)) + (m26 * a02)); + double m034; + m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); + double m035; + m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); + double m036; + m036 = (((m03 * a62) - (m06 * a32)) + (m36 * a02)); + double m045; + m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); + double m046; + m046 = (((m04 * a62) - (m06 * a42)) + (m46 * a02)); + double m056; + m056 = (((m05 * a62) - (m06 * a52)) + (m56 * a02)); + double m123; + m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); + double m124; + m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); + double m125; + m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); + double m126; + m126 = (((m12 * a62) - (m16 * a22)) + (m26 * a12)); + double m134; + m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); + double m135; + m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); + double m136; + m136 = (((m13 * a62) - (m16 * a32)) + (m36 * a12)); + double m145; + m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); + double m146; + m146 = (((m14 * a62) - (m16 * a42)) + (m46 * a12)); + double m156; + m156 = (((m15 * a62) - (m16 * a52)) + (m56 * a12)); + double m234; + m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); + double m235; + m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); + double m236; + m236 = (((m23 * a62) - (m26 * a32)) + (m36 * a22)); + double m245; + m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); + double m246; + m246 = (((m24 * a62) - (m26 * a42)) + (m46 * a22)); + double m256; + m256 = (((m25 * a62) - (m26 * a52)) + (m56 * a22)); + double m345; + m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); + double m346; + m346 = (((m34 * a62) - (m36 * a42)) + (m46 * a32)); + double m356; + m356 = (((m35 * a62) - (m36 * a52)) + (m56 * a32)); + double m456; + m456 = (((m45 * a62) - (m46 * a52)) + (m56 * a42)); + double m0123; + m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); + double m0124; + m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); + double m0125; + m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); + double m0126; + m0126 = ((((m012 * a63) - (m016 * a23)) + (m026 * a13)) - (m126 * a03)); + double m0134; + m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); + double m0135; + m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); + double m0136; + m0136 = ((((m013 * a63) - (m016 * a33)) + (m036 * a13)) - (m136 * a03)); + double m0145; + m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); + double m0146; + m0146 = ((((m014 * a63) - (m016 * a43)) + (m046 * a13)) - (m146 * a03)); + double m0156; + m0156 = ((((m015 * a63) - (m016 * a53)) + (m056 * a13)) - (m156 * a03)); + double m0234; + m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); + double m0235; + m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); + double m0236; + m0236 = ((((m023 * a63) - (m026 * a33)) + (m036 * a23)) - (m236 * a03)); + double m0245; + m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); + double m0246; + m0246 = ((((m024 * a63) - (m026 * a43)) + (m046 * a23)) - (m246 * a03)); + double m0256; + m0256 = ((((m025 * a63) - (m026 * a53)) + (m056 * a23)) - (m256 * a03)); + double m0345; + m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); + double m0346; + m0346 = ((((m034 * a63) - (m036 * a43)) + (m046 * a33)) - (m346 * a03)); + double m0356; + m0356 = ((((m035 * a63) - (m036 * a53)) + (m056 * a33)) - (m356 * a03)); + double m0456; + m0456 = ((((m045 * a63) - (m046 * a53)) + (m056 * a43)) - (m456 * a03)); + double m1234; + m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); + double m1235; + m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); + double m1236; + m1236 = ((((m123 * a63) - (m126 * a33)) + (m136 * a23)) - (m236 * a13)); + double m1245; + m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); + double m1246; + m1246 = ((((m124 * a63) - (m126 * a43)) + (m146 * a23)) - (m246 * a13)); + double m1256; + m1256 = ((((m125 * a63) - (m126 * a53)) + (m156 * a23)) - (m256 * a13)); + double m1345; + m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); + double m1346; + m1346 = ((((m134 * a63) - (m136 * a43)) + (m146 * a33)) - (m346 * a13)); + double m1356; + m1356 = ((((m135 * a63) - (m136 * a53)) + (m156 * a33)) - (m356 * a13)); + double m1456; + m1456 = ((((m145 * a63) - (m146 * a53)) + (m156 * a43)) - (m456 * a13)); + double m2345; + m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); + double m2346; + m2346 = ((((m234 * a63) - (m236 * a43)) + (m246 * a33)) - (m346 * a23)); + double m2356; + m2356 = ((((m235 * a63) - (m236 * a53)) + (m256 * a33)) - (m356 * a23)); + double m2456; + m2456 = ((((m245 * a63) - (m246 * a53)) + (m256 * a43)) - (m456 * a23)); + double m3456; + m3456 = ((((m345 * a63) - (m346 * a53)) + (m356 * a43)) - (m456 * a33)); + double m01234; + m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); + double m01235; + m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); + double m01236; + m01236 = (((((m0123 * a64) - (m0126 * a34)) + (m0136 * a24)) - (m0236 * a14)) + (m1236 * a04)); + double m01245; + m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); + double m01246; + m01246 = (((((m0124 * a64) - (m0126 * a44)) + (m0146 * a24)) - (m0246 * a14)) + (m1246 * a04)); + double m01256; + m01256 = (((((m0125 * a64) - (m0126 * a54)) + (m0156 * a24)) - (m0256 * a14)) + (m1256 * a04)); + double m01345; + m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); + double m01346; + m01346 = (((((m0134 * a64) - (m0136 * a44)) + (m0146 * a34)) - (m0346 * a14)) + (m1346 * a04)); + double m01356; + m01356 = (((((m0135 * a64) - (m0136 * a54)) + (m0156 * a34)) - (m0356 * a14)) + (m1356 * a04)); + double m01456; + m01456 = (((((m0145 * a64) - (m0146 * a54)) + (m0156 * a44)) - (m0456 * a14)) + (m1456 * a04)); + double m02345; + m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); + double m02346; + m02346 = (((((m0234 * a64) - (m0236 * a44)) + (m0246 * a34)) - (m0346 * a24)) + (m2346 * a04)); + double m02356; + m02356 = (((((m0235 * a64) - (m0236 * a54)) + (m0256 * a34)) - (m0356 * a24)) + (m2356 * a04)); + double m02456; + m02456 = (((((m0245 * a64) - (m0246 * a54)) + (m0256 * a44)) - (m0456 * a24)) + (m2456 * a04)); + double m03456; + m03456 = (((((m0345 * a64) - (m0346 * a54)) + (m0356 * a44)) - (m0456 * a34)) + (m3456 * a04)); + double m12345; + m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); + double m12346; + m12346 = (((((m1234 * a64) - (m1236 * a44)) + (m1246 * a34)) - (m1346 * a24)) + (m2346 * a14)); + double m12356; + m12356 = (((((m1235 * a64) - (m1236 * a54)) + (m1256 * a34)) - (m1356 * a24)) + (m2356 * a14)); + double m12456; + m12456 = (((((m1245 * a64) - (m1246 * a54)) + (m1256 * a44)) - (m1456 * a24)) + (m2456 * a14)); + double m13456; + m13456 = (((((m1345 * a64) - (m1346 * a54)) + (m1356 * a44)) - (m1456 * a34)) + (m3456 * a14)); + double m23456; + m23456 = (((((m2345 * a64) - (m2346 * a54)) + (m2356 * a44)) - (m2456 * a34)) + (m3456 * a24)); + double m012345; + m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); + double m012346; + m012346 = ((((((m01234 * a65) - (m01236 * a45)) + (m01246 * a35)) - (m01346 * a25)) + (m02346 * a15)) - (m12346 * a05)); + double m012356; + m012356 = ((((((m01235 * a65) - (m01236 * a55)) + (m01256 * a35)) - (m01356 * a25)) + (m02356 * a15)) - (m12356 * a05)); + double m012456; + m012456 = ((((((m01245 * a65) - (m01246 * a55)) + (m01256 * a45)) - (m01456 * a25)) + (m02456 * a15)) - (m12456 * a05)); + double m013456; + m013456 = ((((((m01345 * a65) - (m01346 * a55)) + (m01356 * a45)) - (m01456 * a35)) + (m03456 * a15)) - (m13456 * a05)); + double m023456; + m023456 = ((((((m02345 * a65) - (m02346 * a55)) + (m02356 * a45)) - (m02456 * a35)) + (m03456 * a25)) - (m23456 * a05)); + double m123456; + m123456 = ((((((m12345 * a65) - (m12346 * a55)) + (m12356 * a45)) - (m12456 * a35)) + (m13456 * a25)) - (m23456 * a15)); + double m0123456; + m0123456 = (((((((m012345 * a66) - (m012346 * a56)) + (m012356 * a46)) - (m012456 * a36)) + (m013456 * a26)) - (m023456 * a16)) + (m123456 * a06)); + int int_tmp_result; + double eps; + double max1 = fabs(a02); + if( (max1 < fabs(a12)) ) + { + max1 = fabs(a12); + } + if( (max1 < fabs(a22)) ) + { + max1 = fabs(a22); + } + if( (max1 < fabs(a32)) ) + { + max1 = fabs(a32); + } + if( (max1 < fabs(a42)) ) + { + max1 = fabs(a42); + } + if( (max1 < fabs(a52)) ) + { + max1 = fabs(a52); + } + if( (max1 < fabs(a62)) ) + { + max1 = fabs(a62); + } + double max2 = fabs(a03); + if( (max2 < fabs(a13)) ) + { + max2 = fabs(a13); + } + if( (max2 < fabs(a23)) ) + { + max2 = fabs(a23); + } + if( (max2 < fabs(a33)) ) + { + max2 = fabs(a33); + } + if( (max2 < fabs(a43)) ) + { + max2 = fabs(a43); + } + if( (max2 < fabs(a53)) ) + { + max2 = fabs(a53); + } + if( (max2 < fabs(a63)) ) + { + max2 = fabs(a63); + } + double max3 = fabs(a04); + if( (max3 < fabs(a14)) ) + { + max3 = fabs(a14); + } + if( (max3 < fabs(a24)) ) + { + max3 = fabs(a24); + } + if( (max3 < fabs(a34)) ) + { + max3 = fabs(a34); + } + if( (max3 < fabs(a44)) ) + { + max3 = fabs(a44); + } + if( (max3 < fabs(a54)) ) + { + max3 = fabs(a54); + } + if( (max3 < fabs(a64)) ) + { + max3 = fabs(a64); + } + double max4 = fabs(a05); + if( (max4 < fabs(a15)) ) + { + max4 = fabs(a15); + } + if( (max4 < fabs(a25)) ) + { + max4 = fabs(a25); + } + if( (max4 < fabs(a35)) ) + { + max4 = fabs(a35); + } + if( (max4 < fabs(a45)) ) + { + max4 = fabs(a45); + } + if( (max4 < fabs(a55)) ) + { + max4 = fabs(a55); + } + if( (max4 < fabs(a65)) ) + { + max4 = fabs(a65); + } + double max5 = fabs(a06); + if( (max5 < fabs(a16)) ) + { + max5 = fabs(a16); + } + if( (max5 < fabs(a26)) ) + { + max5 = fabs(a26); + } + if( (max5 < fabs(a36)) ) + { + max5 = fabs(a36); + } + if( (max5 < fabs(a46)) ) + { + max5 = fabs(a46); + } + if( (max5 < fabs(a56)) ) + { + max5 = fabs(a56); + } + if( (max5 < fabs(a66)) ) + { + max5 = fabs(a66); + } + double max6 = fabs(m01); + if( (max6 < fabs(m02)) ) + { + max6 = fabs(m02); + } + if( (max6 < fabs(m03)) ) + { + max6 = fabs(m03); + } + if( (max6 < fabs(m04)) ) + { + max6 = fabs(m04); + } + if( (max6 < fabs(m05)) ) + { + max6 = fabs(m05); + } + if( (max6 < fabs(m06)) ) + { + max6 = fabs(m06); + } + if( (max6 < fabs(m12)) ) + { + max6 = fabs(m12); + } + if( (max6 < fabs(m13)) ) + { + max6 = fabs(m13); + } + if( (max6 < fabs(m14)) ) + { + max6 = fabs(m14); + } + if( (max6 < fabs(m15)) ) + { + max6 = fabs(m15); + } + if( (max6 < fabs(m16)) ) + { + max6 = fabs(m16); + } + if( (max6 < fabs(m23)) ) + { + max6 = fabs(m23); + } + if( (max6 < fabs(m24)) ) + { + max6 = fabs(m24); + } + if( (max6 < fabs(m25)) ) + { + max6 = fabs(m25); + } + if( (max6 < fabs(m26)) ) + { + max6 = fabs(m26); + } + if( (max6 < fabs(m34)) ) + { + max6 = fabs(m34); + } + if( (max6 < fabs(m35)) ) + { + max6 = fabs(m35); + } + if( (max6 < fabs(m36)) ) + { + max6 = fabs(m36); + } + if( (max6 < fabs(m45)) ) + { + max6 = fabs(m45); + } + if( (max6 < fabs(m46)) ) + { + max6 = fabs(m46); + } + if( (max6 < fabs(m56)) ) + { + max6 = fabs(m56); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max6; + upper_bound_1 = max6; + if( (max5 < lower_bound_1) ) + { + lower_bound_1 = max5; + } + else + { + if( (max5 > upper_bound_1) ) + { + upper_bound_1 = max5; + } + } + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 3.98278627399642140002e-50) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 1.87072209578355511223e+50) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (5.57471180948088246730e-12 * (((((max6 * max1) * max2) * max3) * max4) * max5)); + if( (m0123456 > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (m0123456 < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; } + From e45f8faaa7b2b20785e7a3e58c918faaf4044f53 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 09:24:05 +0100 Subject: [PATCH 031/145] typo --- .../Triangulation/CGAL/TDS_full_cell_default_storage_policy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h index b6ed9765723..225ee67becb 100644 --- a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_default_storage_policy.h @@ -3,8 +3,8 @@ namespace CGAL { /*! \ingroup PkgTriangulationsRef - A tag class to indicate that mirror indices are not stored in full cells. + A tag class to indicate that no mirror indices are stored in full cells. */ -class TDS_full_cell_mirror_storage_policy +class TDS_full_cell_default_storage_policy {}; } \ No newline at end of file From 717f6aff449cbd4cf587b3927dfac1f72efbafe7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 10:32:25 +0100 Subject: [PATCH 032/145] Add benchmark and static filter for 6D --- .../internal/Static_filters/Orientation_6.h | 613 ++++++++++++++++++ .../NewKernel_d/Cartesian_static_filters.h | 62 ++ .../benchmark/Triangulation/CMakeLists.txt | 3 + .../benchmark/Triangulation/bench6d.cpp | 60 ++ .../benchmark/Triangulation/generate_d.cpp | 6 +- 5 files changed, 741 insertions(+), 3 deletions(-) create mode 100644 Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h create mode 100644 Triangulation/benchmark/Triangulation/bench6d.cpp diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h new file mode 100644 index 00000000000..7ad22e52128 --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -0,0 +1,613 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H + +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + + + +template < typename K_base > +class Orientation_6 + : public K_base::Orientation_6 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_6 Point_6; + typedef typename K_base::Orientation_6 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_6 &p, const Point_6 &q, + const Point_6 &r, const Point_6 &s, + const Point_6 &t, const Point_6 &u, const Point_6 &v) const + { + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp); + + double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4; + + if (fit_in_double(p.c0(), a01) && fit_in_double(p.c1(), a02) && + fit_in_double(p.c2(), a03) && fit_in_double(p.c3(), a04) && + fit_in_double(p.c4(), a05) && fit_in_double(p.c5(), a06) && + + fit_in_double(q.c0(), a11) && fit_in_double(q.c1(), a12) && + fit_in_double(q.c2(), a13) && fit_in_double(q.c3(), a14) && + fit_in_double(q.c4(), a15) && fit_in_double(q.c4(), a16) && + + fit_in_double(r.c0(), a21) && fit_in_double(r.c1(), a22) && + fit_in_double(r.c2(), a23) && fit_in_double(r.c3(), a24) && + fit_in_double(r.c4(), a25) && fit_in_double(r.c5(), a26) && + + fit_in_double(s.c0(), a31) && fit_in_double(s.c1(), a32) && + fit_in_double(s.c2(), a33) && fit_in_double(s.c3(), a34) && + fit_in_double(s.c4(), a35) && fit_in_double(s.c5(), a36) && + + fit_in_double(t.c0(), a41) && fit_in_double(t.c1(), a42) && + fit_in_double(t.c2(), a43) && fit_in_double(t.c3(), a44) && + fit_in_double(t.c4(), a45) && fit_in_double(t.c5(), a46) && + + fit_in_double(u.c0(), a51) && fit_in_double(u.c1(), a52) && + fit_in_double(u.c2(), a53) && fit_in_double(u.c3(), a54) && + fit_in_double(u.c4(), a55) && fit_in_double(u.c5(), a56) && + fit_in_double(v.c0(), a61) && fit_in_double(v.c1(), a62) && + fit_in_double(v.c2(), a63) && fit_in_double(v.c3(), a64) && + fit_in_double(v.c4(), a65) && fit_in_double(v.c5(), a66)) + { + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u, v)); + double m01; + m01 = (a11 - a01); + double m02; + m02 = (a21 - a01); + double m03; + m03 = (a31 - a01); + double m04; + m04 = (a41 - a01); + double m05; + m05 = (a51 - a01); + double m06; + m06 = (a61 - a01); + double m12; + m12 = (a21 - a11); + double m13; + m13 = (a31 - a11); + double m14; + m14 = (a41 - a11); + double m15; + m15 = (a51 - a11); + double m16; + m16 = (a61 - a11); + double m23; + m23 = (a31 - a21); + double m24; + m24 = (a41 - a21); + double m25; + m25 = (a51 - a21); + double m26; + m26 = (a61 - a21); + double m34; + m34 = (a41 - a31); + double m35; + m35 = (a51 - a31); + double m36; + m36 = (a61 - a31); + double m45; + m45 = (a51 - a41); + double m46; + m46 = (a61 - a41); + double m56; + m56 = (a61 - a51); + double m012; + m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); + double m013; + m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); + double m014; + m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); + double m015; + m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); + double m016; + m016 = (((m01 * a62) - (m06 * a12)) + (m16 * a02)); + double m023; + m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); + double m024; + m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); + double m025; + m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); + double m026; + m026 = (((m02 * a62) - (m06 * a22)) + (m26 * a02)); + double m034; + m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); + double m035; + m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); + double m036; + m036 = (((m03 * a62) - (m06 * a32)) + (m36 * a02)); + double m045; + m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); + double m046; + m046 = (((m04 * a62) - (m06 * a42)) + (m46 * a02)); + double m056; + m056 = (((m05 * a62) - (m06 * a52)) + (m56 * a02)); + double m123; + m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); + double m124; + m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); + double m125; + m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); + double m126; + m126 = (((m12 * a62) - (m16 * a22)) + (m26 * a12)); + double m134; + m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); + double m135; + m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); + double m136; + m136 = (((m13 * a62) - (m16 * a32)) + (m36 * a12)); + double m145; + m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); + double m146; + m146 = (((m14 * a62) - (m16 * a42)) + (m46 * a12)); + double m156; + m156 = (((m15 * a62) - (m16 * a52)) + (m56 * a12)); + double m234; + m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); + double m235; + m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); + double m236; + m236 = (((m23 * a62) - (m26 * a32)) + (m36 * a22)); + double m245; + m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); + double m246; + m246 = (((m24 * a62) - (m26 * a42)) + (m46 * a22)); + double m256; + m256 = (((m25 * a62) - (m26 * a52)) + (m56 * a22)); + double m345; + m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); + double m346; + m346 = (((m34 * a62) - (m36 * a42)) + (m46 * a32)); + double m356; + m356 = (((m35 * a62) - (m36 * a52)) + (m56 * a32)); + double m456; + m456 = (((m45 * a62) - (m46 * a52)) + (m56 * a42)); + double m0123; + m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); + double m0124; + m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); + double m0125; + m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); + double m0126; + m0126 = ((((m012 * a63) - (m016 * a23)) + (m026 * a13)) - (m126 * a03)); + double m0134; + m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); + double m0135; + m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); + double m0136; + m0136 = ((((m013 * a63) - (m016 * a33)) + (m036 * a13)) - (m136 * a03)); + double m0145; + m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); + double m0146; + m0146 = ((((m014 * a63) - (m016 * a43)) + (m046 * a13)) - (m146 * a03)); + double m0156; + m0156 = ((((m015 * a63) - (m016 * a53)) + (m056 * a13)) - (m156 * a03)); + double m0234; + m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); + double m0235; + m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); + double m0236; + m0236 = ((((m023 * a63) - (m026 * a33)) + (m036 * a23)) - (m236 * a03)); + double m0245; + m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); + double m0246; + m0246 = ((((m024 * a63) - (m026 * a43)) + (m046 * a23)) - (m246 * a03)); + double m0256; + m0256 = ((((m025 * a63) - (m026 * a53)) + (m056 * a23)) - (m256 * a03)); + double m0345; + m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); + double m0346; + m0346 = ((((m034 * a63) - (m036 * a43)) + (m046 * a33)) - (m346 * a03)); + double m0356; + m0356 = ((((m035 * a63) - (m036 * a53)) + (m056 * a33)) - (m356 * a03)); + double m0456; + m0456 = ((((m045 * a63) - (m046 * a53)) + (m056 * a43)) - (m456 * a03)); + double m1234; + m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); + double m1235; + m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); + double m1236; + m1236 = ((((m123 * a63) - (m126 * a33)) + (m136 * a23)) - (m236 * a13)); + double m1245; + m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); + double m1246; + m1246 = ((((m124 * a63) - (m126 * a43)) + (m146 * a23)) - (m246 * a13)); + double m1256; + m1256 = ((((m125 * a63) - (m126 * a53)) + (m156 * a23)) - (m256 * a13)); + double m1345; + m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); + double m1346; + m1346 = ((((m134 * a63) - (m136 * a43)) + (m146 * a33)) - (m346 * a13)); + double m1356; + m1356 = ((((m135 * a63) - (m136 * a53)) + (m156 * a33)) - (m356 * a13)); + double m1456; + m1456 = ((((m145 * a63) - (m146 * a53)) + (m156 * a43)) - (m456 * a13)); + double m2345; + m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); + double m2346; + m2346 = ((((m234 * a63) - (m236 * a43)) + (m246 * a33)) - (m346 * a23)); + double m2356; + m2356 = ((((m235 * a63) - (m236 * a53)) + (m256 * a33)) - (m356 * a23)); + double m2456; + m2456 = ((((m245 * a63) - (m246 * a53)) + (m256 * a43)) - (m456 * a23)); + double m3456; + m3456 = ((((m345 * a63) - (m346 * a53)) + (m356 * a43)) - (m456 * a33)); + double m01234; + m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); + double m01235; + m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); + double m01236; + m01236 = (((((m0123 * a64) - (m0126 * a34)) + (m0136 * a24)) - (m0236 * a14)) + (m1236 * a04)); + double m01245; + m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); + double m01246; + m01246 = (((((m0124 * a64) - (m0126 * a44)) + (m0146 * a24)) - (m0246 * a14)) + (m1246 * a04)); + double m01256; + m01256 = (((((m0125 * a64) - (m0126 * a54)) + (m0156 * a24)) - (m0256 * a14)) + (m1256 * a04)); + double m01345; + m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); + double m01346; + m01346 = (((((m0134 * a64) - (m0136 * a44)) + (m0146 * a34)) - (m0346 * a14)) + (m1346 * a04)); + double m01356; + m01356 = (((((m0135 * a64) - (m0136 * a54)) + (m0156 * a34)) - (m0356 * a14)) + (m1356 * a04)); + double m01456; + m01456 = (((((m0145 * a64) - (m0146 * a54)) + (m0156 * a44)) - (m0456 * a14)) + (m1456 * a04)); + double m02345; + m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); + double m02346; + m02346 = (((((m0234 * a64) - (m0236 * a44)) + (m0246 * a34)) - (m0346 * a24)) + (m2346 * a04)); + double m02356; + m02356 = (((((m0235 * a64) - (m0236 * a54)) + (m0256 * a34)) - (m0356 * a24)) + (m2356 * a04)); + double m02456; + m02456 = (((((m0245 * a64) - (m0246 * a54)) + (m0256 * a44)) - (m0456 * a24)) + (m2456 * a04)); + double m03456; + m03456 = (((((m0345 * a64) - (m0346 * a54)) + (m0356 * a44)) - (m0456 * a34)) + (m3456 * a04)); + double m12345; + m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); + double m12346; + m12346 = (((((m1234 * a64) - (m1236 * a44)) + (m1246 * a34)) - (m1346 * a24)) + (m2346 * a14)); + double m12356; + m12356 = (((((m1235 * a64) - (m1236 * a54)) + (m1256 * a34)) - (m1356 * a24)) + (m2356 * a14)); + double m12456; + m12456 = (((((m1245 * a64) - (m1246 * a54)) + (m1256 * a44)) - (m1456 * a24)) + (m2456 * a14)); + double m13456; + m13456 = (((((m1345 * a64) - (m1346 * a54)) + (m1356 * a44)) - (m1456 * a34)) + (m3456 * a14)); + double m23456; + m23456 = (((((m2345 * a64) - (m2346 * a54)) + (m2356 * a44)) - (m2456 * a34)) + (m3456 * a24)); + double m012345; + m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); + double m012346; + m012346 = ((((((m01234 * a65) - (m01236 * a45)) + (m01246 * a35)) - (m01346 * a25)) + (m02346 * a15)) - (m12346 * a05)); + double m012356; + m012356 = ((((((m01235 * a65) - (m01236 * a55)) + (m01256 * a35)) - (m01356 * a25)) + (m02356 * a15)) - (m12356 * a05)); + double m012456; + m012456 = ((((((m01245 * a65) - (m01246 * a55)) + (m01256 * a45)) - (m01456 * a25)) + (m02456 * a15)) - (m12456 * a05)); + double m013456; + m013456 = ((((((m01345 * a65) - (m01346 * a55)) + (m01356 * a45)) - (m01456 * a35)) + (m03456 * a15)) - (m13456 * a05)); + double m023456; + m023456 = ((((((m02345 * a65) - (m02346 * a55)) + (m02356 * a45)) - (m02456 * a35)) + (m03456 * a25)) - (m23456 * a05)); + double m123456; + m123456 = ((((((m12345 * a65) - (m12346 * a55)) + (m12356 * a45)) - (m12456 * a35)) + (m13456 * a25)) - (m23456 * a15)); + double m0123456; + m0123456 = (((((((m012345 * a66) - (m012346 * a56)) + (m012356 * a46)) - (m012456 * a36)) + (m013456 * a26)) - (m023456 * a16)) + (m123456 * a06)); + int int_tmp_result; + double eps; + double max1 = fabs(a02); + if( (max1 < fabs(a12)) ) + { + max1 = fabs(a12); + } + if( (max1 < fabs(a22)) ) + { + max1 = fabs(a22); + } + if( (max1 < fabs(a32)) ) + { + max1 = fabs(a32); + } + if( (max1 < fabs(a42)) ) + { + max1 = fabs(a42); + } + if( (max1 < fabs(a52)) ) + { + max1 = fabs(a52); + } + if( (max1 < fabs(a62)) ) + { + max1 = fabs(a62); + } + double max2 = fabs(a03); + if( (max2 < fabs(a13)) ) + { + max2 = fabs(a13); + } + if( (max2 < fabs(a23)) ) + { + max2 = fabs(a23); + } + if( (max2 < fabs(a33)) ) + { + max2 = fabs(a33); + } + if( (max2 < fabs(a43)) ) + { + max2 = fabs(a43); + } + if( (max2 < fabs(a53)) ) + { + max2 = fabs(a53); + } + if( (max2 < fabs(a63)) ) + { + max2 = fabs(a63); + } + double max3 = fabs(a04); + if( (max3 < fabs(a14)) ) + { + max3 = fabs(a14); + } + if( (max3 < fabs(a24)) ) + { + max3 = fabs(a24); + } + if( (max3 < fabs(a34)) ) + { + max3 = fabs(a34); + } + if( (max3 < fabs(a44)) ) + { + max3 = fabs(a44); + } + if( (max3 < fabs(a54)) ) + { + max3 = fabs(a54); + } + if( (max3 < fabs(a64)) ) + { + max3 = fabs(a64); + } + double max4 = fabs(a05); + if( (max4 < fabs(a15)) ) + { + max4 = fabs(a15); + } + if( (max4 < fabs(a25)) ) + { + max4 = fabs(a25); + } + if( (max4 < fabs(a35)) ) + { + max4 = fabs(a35); + } + if( (max4 < fabs(a45)) ) + { + max4 = fabs(a45); + } + if( (max4 < fabs(a55)) ) + { + max4 = fabs(a55); + } + if( (max4 < fabs(a65)) ) + { + max4 = fabs(a65); + } + double max5 = fabs(a06); + if( (max5 < fabs(a16)) ) + { + max5 = fabs(a16); + } + if( (max5 < fabs(a26)) ) + { + max5 = fabs(a26); + } + if( (max5 < fabs(a36)) ) + { + max5 = fabs(a36); + } + if( (max5 < fabs(a46)) ) + { + max5 = fabs(a46); + } + if( (max5 < fabs(a56)) ) + { + max5 = fabs(a56); + } + if( (max5 < fabs(a66)) ) + { + max5 = fabs(a66); + } + double max6 = fabs(m01); + if( (max6 < fabs(m02)) ) + { + max6 = fabs(m02); + } + if( (max6 < fabs(m03)) ) + { + max6 = fabs(m03); + } + if( (max6 < fabs(m04)) ) + { + max6 = fabs(m04); + } + if( (max6 < fabs(m05)) ) + { + max6 = fabs(m05); + } + if( (max6 < fabs(m06)) ) + { + max6 = fabs(m06); + } + if( (max6 < fabs(m12)) ) + { + max6 = fabs(m12); + } + if( (max6 < fabs(m13)) ) + { + max6 = fabs(m13); + } + if( (max6 < fabs(m14)) ) + { + max6 = fabs(m14); + } + if( (max6 < fabs(m15)) ) + { + max6 = fabs(m15); + } + if( (max6 < fabs(m16)) ) + { + max6 = fabs(m16); + } + if( (max6 < fabs(m23)) ) + { + max6 = fabs(m23); + } + if( (max6 < fabs(m24)) ) + { + max6 = fabs(m24); + } + if( (max6 < fabs(m25)) ) + { + max6 = fabs(m25); + } + if( (max6 < fabs(m26)) ) + { + max6 = fabs(m26); + } + if( (max6 < fabs(m34)) ) + { + max6 = fabs(m34); + } + if( (max6 < fabs(m35)) ) + { + max6 = fabs(m35); + } + if( (max6 < fabs(m36)) ) + { + max6 = fabs(m36); + } + if( (max6 < fabs(m45)) ) + { + max6 = fabs(m45); + } + if( (max6 < fabs(m46)) ) + { + max6 = fabs(m46); + } + if( (max6 < fabs(m56)) ) + { + max6 = fabs(m56); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max6; + upper_bound_1 = max6; + if( (max5 < lower_bound_1) ) + { + lower_bound_1 = max5; + } + else + { + if( (max5 > upper_bound_1) ) + { + upper_bound_1 = max5; + } + } + if( (max1 < lower_bound_1) ) + { + lower_bound_1 = max1; + } + else + { + if( (max1 > upper_bound_1) ) + { + upper_bound_1 = max1; + } + } + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 3.98278627399642140002e-50) ) + { + return Base::operator()(p, q, r, s, t, u, v); + } + else + { + if( (upper_bound_1 > 1.87072209578355511223e+50) ) + { + return Base::operator()(p, q, r, s, t, u, v); + } + eps = (5.57471180948088246730e-12 * (((((max6 * max1) * max2) * max3) * max4) * max5)); + if( (m0123456 > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } + else + { + if( (m0123456 < -eps) ) + { + CGAL_assertion(should_be == NEGATIVE); + return NEGATIVE; + } + } + } + } + return Base::operator()(p, q, r, s, t, u, v); + } + + +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index 160c3206276..66be77c020d 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace CGAL { namespace SFA { // static filter adapter @@ -199,6 +200,55 @@ template struct Orientation_of_points_5 : private Store_k } }; +template struct Adapter_6 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_6 { + R_ const&r; CC const&c; Point const& p; + Point_6(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + decltype(auto) c4()const{return c(p,4);} + decltype(auto) c5()const{return c(p,5);} + }; + struct Orientation_6 { + typedef typename Get_type::type result_type; + auto operator()(Point_5 const&A, Point6 const&B, Point6 const&C, + Point6 const&D, Point6 const&E, Point6 const&F, Point6 const&G)const{ + Point const* t[7]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p,&G.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+7)); + } + }; +}; +template struct Orientation_of_points_6 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_6) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_5 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + Point const& F=*++f; + Point const& G=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_6 P; + return typename internal::Static_filters_predicates::Orientation_6()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F), + P(this->kernel(),c,G)); + } +}; + + } // namespace SFA @@ -256,6 +306,18 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { typedef SFA::Orientation_of_points_5 type; }; }; + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_6 type; + }; +}; #endif } // namespace CGAL #endif diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index befd92e97c5..7513af82322 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -11,12 +11,15 @@ include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") + create_single_source_cgal_program("generate_d.cpp") create_single_source_cgal_program("bench5d.cpp") + create_single_source_cgal_program("bench6d.cpp") create_single_source_cgal_program("delaunay.cpp") target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support) create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support) target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench6d PRIVATE CGAL::Eigen3_support) else() message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation/benchmark/Triangulation/bench6d.cpp b/Triangulation/benchmark/Triangulation/bench6d.cpp new file mode 100644 index 00000000000..ee5aeae6547 --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench6d.cpp @@ -0,0 +1,60 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 6; // we work in Euclidean 6-space + + std::vector points; + std::ifstream in("points_6.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/benchmark/Triangulation/generate_d.cpp b/Triangulation/benchmark/Triangulation/generate_d.cpp index 32f8da1a300..5ba73aa57a3 100644 --- a/Triangulation/benchmark/Triangulation/generate_d.cpp +++ b/Triangulation/benchmark/Triangulation/generate_d.cpp @@ -5,10 +5,10 @@ int main() { CGAL::Random rng; std::cout.precision(17); - std ::cout << 5 << std::endl; + std ::cout << 6 << std::endl; std::cout << 100000 << std::endl; for(int i = 0; i < 100000; ++i) { - std::array arr; + std::array arr; double slength = 0; for(int i = 0; i < arr.size(); ++i) { arr[i] = rng.get_double(-1, 1); @@ -18,7 +18,7 @@ int main() { for(int i = 0; i < arr.size(); ++i) { arr[i] /= slength; } - std::cout << "5 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] << " " << arr[4] << std::endl; + std::cout << "6 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] << " " << arr[4]<< " " << arr[5] << std::endl; } return 0; } From a9621595e59797fdd26e4975d14cc6cdd4f744fd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 13:42:44 +0100 Subject: [PATCH 033/145] Fixed code for 6D. For 100K points: 133 instead of 239 sec --- .../internal/Static_filters/Orientation_6.h | 9 +++++++-- .../include/CGAL/NewKernel_d/Cartesian_static_filters.h | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 7ad22e52128..562a4aedc1e 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -39,7 +39,11 @@ public: { CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp); - double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4; + double a01, a02, a03, a04, a05, a06, a11, a12, a13, a14, a15, a16, + a21, a22, a23, a24, a25, a26, a31, a32, a33, a34, a35, + a36, a41, a42, a43, a44, a45, a46, + a51, a52, a53, a54, a55, a56, + a61, a62, a63, a64, a65, a66; if (fit_in_double(p.c0(), a01) && fit_in_double(p.c1(), a02) && fit_in_double(p.c2(), a03) && fit_in_double(p.c3(), a04) && @@ -47,7 +51,7 @@ public: fit_in_double(q.c0(), a11) && fit_in_double(q.c1(), a12) && fit_in_double(q.c2(), a13) && fit_in_double(q.c3(), a14) && - fit_in_double(q.c4(), a15) && fit_in_double(q.c4(), a16) && + fit_in_double(q.c4(), a15) && fit_in_double(q.c5(), a16) && fit_in_double(r.c0(), a21) && fit_in_double(r.c1(), a22) && fit_in_double(r.c2(), a23) && fit_in_double(r.c3(), a24) && @@ -64,6 +68,7 @@ public: fit_in_double(u.c0(), a51) && fit_in_double(u.c1(), a52) && fit_in_double(u.c2(), a53) && fit_in_double(u.c3(), a54) && fit_in_double(u.c4(), a55) && fit_in_double(u.c5(), a56) && + fit_in_double(v.c0(), a61) && fit_in_double(v.c1(), a62) && fit_in_double(v.c2(), a63) && fit_in_double(v.c3(), a64) && fit_in_double(v.c4(), a65) && fit_in_double(v.c5(), a66)) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index 66be77c020d..67a2d84070a 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -218,8 +218,8 @@ template struct Adapter_6 { }; struct Orientation_6 { typedef typename Get_type::type result_type; - auto operator()(Point_5 const&A, Point6 const&B, Point6 const&C, - Point6 const&D, Point6 const&E, Point6 const&F, Point6 const&G)const{ + auto operator()(Point_6 const&A, Point_6 const&B, Point_6 const&C, + Point_6 const&D, Point_6 const&E, Point_6 const&F, Point_6 const&G)const{ Point const* t[7]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p,&G.p}; return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+7)); } @@ -230,7 +230,7 @@ template struct Orientation_of_points_6 : private Store_k typedef typename Get_type::type Point; typedef typename Get_type::type result_type; typedef typename Get_functor::type CC; - typedef Adapter_5 Adapter; + typedef Adapter_6 Adapter; template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ CC c(this->kernel()); Point const& A=*f; From 9e588e9b1adf0ec70c0600090202b15098eb1465 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 13:57:51 +0100 Subject: [PATCH 034/145] fabs > CGAL::abs --- .../internal/Static_filters/Orientation_6.h | 212 +++++++++--------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 562a4aedc1e..b647e238802 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -316,211 +316,211 @@ public: m0123456 = (((((((m012345 * a66) - (m012346 * a56)) + (m012356 * a46)) - (m012456 * a36)) + (m013456 * a26)) - (m023456 * a16)) + (m123456 * a06)); int int_tmp_result; double eps; - double max1 = fabs(a02); - if( (max1 < fabs(a12)) ) + double max1 = CGAL::abs(a02); + if( (max1 < CGAL::abs(a12)) ) { - max1 = fabs(a12); + max1 = CGAL::abs(a12); } - if( (max1 < fabs(a22)) ) + if( (max1 < CGAL::abs(a22)) ) { - max1 = fabs(a22); + max1 = CGAL::abs(a22); } - if( (max1 < fabs(a32)) ) + if( (max1 < CGAL::abs(a32)) ) { - max1 = fabs(a32); + max1 = CGAL::abs(a32); } - if( (max1 < fabs(a42)) ) + if( (max1 < CGAL::abs(a42)) ) { - max1 = fabs(a42); + max1 = CGAL::abs(a42); } - if( (max1 < fabs(a52)) ) + if( (max1 < CGAL::abs(a52)) ) { - max1 = fabs(a52); + max1 = CGAL::abs(a52); } - if( (max1 < fabs(a62)) ) + if( (max1 < CGAL::abs(a62)) ) { - max1 = fabs(a62); + max1 = CGAL::abs(a62); } - double max2 = fabs(a03); - if( (max2 < fabs(a13)) ) + double max2 = CGAL::abs(a03); + if( (max2 < CGAL::abs(a13)) ) { - max2 = fabs(a13); + max2 = CGAL::abs(a13); } - if( (max2 < fabs(a23)) ) + if( (max2 < CGAL::abs(a23)) ) { - max2 = fabs(a23); + max2 = CGAL::abs(a23); } - if( (max2 < fabs(a33)) ) + if( (max2 < CGAL::abs(a33)) ) { - max2 = fabs(a33); + max2 = CGAL::abs(a33); } - if( (max2 < fabs(a43)) ) + if( (max2 < CGAL::abs(a43)) ) { - max2 = fabs(a43); + max2 = CGAL::abs(a43); } - if( (max2 < fabs(a53)) ) + if( (max2 < CGAL::abs(a53)) ) { - max2 = fabs(a53); + max2 = CGAL::abs(a53); } - if( (max2 < fabs(a63)) ) + if( (max2 < CGAL::abs(a63)) ) { - max2 = fabs(a63); + max2 = CGAL::abs(a63); } - double max3 = fabs(a04); - if( (max3 < fabs(a14)) ) + double max3 = CGAL::abs(a04); + if( (max3 < CGAL::abs(a14)) ) { - max3 = fabs(a14); + max3 = CGAL::abs(a14); } - if( (max3 < fabs(a24)) ) + if( (max3 < CGAL::abs(a24)) ) { - max3 = fabs(a24); + max3 = CGAL::abs(a24); } - if( (max3 < fabs(a34)) ) + if( (max3 < CGAL::abs(a34)) ) { - max3 = fabs(a34); + max3 = CGAL::abs(a34); } - if( (max3 < fabs(a44)) ) + if( (max3 < CGAL::abs(a44)) ) { - max3 = fabs(a44); + max3 = CGAL::abs(a44); } - if( (max3 < fabs(a54)) ) + if( (max3 < CGAL::abs(a54)) ) { - max3 = fabs(a54); + max3 = CGAL::abs(a54); } - if( (max3 < fabs(a64)) ) + if( (max3 < CGAL::abs(a64)) ) { - max3 = fabs(a64); + max3 = CGAL::abs(a64); } - double max4 = fabs(a05); - if( (max4 < fabs(a15)) ) + double max4 = CGAL::abs(a05); + if( (max4 < CGAL::abs(a15)) ) { - max4 = fabs(a15); + max4 = CGAL::abs(a15); } - if( (max4 < fabs(a25)) ) + if( (max4 < CGAL::abs(a25)) ) { - max4 = fabs(a25); + max4 = CGAL::abs(a25); } - if( (max4 < fabs(a35)) ) + if( (max4 < CGAL::abs(a35)) ) { - max4 = fabs(a35); + max4 = CGAL::abs(a35); } - if( (max4 < fabs(a45)) ) + if( (max4 < CGAL::abs(a45)) ) { - max4 = fabs(a45); + max4 = CGAL::abs(a45); } - if( (max4 < fabs(a55)) ) + if( (max4 < CGAL::abs(a55)) ) { - max4 = fabs(a55); + max4 = CGAL::abs(a55); } - if( (max4 < fabs(a65)) ) + if( (max4 < CGAL::abs(a65)) ) { - max4 = fabs(a65); + max4 = CGAL::abs(a65); } - double max5 = fabs(a06); - if( (max5 < fabs(a16)) ) + double max5 = CGAL::abs(a06); + if( (max5 < CGAL::abs(a16)) ) { - max5 = fabs(a16); + max5 = CGAL::abs(a16); } - if( (max5 < fabs(a26)) ) + if( (max5 < CGAL::abs(a26)) ) { - max5 = fabs(a26); + max5 = CGAL::abs(a26); } - if( (max5 < fabs(a36)) ) + if( (max5 < CGAL::abs(a36)) ) { - max5 = fabs(a36); + max5 = CGAL::abs(a36); } - if( (max5 < fabs(a46)) ) + if( (max5 < CGAL::abs(a46)) ) { - max5 = fabs(a46); + max5 = CGAL::abs(a46); } - if( (max5 < fabs(a56)) ) + if( (max5 < CGAL::abs(a56)) ) { - max5 = fabs(a56); + max5 = CGAL::abs(a56); } - if( (max5 < fabs(a66)) ) + if( (max5 < CGAL::abs(a66)) ) { - max5 = fabs(a66); + max5 = CGAL::abs(a66); } - double max6 = fabs(m01); - if( (max6 < fabs(m02)) ) + double max6 = CGAL::abs(m01); + if( (max6 < CGAL::abs(m02)) ) { - max6 = fabs(m02); + max6 = CGAL::abs(m02); } - if( (max6 < fabs(m03)) ) + if( (max6 < CGAL::abs(m03)) ) { - max6 = fabs(m03); + max6 = CGAL::abs(m03); } - if( (max6 < fabs(m04)) ) + if( (max6 < CGAL::abs(m04)) ) { - max6 = fabs(m04); + max6 = CGAL::abs(m04); } - if( (max6 < fabs(m05)) ) + if( (max6 < CGAL::abs(m05)) ) { - max6 = fabs(m05); + max6 = CGAL::abs(m05); } - if( (max6 < fabs(m06)) ) + if( (max6 < CGAL::abs(m06)) ) { - max6 = fabs(m06); + max6 = CGAL::abs(m06); } - if( (max6 < fabs(m12)) ) + if( (max6 < CGAL::abs(m12)) ) { - max6 = fabs(m12); + max6 = CGAL::abs(m12); } - if( (max6 < fabs(m13)) ) + if( (max6 < CGAL::abs(m13)) ) { - max6 = fabs(m13); + max6 = CGAL::abs(m13); } - if( (max6 < fabs(m14)) ) + if( (max6 < CGAL::abs(m14)) ) { - max6 = fabs(m14); + max6 = CGAL::abs(m14); } - if( (max6 < fabs(m15)) ) + if( (max6 < CGAL::abs(m15)) ) { - max6 = fabs(m15); + max6 = CGAL::abs(m15); } - if( (max6 < fabs(m16)) ) + if( (max6 < CGAL::abs(m16)) ) { - max6 = fabs(m16); + max6 = CGAL::abs(m16); } - if( (max6 < fabs(m23)) ) + if( (max6 < CGAL::abs(m23)) ) { - max6 = fabs(m23); + max6 = CGAL::abs(m23); } - if( (max6 < fabs(m24)) ) + if( (max6 < CGAL::abs(m24)) ) { - max6 = fabs(m24); + max6 = CGAL::abs(m24); } - if( (max6 < fabs(m25)) ) + if( (max6 < CGAL::abs(m25)) ) { - max6 = fabs(m25); + max6 = CGAL::abs(m25); } - if( (max6 < fabs(m26)) ) + if( (max6 < CGAL::abs(m26)) ) { - max6 = fabs(m26); + max6 = CGAL::abs(m26); } - if( (max6 < fabs(m34)) ) + if( (max6 < CGAL::abs(m34)) ) { - max6 = fabs(m34); + max6 = CGAL::abs(m34); } - if( (max6 < fabs(m35)) ) + if( (max6 < CGAL::abs(m35)) ) { - max6 = fabs(m35); + max6 = CGAL::abs(m35); } - if( (max6 < fabs(m36)) ) + if( (max6 < CGAL::abs(m36)) ) { - max6 = fabs(m36); + max6 = CGAL::abs(m36); } - if( (max6 < fabs(m45)) ) + if( (max6 < CGAL::abs(m45)) ) { - max6 = fabs(m45); + max6 = CGAL::abs(m45); } - if( (max6 < fabs(m46)) ) + if( (max6 < CGAL::abs(m46)) ) { - max6 = fabs(m46); + max6 = CGAL::abs(m46); } - if( (max6 < fabs(m56)) ) + if( (max6 < CGAL::abs(m56)) ) { - max6 = fabs(m56); + max6 = CGAL::abs(m56); } double lower_bound_1; double upper_bound_1; From f75ddf8eda6e55d57a978be8c8f8572d7a18f343 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 24 Apr 2025 21:48:35 +0100 Subject: [PATCH 035/145] less abs() calls --- .../internal/Static_filters/Orientation_6.h | 252 +++++++++++------- 1 file changed, 152 insertions(+), 100 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index b647e238802..935b164645d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -317,211 +317,263 @@ public: int int_tmp_result; double eps; double max1 = CGAL::abs(a02); - if( (max1 < CGAL::abs(a12)) ) + double tmp = CGAL::abs(a12); + if( max1 < tmp ) { - max1 = CGAL::abs(a12); + max1 = tmp; } - if( (max1 < CGAL::abs(a22)) ) + tmp = CGAL::abs(a22); + if( max1 < tmp ) { - max1 = CGAL::abs(a22); + max1 = tmp; } - if( (max1 < CGAL::abs(a32)) ) + tmp = CGAL::abs(a32); + if( max1 < tmp) { - max1 = CGAL::abs(a32); + max1 = tmp; } - if( (max1 < CGAL::abs(a42)) ) + tmp = CGAL::abs(a42); + if( max1 < tmp) { - max1 = CGAL::abs(a42); + max1 = tmp; } - if( (max1 < CGAL::abs(a52)) ) + tmp = CGAL::abs(a52); + if(max1 < tmp ) { - max1 = CGAL::abs(a52); + max1 = tmp; } - if( (max1 < CGAL::abs(a62)) ) + tmp = CGAL::abs(a62); + if( (max1 < tmp) ) { - max1 = CGAL::abs(a62); + max1 = tmp; } double max2 = CGAL::abs(a03); - if( (max2 < CGAL::abs(a13)) ) + tmp = CGAL::abs(a13); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a13); + max2 = tmp; } - if( (max2 < CGAL::abs(a23)) ) + tmp = CGAL::abs(a23); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a23); + max2 = tmp; } - if( (max2 < CGAL::abs(a33)) ) + tmp = CGAL::abs(a33); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a33); + max2 = tmp; } - if( (max2 < CGAL::abs(a43)) ) + tmp = CGAL::abs(a43); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a43); + max2 = tmp; } - if( (max2 < CGAL::abs(a53)) ) + tmp = CGAL::abs(a53); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a53); + max2 = tmp; } - if( (max2 < CGAL::abs(a63)) ) + tmp = CGAL::abs(a63); + if( (max2 < tmp) ) { - max2 = CGAL::abs(a63); + max2 = tmp; } double max3 = CGAL::abs(a04); - if( (max3 < CGAL::abs(a14)) ) + tmp = CGAL::abs(a14); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a14); + max3 = tmp; } - if( (max3 < CGAL::abs(a24)) ) + tmp = CGAL::abs(a24); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a24); + max3 = tmp; } - if( (max3 < CGAL::abs(a34)) ) + tmp = CGAL::abs(a34); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a34); + max3 = tmp; } - if( (max3 < CGAL::abs(a44)) ) + tmp = CGAL::abs(a44); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a44); + max3 = tmp; } - if( (max3 < CGAL::abs(a54)) ) + tmp = CGAL::abs(a54); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a54); + max3 = tmp; } - if( (max3 < CGAL::abs(a64)) ) + tmp = CGAL::abs(a64); + if( (max3 < tmp) ) { - max3 = CGAL::abs(a64); + max3 = tmp; } double max4 = CGAL::abs(a05); - if( (max4 < CGAL::abs(a15)) ) + tmp = CGAL::abs(a15); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a15); + max4 = tmp; } - if( (max4 < CGAL::abs(a25)) ) + tmp = CGAL::abs(a25); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a25); + max4 = tmp; } - if( (max4 < CGAL::abs(a35)) ) + tmp = CGAL::abs(a35); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a35); + max4 = tmp; } - if( (max4 < CGAL::abs(a45)) ) + tmp = CGAL::abs(a45); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a45); + max4 = tmp; } - if( (max4 < CGAL::abs(a55)) ) + tmp = CGAL::abs(a55); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a55); + max4 = tmp; } - if( (max4 < CGAL::abs(a65)) ) + tmp = CGAL::abs(a65); + if( (max4 < tmp) ) { - max4 = CGAL::abs(a65); + max4 = tmp; } double max5 = CGAL::abs(a06); - if( (max5 < CGAL::abs(a16)) ) + tmp = CGAL::abs(a16); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a16); + max5 = tmp; } - if( (max5 < CGAL::abs(a26)) ) + tmp = CGAL::abs(a26); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a26); + max5 = tmp; } - if( (max5 < CGAL::abs(a36)) ) + tmp = CGAL::abs(a36); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a36); + max5 = tmp; } - if( (max5 < CGAL::abs(a46)) ) + tmp = CGAL::abs(a46); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a46); + max5 = tmp; } - if( (max5 < CGAL::abs(a56)) ) + tmp = CGAL::abs(a56); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a56); + max5 = tmp; } - if( (max5 < CGAL::abs(a66)) ) + tmp = CGAL::abs(a66); + if( (max5 < tmp) ) { - max5 = CGAL::abs(a66); + max5 = tmp; } + double max6 = CGAL::abs(m01); - if( (max6 < CGAL::abs(m02)) ) + tmp = CGAL::abs(m02); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m02); + max6 = tmp; } - if( (max6 < CGAL::abs(m03)) ) + tmp = CGAL::abs(m03); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m03); + max6 = tmp; } - if( (max6 < CGAL::abs(m04)) ) + tmp = CGAL::abs(m04); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m04); + max6 = tmp; } - if( (max6 < CGAL::abs(m05)) ) + tmp = CGAL::abs(m05); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m05); + max6 = tmp; } - if( (max6 < CGAL::abs(m06)) ) + tmp = CGAL::abs(m06); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m06); + max6 = tmp; } - if( (max6 < CGAL::abs(m12)) ) + tmp = CGAL::abs(m12); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m12); + max6 = tmp; } - if( (max6 < CGAL::abs(m13)) ) + tmp = CGAL::abs(m13); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m13); + max6 = tmp; } - if( (max6 < CGAL::abs(m14)) ) + tmp = CGAL::abs(m14); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m14); + max6 = tmp; } - if( (max6 < CGAL::abs(m15)) ) + tmp = CGAL::abs(m15); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m15); + max6 = tmp; } - if( (max6 < CGAL::abs(m16)) ) + tmp = CGAL::abs(m16); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m16); + max6 = tmp; } - if( (max6 < CGAL::abs(m23)) ) + tmp = CGAL::abs(m23); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m23); + max6 = tmp; } - if( (max6 < CGAL::abs(m24)) ) + tmp = CGAL::abs(m24); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m24); + max6 = tmp; } - if( (max6 < CGAL::abs(m25)) ) + tmp = CGAL::abs(m25); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m25); + max6 = tmp; } - if( (max6 < CGAL::abs(m26)) ) + tmp = CGAL::abs(m26); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m26); + max6 = tmp; } - if( (max6 < CGAL::abs(m34)) ) + tmp = CGAL::abs(m34); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m34); + max6 = tmp; } - if( (max6 < CGAL::abs(m35)) ) + tmp = CGAL::abs(m35); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m35); + max6 = tmp; } - if( (max6 < CGAL::abs(m36)) ) + tmp = CGAL::abs(m36); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m36); + max6 = tmp; } - if( (max6 < CGAL::abs(m45)) ) + tmp = CGAL::abs(m45); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m45); + max6 = tmp; } - if( (max6 < CGAL::abs(m46)) ) + tmp = CGAL::abs(m46); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m46); + max6 = tmp; } - if( (max6 < CGAL::abs(m56)) ) + tmp = CGAL::abs(m56); + if( (max6 < tmp) ) { - max6 = CGAL::abs(m56); + max6 = tmp; } + double lower_bound_1; double upper_bound_1; lower_bound_1 = max6; From a2cfa40a263a4ee4e88ae67220605a6ebddcd2c0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 25 Apr 2025 15:19:38 +0100 Subject: [PATCH 036/145] Add CGAL:: in a concept --- .../doc/Triangulation/Concepts/TriangulationDataStructure.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h index e12ab593ff7..e9d3d22a209 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h @@ -26,8 +26,8 @@ which is also the unique vertex and the unique full cell in the `TriangulationDataStructure`. In a geometric realization of the `TriangulationDataStructure` (e.g., in a -`Triangulation` or a -`Delaunay_triangulation`), this vertex +`CGAL::Triangulation` or a +`CGAL::Delaunay_triangulation`), this vertex corresponds to the vertex at infinity.
0
This corresponds to two vertices, each incident to one \f$ 0\f$-face; From 400c1da75147102ad4a90069ee9b90d1c1ed5c4f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 25 Apr 2025 17:26:18 +0100 Subject: [PATCH 037/145] In bench6.cpp add indices to the vertices, and report the edges on the convex hull --- .../benchmark/Triangulation/bench6d.cpp | 48 ++++++++++++++----- Triangulation/include/CGAL/Triangulation.h | 32 +++++++++++++ .../CGAL/Triangulation_data_structure.h | 2 + 3 files changed, 69 insertions(+), 13 deletions(-) diff --git a/Triangulation/benchmark/Triangulation/bench6d.cpp b/Triangulation/benchmark/Triangulation/bench6d.cpp index ee5aeae6547..a14dba4bed4 100644 --- a/Triangulation/benchmark/Triangulation/bench6d.cpp +++ b/Triangulation/benchmark/Triangulation/bench6d.cpp @@ -9,7 +9,7 @@ #include typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K; -typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_vertex Vertex; typedef CGAL::Triangulation_ds_full_cell DS_full_cell; typedef CGAL::Triangulation_full_cell Full_cell; typedef CGAL::Triangulation_data_structure, @@ -18,12 +18,12 @@ typedef CGAL::Triangulation_data_structure, typedef CGAL::Triangulation Triangulation; -int main() +int main(int argc, char* argv[]) { const int D = 6; // we work in Euclidean 6-space std::vector points; - std::ifstream in("points_6.txt"); + std::ifstream in(argv[1]); Triangulation::Point p; int d; in >> d; @@ -41,20 +41,42 @@ int main() assert(t.empty()); - t.insert(points.begin(), points.end()); // compute triangulation + t.insert_and_index(points.begin(), points.end()); // compute triangulation std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; timer.reset(); assert( t.is_valid() ); - // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 - typedef Triangulation::Face Face; - typedef std::vector Faces; - Faces edges; - std::back_insert_iterator out(edges); - t.tds().incident_faces(t.infinite_vertex(), 1, out); - // collect faces of dimension 1 (edges) incident to the infinite vertex - std::cout << "There are " << edges.size() - << " vertices on the convex hull." << std::endl; + + std::vector infinite_cells; + t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells)); + + std::set> edges; + + for(auto ch : infinite_cells) { + std::vector vertices; + std::cout << "cell" << std::endl; + vertices.reserve(D); + for(int i = 0; i < D + 1; ++i) { + if(ch->vertex(i) != t.infinite_vertex()) { + vertices.push_back(ch->vertex(i)); + std::cout << ch->vertex(i)->data() << " "; + } + } + std::cout << std::endl; + for (int i = 0; i < D-1; i++) { + for (int j = 0; j < D-1; j++) { + + if((i != j) && (vertices[i]->data() < vertices[j]->data())) { + edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data())); + } + } + } + } + for(auto pair : edges) { + std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl; + } + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; } \ No newline at end of file diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 10d71f3b549..8271cdb27c5 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include // for CGAL::Identity_property_map #include #include #include @@ -683,6 +685,36 @@ public: } return number_of_vertices() - n; } + + + template< typename RandomAccessIterator > + size_type insert_and_index(RandomAccessIterator start, RandomAccessIterator end) + { + size_type n = number_of_vertices(); + std::vector indices(boost::counting_iterator(0), + boost::counting_iterator(end - start)); + + using Point_property_map = boost::iterator_property_map>; + using Search_traits_d = CGAL::Spatial_sort_traits_adapter_d; + + CGAL::spatial_sort(indices.begin(), indices.end(), Search_traits_d(start)); + std::vector points(start, end); + spatial_sort(points.begin(), points.end(), geom_traits()); + Full_cell_handle hint = Full_cell_handle(); + + for (auto index : indices) { + typename Triangulation::Vertex_handle pos = insert(*(start+index), hint); + if (pos != nullptr) { + // Save index value as data to retrieve it after insertion + pos->data() = n+index; + hint = pos->full_cell(); + } + } + return number_of_vertices() - n; + } + + Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle); Vertex_handle insert(const Point &, Full_cell_handle start = Full_cell_handle()); Vertex_handle insert(const Point &, Vertex_handle); diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index dfd59e7b978..37fbd8914e9 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -33,6 +33,8 @@ #include #include +#include + namespace CGAL { template< class Dimen, From 338b31bf32c8197bf4899feeb24dd9aa40f0d992 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 28 Apr 2025 12:07:16 +0100 Subject: [PATCH 038/145] Add dependency --- Triangulation/package_info/Triangulation/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Triangulation/package_info/Triangulation/dependencies b/Triangulation/package_info/Triangulation/dependencies index c7893bd09b0..b13119b12fe 100644 --- a/Triangulation/package_info/Triangulation/dependencies +++ b/Triangulation/package_info/Triangulation/dependencies @@ -6,6 +6,7 @@ Kernel_23 Modular_arithmetic Number_types Profiling_tools +Property_map Random_numbers STL_Extension Spatial_sorting From 9a134d21457b1d6a07338a30e42fe70af15fefc4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 28 Apr 2025 15:39:43 +0100 Subject: [PATCH 039/145] Adress some items of Issue #8802 --- Triangulation/benchmark/Triangulation/bench6d.cpp | 1 + Triangulation/doc/Triangulation/CGAL/Triangulation.h | 2 +- .../doc/Triangulation/Concepts/TriangulationDataStructure.h | 6 +++--- Triangulation/include/CGAL/Triangulation_data_structure.h | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Triangulation/benchmark/Triangulation/bench6d.cpp b/Triangulation/benchmark/Triangulation/bench6d.cpp index a14dba4bed4..90fc41c680a 100644 --- a/Triangulation/benchmark/Triangulation/bench6d.cpp +++ b/Triangulation/benchmark/Triangulation/bench6d.cpp @@ -50,6 +50,7 @@ int main(int argc, char* argv[]) std::vector infinite_cells; t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells)); + return 0; std::set> edges; for(auto ch : infinite_cells) { diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation.h b/Triangulation/doc/Triangulation/CGAL/Triangulation.h index 32188c44323..49ffb246f1c 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation.h @@ -520,7 +520,7 @@ position `p`. Returns a handle to that vertex. \pre The boundary of the union of full cells incident to `f` must be a triangulation of a sphere of dimension `tr`.`current_dimension()`). */ -Vertex_handle collapse_face(const Point & p, const Face & f); +Vertex_handle contract_face(const Point & p, const Face & f); /// @} diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h index e9d3d22a209..370bbad3e8e 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h @@ -456,14 +456,14 @@ Insertion in a hole, \f$ d=2\f$ \cgalAdvancedEnd */ template< class ForwardIterator > Vertex_handle -insert_in_hole(ForwardIterator start, ForwardIterator end, Facet f); +insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f); /*! Same as above, but handles to the new full cells are appended to the `out` output iterator. */ template< class ForwardIterator, class OutputIterator > -Vertex_handle insert_in_hole(ForwardIterator start, ForwardIterator end, Facet +Vertex_handle insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f, OutputIterator out); /*! @@ -594,7 +594,7 @@ Calls `delete_full_cell` over an iterator range of value type `Full_cell_handle` \cgalAdvancedEnd */ template< typename ForwardIterator > void -delete_full_cells(ForwardIterator start, ForwardIterator end); +delete_full_cells(ForwardIterator s, ForwardIterator e); /// @} diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 37fbd8914e9..10e71e9178e 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -309,10 +309,10 @@ public: return s->mirror_index(i); } - int mirror_vertex(Full_cell_handle s, int i) const /* Concept */ + Vertex_handle mirror_vertex(Full_cell_handle s, int i) const /* Concept */ { CGAL_precondition(Full_cell_handle() != s && check_range(i)); - return s->mirror_vertex(i); + return s->mirror_vertex(i, current_dimension); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS From 6b729748e1794ef27ae16545f3d4e5285ff4fccd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 28 Apr 2025 16:09:13 +0100 Subject: [PATCH 040/145] Adress some items of Issue #8802 --- Triangulation/include/CGAL/Triangulation_data_structure.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 10e71e9178e..1e35253f466 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -368,7 +368,7 @@ protected: public: // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS - Vertex_handle collapse_face(const Face &); /* Concept */ + Vertex_handle contract_face(const Face &); /* Concept */ void remove_decrease_dimension(Vertex_handle, Vertex_handle); /* Concept */ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS @@ -784,7 +784,7 @@ Triangulation_data_structure template typename Triangulation_data_structure::Vertex_handle Triangulation_data_structure -::collapse_face(const Face & f) /* Concept */ +::contract_face(const Face & f) /* Concept */ { const int fd = f.face_dimension(); CGAL_precondition( (1 <= fd ) && (fd < current_dimension())); From 51d035d9d9d560fb63a1c012b1ba2325e9d6eefc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 28 Apr 2025 16:23:27 +0100 Subject: [PATCH 041/145] 'Fix' in an untested function --- Triangulation/include/CGAL/Triangulation_data_structure.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 1e35253f466..8b45ccaa6e9 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -790,7 +790,7 @@ Triangulation_data_structure CGAL_precondition( (1 <= fd ) && (fd < current_dimension())); std::vector simps; // save the Face's vertices: - Full_cell s; + Full_cell s(current_dimension); for( int i = 0; i <= fd; ++i ) s.set_vertex(i, f.vertex(i)); // compute the star of f From c63c2a24e2afa83277b4107489267b9d9ff8f966 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 14:51:31 +0100 Subject: [PATCH 042/145] Activate Leo's code --- .../edge_collapse_bounded_normal_change.cpp | 5 ++-- .../include/CGAL/Cartesian/MatrixC33.h | 23 ++++++++++--------- .../internal/Lindstrom_Turk_core.h | 16 ++++++------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index 04561d2239c..e4d0de6ed33 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -36,8 +37,8 @@ int main(int argc, char** argv) { Surface_mesh surface_mesh; const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/fold.off"); - std::ifstream is(filename); - if(!is || !(is >> surface_mesh)) + + if(!CGAL::IO::read_polygon_mesh(filename, surface_mesh)) { std::cerr << "Failed to read input mesh: " << filename << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 70399434bb2..b2b3d59f51b 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -220,19 +220,19 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) if(! CGAL_NTS is_zero(det)) { +#if 1 + RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; + RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; + RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; - // RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; - // RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; - // RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; - - // RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; - // RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; - // RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; - - // RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; - // RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; - // RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; + RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; + RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; + RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; + RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; + RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; + RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; +#else RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det; RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det; RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det; @@ -244,6 +244,7 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) RT c20 = (m.r1().x()*m.r2().y() - m.r2().x()*m.r1().y()) / det; RT c21 = (m.r2().x()*m.r0().y() - m.r0().x()*m.r2().y()) / det; RT c22 = (m.r0().x()*m.r1().y() - m.r0().y()*m.r1().x()) / det; +#endif rInverse = result_type(Matrix(c00,c01,c02, c10,c11,c12, diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index d9ea2691883..df70aabd1c1 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -319,7 +319,7 @@ LindstromTurkCore:: extract_triangle_data() { mTriangle_data.reserve(mProfile.triangles().size()); - + maxBb = 0.0; for(const Triangle& tri : mProfile.triangles()) { const Point_reference p0 = get_point(tri.v0); @@ -327,9 +327,9 @@ extract_triangle_data() const Point_reference p2 = get_point(tri.v2); //TODO for obscur reason, computing this maxBb increase running time by 10% - maxBb=(std::max)({maxBb,std::abs(p0.x()),std::abs(p0.y()),std::abs(p0.z()), - std::abs(p1.x()),std::abs(p1.y()),std::abs(p1.z()), - std::abs(p2.x()),std::abs(p2.y()),std::abs(p2.z())}); + maxBb=(std::max)({maxBb,CGAL::abs(p0.x()),CGAL::abs(p0.y()),CGAL::abs(p0.z()), + CGAL::abs(p1.x()),CGAL::abs(p1.y()),CGAL::abs(p1.z()), + CGAL::abs(p2.x()),CGAL::abs(p2.y()),CGAL::abs(p2.z())}); Vector v01 = p1 - p0; Vector v02 = p2 - p0; @@ -342,6 +342,7 @@ extract_triangle_data() mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL)); } + maxBb *= 2.0; // to avoid numerical problems } template @@ -659,11 +660,10 @@ add_constraint_if_alpha_compatible(const Vector& Ai, FT l = CGAL_NTS sqrt(slai); CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l)); - // Due to double number type, l may have a small value instead of zero (example sum of the faces normals of a tetrahedra for volumic constraint) + // Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volumic constraint) // if bi is greater than maxBb, we consider that l is zero - CGAL_SMS_LT_TRACE(3, " error consider: " << (std::abs(bi) / (2*maxBb))); - if(l > (std::abs(bi) / (2*maxBb))) - // if(!CGAL_NTS is_zero(l)) + CGAL_SMS_LT_TRACE(3, " error consider: " << (CGAL::abs(bi) / maxBb)); + if(l > (std::abs(bi) / maxBb)) { Vector Ain = Ai / l; FT bin = bi / l; From 0f86fa6d23f0ace24f75437f84b18e62edfb43ce Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 15:20:14 +0100 Subject: [PATCH 043/145] clean up in the cross product alternatives --- .../include/CGAL/Cartesian/CrossProduct.h | 1 + .../internal/Lindstrom_Turk_core.h | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h index ebaed862213..bde522d5930 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h @@ -52,6 +52,7 @@ namespace CGAL { return a*b - c*d; } + } // namespace CGAL #endif // CGAL_CARTESIAN_CROSSPRODUCT_H // diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index df70aabd1c1..d11e1eaf931 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -152,7 +152,8 @@ private : } #endif - static Vector SL_cross_product(const Vector& a, const Vector& b) + // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates + static Vector robust_cross_product(const Vector& a, const Vector& b) { const FT ax=a.x(), ay=a.y(), az=a.z(); const FT bx=b.x(), by=b.y(), bz=b.z(); @@ -184,9 +185,10 @@ private : exv.exact(); return to_approx(exv); } -#endif - static Vector X_product(const Vector& u, const Vector& v) + + + static Vector experimental_cross_product(const Vector& u, const Vector& v) { #if 0 // this can create large errors and spiky meshes for kernels with inexact constructions @@ -201,18 +203,18 @@ private : return { diff_of_products(u.y(), v.z(), u.z(), v.y()), diff_of_products(u.z(), v.x(), u.x(), v.z()), diff_of_products(u.x(), v.y(), u.y(), v.x()) }; -#elif 1 - // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates - return SL_cross_product(u, v); #elif 0 // obviously too slow return exact_cross_product(u, v); #endif } +#endif + + static Vector point_cross_product(const Point& a, const Point& b) { - return X_product(a-ORIGIN, b-ORIGIN); + return robust_cross_product(a-ORIGIN, b-ORIGIN); } // This is the (uX)(Xu) product described in the Lindstrom-Turk paper @@ -334,7 +336,7 @@ extract_triangle_data() Vector v01 = p1 - p0; Vector v02 = p2 - p0; - Vector lNormalV = X_product(v01,v02); + Vector lNormalV = robust_cross_product(v01,v02); FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN); CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2 @@ -660,10 +662,10 @@ add_constraint_if_alpha_compatible(const Vector& Ai, FT l = CGAL_NTS sqrt(slai); CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l)); - // Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volumic constraint) + // Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volume constraint) // if bi is greater than maxBb, we consider that l is zero CGAL_SMS_LT_TRACE(3, " error consider: " << (CGAL::abs(bi) / maxBb)); - if(l > (std::abs(bi) / maxBb)) + if(l > (CGAL::abs(bi) / maxBb)) { Vector Ain = Ai / l; FT bin = bi / l; From 6acfaaedac8774103d10775b8045ed0b4ab0a1a5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 15:37:41 +0100 Subject: [PATCH 044/145] fix minor --- .../Edge_collapse/internal/Lindstrom_Turk_core.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index d11e1eaf931..e45d198b1ed 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -155,10 +155,14 @@ private : // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates static Vector robust_cross_product(const Vector& a, const Vector& b) { - const FT ax=a.x(), ay=a.y(), az=a.z(); - const FT bx=b.x(), by=b.y(), bz=b.z(); + const FT& ax=a.x(); + const FT& ay=a.y(); + const FT& az=a.z(); + const FT& bx=b.x(); + const FT& by=b.y(); + const FT& bz=b.z(); - auto minor = [](auto ai, auto bi, auto aj, auto bj) + auto minor = [](const FT& ai, const FT& bi, const FT& aj, const FT& bj) { // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude // since this function is used to compute the cross product of two vectors that are defined From b6e9acb9d31e2f99e2ed1735ad844e4f9e148509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Wed, 11 Jun 2025 10:42:36 +0200 Subject: [PATCH 045/145] add a min circum circle algorithmm of elziga end hearn instead of naive one --- .../Polygon_mesh_processing/compute_normal.h | 204 ++++++++++++++++-- 1 file changed, 191 insertions(+), 13 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index 53c7a1e9cfa..ff75bed1c81 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -278,6 +278,7 @@ template bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const std::size_t k, const typename K::Vector_3& nb, const typename K::FT sp_bi, + typename boost::graph_traits::face_descriptor ¬_enclose_normal, const std::vector::face_descriptor>& incident_faces, const FaceNormalVector& face_normals, const K& traits) @@ -291,6 +292,7 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const // check that this min circle defined by the diameter contains the other points const std::size_t nif = incident_faces.size(); + bool enclose_other_normals=true; for(std::size_t l=0; l @@ -394,6 +403,7 @@ compute_most_visible_normal_2_points(std::vector::reference Vector_ref; + typedef typename boost::graph_traits::face_descriptor face_descriptor; typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object(); @@ -424,7 +434,8 @@ compute_most_visible_normal_2_points(std::vector(i, j, -1 /*NA*/, nb, sp_bi, incident_faces, face_normals, traits)) + face_descriptor dummy; + if(!does_enclose_other_normals(i, j, -1 /*NA*/, nb, sp_bi, dummy, incident_faces, face_normals, traits)) continue; min_sp = sp_bi; @@ -444,6 +455,7 @@ compute_most_visible_normal_3_points(const std::vector::reference Vector_ref; + typedef typename boost::graph_traits::face_descriptor face_descriptor; #ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP std::cout << "Trying to find enclosing normal with 3 normals" << std::endl; @@ -481,7 +493,8 @@ compute_most_visible_normal_3_points(const std::vector(i, j, k, nb, sp_bi, incident_faces, face_normals, traits)) + face_descriptor dummy; + if(!does_enclose_other_normals(i, j, k, nb, sp_bi, dummy, incident_faces, face_normals, traits)) continue; min_sp = sp_bi; @@ -501,6 +514,156 @@ compute_most_visible_normal_3_points(const std::vector typename GT::Vector_3 compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits::vertex_descriptor v, + const FaceNormalVector& face_normals, + const PolygonMesh& pmesh, + const GT& traits){ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + typedef typename GT::FT FT; + typedef typename GT::Vector_3 Vector_3; + typedef typename boost::property_traits::reference Vector_ref; + + typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); + typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object(); + typename GT::Construct_cross_product_vector_3 cp_3 = traits.construct_cross_product_vector_3_object(); + + std::vector incident_faces; + incident_faces.reserve(8); + for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) + { + if((f == boost::graph_traits::null_face()) || (get(face_normals, f)==NULL_VECTOR) ) + continue; + + if(! incident_faces.empty()){ + if(get(face_normals, incident_faces.back()) == get(face_normals, f) ) + continue; + } + incident_faces.push_back(f); + } + if(incident_faces.size() == 0) + return NULL_VECTOR; + if(incident_faces.size() == 1) + return get(face_normals, incident_faces.front()); + + boost::container::small_vector circum_points; + circum_points.push_back(incident_faces[0]); + circum_points.push_back(incident_faces[1]); + //Get the farthest point to circum_points[0] + const Vector_ref n0 = get(face_normals, circum_points[0]); + const Vector_ref n1 = get(face_normals, circum_points[1]); + FT sp_min = sp_3(n0, n1); + for(size_t i=2; i(-1,-2,-3,center, radius, f_out, incident_faces, face_normals, traits)) + return center; + circum_points.push_back(f_out); + + //Delete one vertex if include in circum circle of the two others + const Vector_ref nk = get(face_normals, circum_points[2]); + Vector_3 center_ni_nk = compute_normals_bisector(ni, nk, traits); + Vector_3 center_nj_nk = compute_normals_bisector(nj, nk, traits); + if(sp_3(center_ni_nk, nj) > sp_3(center_ni_nk, ni) ){ + std::swap(circum_points[1],circum_points[2]); + circum_points.pop_back(); + } else if(sp_3(center_nj_nk, ni) > sp_3(center_nj_nk, nj) ){ + std::swap(circum_points[0],circum_points[2]); + circum_points.pop_back(); + } + + } else { + const Vector_ref ni = get(face_normals, circum_points[0]); + const Vector_ref nj = get(face_normals, circum_points[1]); + const Vector_ref nk = get(face_normals, circum_points[2]); + center = compute_normals_bisector(ni, nj, nk, traits); + radius = sp_3(ni, center); + if(is_negative(radius)) + return NULL_VECTOR; // Not normal visible by all + face_descriptor f_out; + if(does_enclose_other_normals(-1,-2,-3,center, radius, f_out, incident_faces, face_normals, traits)){ + return center; + } + + const Vector_ref no= get(face_normals, f_out); + if(is_negative(sp_3(center, no))) + return NULL_VECTOR; // Not normal visible by all + // move the farthest point to f at the beginning of circum_points + FT sp_ni_no = sp_3(ni, no); + FT sp_nj_no = sp_3(nj, no); + FT sp_nk_no = sp_3(nk, no); + + if(sp_nj_no < sp_nk_no){ + if(sp_nj_no < sp_ni_no){ + std::swap(circum_points[0], circum_points[1]); + } + } else { + if(sp_nk_no < sp_ni_no){ + std::swap(circum_points[0], circum_points[2]); + } + } + + // Get the new vector + const Vector_ref n0 = get(face_normals, circum_points[0]); + const Vector_ref n1 = get(face_normals, circum_points[1]); + const Vector_ref n2 = get(face_normals, circum_points[2]); + + // Search the point that are on the same side of f compare to ni + Vector_3 n_middle = cp_3(n0, center); + FT sp_no_nm = sp_3(no, n_middle); + FT sp_n1_nm = sp_3(n1, n_middle); + FT sp_n2_nm = sp_3(n2, n_middle); + CGAL_assertion((CGAL::sign(sp_n1_nm)!=CGAL::sign(sp_n2_nm)) || is_zero(sp_n1_nm)); + if( CGAL::sign(sp_no_nm) == CGAL::sign(sp_n1_nm)){ + circum_points[1]=f_out; + } else { + circum_points[2]=f_out; + } + + const Vector_ref ni2 = get(face_normals, circum_points[1]); + const Vector_ref nj2 = get(face_normals, circum_points[1]); + const Vector_ref nk2 = get(face_normals, circum_points[2]); + + //Delete one vertex if include in circum circle of the two others + Vector_3 center_ni_nj = compute_normals_bisector(ni2, nj2, traits); + Vector_3 center_ni_nk = compute_normals_bisector(ni2, nk2, traits); + Vector_3 center_nj_nk = compute_normals_bisector(nj2, nk2, traits); + if(sp_3(center_ni_nj, nk2) > sp_3(center_ni_nj, ni2) ){ + circum_points.pop_back(); + } else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2) ){ + std::swap(circum_points[1],circum_points[2]); + circum_points.pop_back(); + } else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2) ){ + std::swap(circum_points[0],circum_points[2]); + circum_points.pop_back(); + } + + } + } +} + +// Inspired by Aubry et al. On the most 'normal' normal +template +typename GT::Vector_3 +compute_vertex_normal_most_visible_min_circle_old(typename boost::graph_traits::vertex_descriptor v, const FaceNormalVector& face_normals, const PolygonMesh& pmesh, const GT& traits) @@ -509,31 +672,32 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits incident_faces; incident_faces.reserve(8); for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) { - if(f == boost::graph_traits::null_face()) + if((f == boost::graph_traits::null_face()) || (get(face_normals, f)==NULL_VECTOR) ) continue; if(! incident_faces.empty()){ - if((get(face_normals, incident_faces.back()) == get(face_normals, f)) ) + if(get(face_normals, incident_faces.back()) == get(face_normals, f) ) continue; - auto aa = approximate_angle(get(face_normals, incident_faces.back()) ,get(face_normals, f)); - if(aa < bound) - continue; + // auto aa = approximate_angle(get(face_normals, incident_faces.back()) ,get(face_normals, f)); + // if(aa < bound) + // continue; } incident_faces.push_back(f); } + if(incident_faces.size() == 0) + return NULL_VECTOR; if(incident_faces.size() == 1) return get(face_normals, incident_faces.front()); Vector_3 res = compute_most_visible_normal_2_points(incident_faces, face_normals, traits); - if(res != CGAL::NULL_VECTOR) // found a valid normal through 2 point min circle return res; @@ -737,8 +901,22 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript std::cout << "get normal at f " << face(h, pmesh) << " : " << get(face_normals, face(h, pmesh)) << std::endl; } #endif - Vector_3 normal = internal::compute_vertex_normal_most_visible_min_circle(v, face_normals, pmesh, traits); + Vector_3 normal_old = internal::compute_vertex_normal_most_visible_min_circle_old(v, face_normals, pmesh, traits); + if(!traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) + internal::normalize(normal, traits); + if(!traits.equal_3_object()(normal_old, CGAL::NULL_VECTOR)) + internal::normalize(normal_old, traits); + if( ((normal-normal_old).squared_length()>=0.01) ){ + std::cout << "Different normals found by the two methods" << std::endl; + std::cout << "brute force: " << normal_old << std::endl; + std::cout << "n^2 methods: " << normal << std::endl; + std::cout << "incident faces:" << std::endl; + for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) + std::cout << f << ": " << get(face_normals, f) << std::endl; + std::cout << std::endl; + } + // CGAL_assertion(((normal==normal_old) || ((normal-normal_old).squared_length()<0.0001) || (normal==NULL_VECTOR))); if(traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) // can't always find a most visible normal { #ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP From 69a00534f8c41131341c12dd9478c34c9c8d4bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Wed, 11 Jun 2025 11:24:26 +0200 Subject: [PATCH 046/145] Solve bug in compute normals --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index ff75bed1c81..c1b0dc61f8f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -638,7 +638,7 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits Date: Wed, 18 Jun 2025 16:44:27 +0200 Subject: [PATCH 047/145] reset depth when updating exact --- Filtered_kernel/include/CGAL/Lazy.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index f62e70e6dc0..80b0b8640f3 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -233,14 +233,14 @@ print_dag(const Return_base_tag&, std::ostream& os, int level) struct Depth_base { #ifdef CGAL_PROFILE - int depth_; + mutable int depth_; Depth_base() : depth_(0) {} int depth() const { return depth_; } - void set_depth(int i) + void set_depth(int i) const { depth_ = i; CGAL_HISTOGRAM_PROFILER(std::string("[Lazy_kernel DAG depths]"), i); @@ -248,7 +248,7 @@ struct Depth_base { } #else int depth() const { return 0; } - void set_depth(int) {} + void set_depth(int) const {} #endif }; @@ -660,6 +660,7 @@ class Lazy_rep_n final : auto* p = new typename Base::Indirect(ec()( CGAL::exact( std::get(l) ) ... ) ); this->set_at(p); this->set_ptr(p); + this->set_depth(0); if(!noprune || is_currently_single_threaded()) lazy_reset_member(l); } From ecd2ed13f883efffdbde4b49aab8e71ff389fbdd Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 19 Jun 2025 15:01:45 +0200 Subject: [PATCH 048/145] add a test for determinism of Tetrahedral_remeshing --- .../test/Tetrahedral_remeshing/CMakeLists.txt | 1 + ...test_tetrahedral_remeshing_determinism.cpp | 102 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index 63bc0c06023..3747ae19125 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -16,6 +16,7 @@ create_single_source_cgal_program("test_tetrahedral_remeshing_with_features.cpp" create_single_source_cgal_program("test_tetrahedral_remeshing_of_one_subdomain.cpp") create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp") create_single_source_cgal_program("test_tetrahedral_remeshing_from_mesh_file.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_determinism.cpp") # Test MLS projection add_executable(test_tetrahedral_remeshing_mls diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp new file mode 100644 index 00000000000..024b1f325d5 --- /dev/null +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp @@ -0,0 +1,102 @@ +//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE +//#define CGAL_TETRAHEDRAL_REMESHING_DEBUG +//#define CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + +typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3 Remeshing_triangulation; + +template +void generate_input_one_subdomain(const std::size_t nbv, T3& tr) +{ + CGAL::Random rng; + + typedef typename T3::Point Point; + std::vector pts; + while (pts.size() < nbv) + { + const float x = rng.uniform_real(-10.f, 10.f); + const float y = rng.uniform_real(-10.f, 10.f); + const float z = rng.uniform_real(-10.f, 10.f); + + pts.push_back(Point(x, y, z)); + } + tr.insert(pts.begin(), pts.end()); + + for (typename T3::Cell_handle c : tr.finite_cell_handles()) + c->set_subdomain_index(1); + + assert(tr.is_valid(true)); + +#ifdef CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES + std::ofstream out("data/triangulation_one_subdomain.binary.cgal", + std::ios_base::out | std::ios_base::binary); + CGAL::save_binary_triangulation(out, tr); + out.close(); +#endif +} + +int main(int argc, char* argv[]) +{ + std::cout << "CGAL Random seed = " << CGAL::get_default_random().get_seed() << std::endl; + + // Collect options + std::size_t nb_runs = 5; + + Remeshing_triangulation tr; + generate_input_one_subdomain(1000, tr); + + const int target_edge_length = (argc > 1) ? atoi(argv[1]) : 1; + + std::ofstream ofs0("in.mesh"); + CGAL::IO::write_MEDIT(ofs0, tr); + ofs0.close(); + + Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison + + std::vector output_tr; + output_tr.reserve(nb_runs); + + for(std::size_t i = 0; i < nb_runs; ++i) + { + std::cout << "Run " << i << " of " << nb_runs << std::endl; + + tr = tr_ref; // Reset triangulation to reference + CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length); + + std::ostringstream oss; + CGAL::IO::write_MEDIT(oss, tr); + output_tr.push_back(oss.str()); + oss.clear(); + + if(i == 0) + continue; // skip first run, it is the reference + else + { + if(0 != output_tr[i-1].compare(output_tr[i])) + { + std::cerr << "Run " << i << " differs from run " << i-1 << std::endl; + assert(false); // This should not happen + } + else + { + std::cout << "Run " << i << " is identical to run " << i-1 << std::endl; + } + } + } + + return EXIT_SUCCESS; +} From fcf02c4cebf9d4ebb56025bfd8e193fe34be4104 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 20 Jun 2025 14:22:50 +0200 Subject: [PATCH 049/145] make tetrahedral_remeshing deterministic * use make_vertex_pair(edge) for ordered pair * do not move vertices in the order of the unordered_map m_vertex_id, but in the order of vertices_iterator, which is deterministic. To do so, add struct Move that embeds all the needed data to compute the move AND avoid computing twice the same midpoint --- .../internal/smooth_vertices.h | 97 ++++++++++--------- .../internal/tetrahedral_remeshing_helpers.h | 13 +-- 2 files changed, 57 insertions(+), 53 deletions(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index fd9981c1426..cf73ab88891 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -91,6 +91,13 @@ private: std::vector m_free_vertices{}; bool m_flip_smooth_steps{false}; + struct Move + { + Vector_3 move; + int neighbors; + FT mass; + }; + public: Tetrahedral_remeshing_smoother(const SizingFunction& sizing, const CellSelector& cell_selector, @@ -627,8 +634,8 @@ private: const C3t3& c3t3, const bool boundary_edge = false) const { - const auto mwi = midpoint_with_info(e, boundary_edge, c3t3); - const FT s = sizing_at_midpoint(e, mwi.dim, mwi.index, m_sizing, c3t3, m_cell_selector); + const auto [pt, dim, index] = midpoint_with_info(e, boundary_edge, c3t3); + const FT s = sizing_at_midpoint(e, pt, dim, index, m_sizing, c3t3, m_cell_selector); const FT density = 1. / s; //density = 1 / size^(dimension) //edge dimension is 1, so density = 1 / size //to have mass = length * density with no dimension @@ -655,9 +662,8 @@ private: auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0); - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); //collect neighbors for (const Edge& e : c3t3.edges_in_complex()) @@ -683,33 +689,35 @@ private: if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); + if (!is_free(vid) || !is_on_feature(v)) continue; const Point_3 current_pos = point(v->point()); - const std::size_t nb_neighbors = neighbors[vid]; + const std::size_t nb_neighbors = moves[vid].neighbors; if(nb_neighbors == 0) continue; - CGAL_assertion(masses[vid] > 0); + CGAL_assertion(moves[vid].mass > 0); const Vector_3 move = (nb_neighbors > 0) - ? moves[vid] / masses[vid] + ? moves[vid].move / moves[vid].mass : CGAL::NULL_VECTOR; const Point_3 smoothed_position = current_pos + move; @@ -771,9 +779,8 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0); - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); for (const Edge& e : tr.finite_edges()) { @@ -797,26 +804,28 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); + if (!is_free(vid) || v->in_dimension() != 2) continue; - const std::size_t nb_neighbors = neighbors[vid]; + const std::size_t nb_neighbors = moves[vid].neighbors; const Point_3 current_pos = point(v->point()); const auto& incident_surface_patches = vertices_surface_indices.at(v); @@ -830,7 +839,7 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3, if (nb_neighbors > 1) { - const Vector_3 move = moves[vid] / masses[vid]; + const Vector_3 move = moves[vid].move / moves[vid].mass; const Point_3 smoothed_position = point(v->point()) + move; #ifdef CGAL_TET_REMESHING_SMOOTHING_WITH_MLS @@ -969,9 +978,9 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, auto& tr = c3t3.triangulation(); const std::size_t nbv = tr.number_of_vertices(); - std::vector moves(nbv, CGAL::NULL_VECTOR); - std::vector neighbors(nbv, 0);/*for dim 3 vertices, start counting directly from 0*/ - std::vector masses(nbv, 0.); + const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/}; + std::vector moves(nbv, default_move); + /*for dim 3 vertices, start counting neighbors directly from 0*/ for (const Edge& e : tr.finite_edges()) { @@ -979,8 +988,7 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, continue; else { - const Vertex_handle vh0 = e.first->vertex(e.second); - const Vertex_handle vh1 = e.first->vertex(e.third); + const auto [vh0, vh1] = make_vertex_pair(e); const std::size_t& i0 = vertex_id(vh0); const std::size_t& i1 = vertex_id(vh1); @@ -997,31 +1005,32 @@ std::size_t smooth_internal_vertices(C3t3& c3t3, if (vh0_moving) { - moves[i0] += density * Vector_3(p0, p1); - neighbors[i0]++; - masses[i0] += density; + moves[i0].move += density * Vector_3(p0, p1); + moves[i0].mass += density; + ++moves[i0].neighbors; } if (vh1_moving) { - moves[i1] += density * Vector_3(p1, p0); - neighbors[i1]++; - masses[i1] += density; + moves[i1].move += density * Vector_3(p1, p0); + moves[i1].mass += density; + ++moves[i1].neighbors; } } } - // iterate over map of - for (auto [v, vid] : m_vertex_id) + // iterate over vertices and move + for(Vertex_handle v : tr.finite_vertex_handles()) { + const std::size_t vid = vertex_id(v); if (!is_free(vid)) continue; - if (c3t3.in_dimension(v) == 3 && neighbors[vid] > 1) + if (c3t3.in_dimension(v) == 3 && moves[vid].neighbors > 1) { #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_vol << "2 " << point(v->point()); #endif - const Vector_3 move = moves[vid] / masses[vid];// static_cast(neighbors[vid]); + const Vector_3 move = moves[vid].move / moves[vid].mass;// static_cast(neighbors[vid]); Point_3 new_pos = point(v->point()) + move; if (check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ nb_done_3d++; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index c667cfe9d12..c046b985ad4 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -1439,6 +1439,7 @@ auto sizing_at_vertex(const Vertex_handle v, template auto sizing_at_midpoint(const typename C3t3::Edge& e, + const typename C3t3::Triangulation::Geom_traits::Point_3& m, // edge midpoint const int dim, const typename C3t3::Index& index, const Sizing& sizing, @@ -1446,17 +1447,13 @@ auto sizing_at_midpoint(const typename C3t3::Edge& e, const Cell_selector& cell_selector) { using FT = typename C3t3::Triangulation::Geom_traits::FT; - using Point_3 = typename C3t3::Triangulation::Geom_traits::Point_3; - auto cp = c3t3.triangulation().geom_traits().construct_point_3_object(); - const Point_3 m = CGAL::midpoint(cp(e.first->vertex(e.second)->point()), - cp(e.first->vertex(e.third)->point())); + const FT size = sizing(m, dim, index); if (dim < 3 && size == 0) { - const auto u = e.first->vertex(e.second); - const auto v = e.first->vertex(e.third); + const auto [u, v] = make_vertex_pair(e); const FT size_at_u = sizing(cp(u->point()), u->in_dimension(), u->index()); const FT size_at_v = sizing(cp(v->point()), v->in_dimension(), v->index()); @@ -1584,9 +1581,7 @@ auto midpoint_with_info(const typename C3t3::Edge& e, Index index; }; - const auto vs = c3t3.triangulation().vertices(e); - const Vertex_handle u = vs[0]; - const Vertex_handle v = vs[1]; + const auto [u, v] = make_vertex_pair(e); const auto& gt = c3t3.triangulation().geom_traits(); auto cp = gt.construct_point_3_object(); From cb19aa7febb72a0bd25428222d27f600da890218 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 20 Jun 2025 14:23:02 +0200 Subject: [PATCH 050/145] cleaning --- .../test_tetrahedral_remeshing_determinism.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp index 024b1f325d5..e1fa238da4a 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp @@ -1,6 +1,5 @@ -//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE +#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE //#define CGAL_TETRAHEDRAL_REMESHING_DEBUG -//#define CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES #include @@ -65,7 +64,7 @@ int main(int argc, char* argv[]) CGAL::IO::write_MEDIT(ofs0, tr); ofs0.close(); - Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison + const Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison std::vector output_tr; output_tr.reserve(nb_runs); @@ -88,12 +87,15 @@ int main(int argc, char* argv[]) { if(0 != output_tr[i-1].compare(output_tr[i])) { - std::cerr << "Run " << i << " differs from run " << i-1 << std::endl; + std::cerr << "******************************************" << std::endl; + std::cerr << "*** Run " << i << " differs from run " << i-1 << std::endl; assert(false); // This should not happen } else { - std::cout << "Run " << i << " is identical to run " << i-1 << std::endl; + std::cout << "******************************************" << std::endl; + std::cout << "*** Run " << i << " is identical to run " << i - 1 << std::endl; + std::cout << "******************************************" << std::endl; } } } From ff6a91eb61f5fb6d9542aabbc379351c4a8b1c15 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Tue, 1 Jul 2025 11:36:49 +0200 Subject: [PATCH 051/145] [Small Feature] Rename import functions with deprecation and add alias tests --- Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp | 2 +- .../demo/Linear_cell_complex/MainWindow.cpp | 6 +-- .../CGAL/Linear_cell_complex_constructors.h | 14 +++++-- .../CGAL/Polyhedron_3_to_lcc.h | 6 +-- .../CGAL/Triangulation_3_to_lcc.h | 23 ++++++++--- .../Concepts/LinearCellComplexTraits.h | 5 +-- .../Linear_cell_complex.txt | 6 +-- .../PackageDescription.txt | 7 ++-- .../plane_graph_to_lcc_2.cpp | 2 +- .../Linear_cell_complex/voronoi_3.cpp | 2 +- .../CGAL/Linear_cell_complex_constructors.h | 38 ++++++++++++++++--- .../test/Linear_cell_complex/CMakeLists.txt | 5 ++- .../Linear_cell_complex_2_test.h | 4 +- .../Linear_cell_complex_3_test.h | 4 +- .../test_plane_graph_alias.cpp | 29 ++++++++++++++ .../test_polyhedron_3_alias.cpp | 26 +++++++++++++ .../test_triangulation_alias.cpp | 23 +++++++++++ Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 22 +++++++++-- .../include/CGAL/Triangulation_3_to_lcc.h | 12 +++++- 19 files changed, 195 insertions(+), 41 deletions(-) create mode 100644 Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp create mode 100644 Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp create mode 100644 Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp diff --git a/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp index 027b52fd69e..690f0f79de8 100644 --- a/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp +++ b/Lab/demo/Lab/Plugins/IO/lcc_io_plugin.cpp @@ -47,7 +47,7 @@ public: QString ext = fileinfo.suffix(); bool res = true; if(ext == "off") - CGAL::import_from_polyhedron_3_flux < Scene_lcc_item::LCC > (lcc, ifs); + CGAL::polyhedron_3_flux_to_lcc < Scene_lcc_item::LCC > (lcc, ifs); else { res = CGAL::load_combinatorial_map(ifs, lcc); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp index 04d95629494..ea72b31a057 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp @@ -375,7 +375,7 @@ void MainWindow::load_off (const QString & fileName, bool clear) std::ifstream ifs (qPrintable (fileName)); - CGAL::import_from_polyhedron_3_flux < LCC > (*scene.lcc, ifs); + CGAL::polyhedron_3_flux_to_lcc < LCC > (*scene.lcc, ifs); #ifdef CGAL_PROFILE_LCC_DEMO timer.stop(); @@ -415,7 +415,7 @@ void MainWindow::load_3DTDS (const QString & fileName, bool clear) T.insert (std::istream_iterator < Point_3 >(ifs), std::istream_iterator < Point_3 >() ); - CGAL::import_from_triangulation_3 < LCC, Triangulation >(*scene.lcc, T); + CGAL::triangulation_3_to_lcc < LCC, Triangulation >(*scene.lcc, T); #ifdef CGAL_PROFILE_LCC_DEMO timer.stop(); @@ -673,7 +673,7 @@ void MainWindow::on_actionCompute_Voronoi_3D_triggered () std::map vol_to_dart; - dh = CGAL::import_from_triangulation_3 < LCC, Triangulation > + dh = CGAL::triangulation_3_to_lcc < LCC, Triangulation > (delaunay_lcc, T, &vol_to_dart); Dart_descriptor ddh=delaunay_lcc.dual(*scene.lcc, dh); diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h index 71796bd842b..7b18234b216 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h @@ -24,13 +24,21 @@ Here a small example: Middle: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure. Right: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure. -\sa `CGAL::import_from_triangulation_3` -\sa `CGAL::import_from_polyhedron_3` +\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) +\sa `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) */ template -typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, +typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& lcc, std::istream& ais); +/*! +\ingroup PkgLinearCellComplexConstructions +\deprecated Use `plane_graph_to_lcc()` instead. +*/ +template +[[deprecated("Use plane_graph_to_lcc instead")]] +typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, std::istream& ais); + } /* namespace CGAL */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h index b6fbef4d30d..f4381dcf71c 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h @@ -5,10 +5,10 @@ namespace CGAL{ Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::import_from_plane_graph` -\sa `CGAL::import_from_triangulation_3` +\sa `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) +\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) */ template -typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& lcc, +typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& lcc, const Polyhedron &apoly); } diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h index 1532b70469b..5106a95c923 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h @@ -3,13 +3,24 @@ namespace CGAL{ /*! \ingroup PkgLinearCellComplexConstructions -Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. -\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. +Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. +Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. +\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and + \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::import_from_plane_graph` -\sa `CGAL::import_from_polyhedron_3` +\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) +\sa `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) +/// \sa `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) */ + template -typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, -const Triangulation_&atr); +typename LCC::Dart_descriptor triangulation_3_to_lcc(LCC& lcc, const Triangulation_&atr); + +template +[[deprecated("Use triangulation_3_to_lcc instead")]] +typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, const Triangulation_& atr) +{ + return triangulation_3_to_lcc(lcc, atr); } + +} \ No newline at end of file diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h index e701f011493..542e66c6137 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h @@ -64,8 +64,7 @@ which constructs a vector as the difference of points `p2-p1`, and \link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)` which constructs a vector as the difference of point `p` and a point at the origin (used in \link CGAL::barycenter `barycenter`\endlink -and `CGAL::import_from_plane_graph`). -*/ +and `CGAL::plane_graph_to_lcc`, formerly `import_from_plane_graph`). typedef unspecified_type Construct_vector; /*! @@ -104,7 +103,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink. typedef unspecified_type Direction_2; /*! -a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::import_from_plane_graph`). +a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::plane_graph_to_lcc`, formerly `import_from_plane_graph`). */ typedef unspecified_type Construct_direction_2; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index d58e0f6e2e5..aaec8a6a6f1 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -105,11 +105,11 @@ There are several member functions allowing to insert specific configurations of There are two functions allowing to build a linear cell complex from two other \cgal data types:
    -
  • \link ::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; -
  • \link ::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. +
  • \link ::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; (formerly `import_from_triangulation_3`) +
  • \link ::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. (formerly `import_from_polyhedron_3`)
-Lastly, the function \link ::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::import_from_plane_graph `reference manual`\endlink for the file format). +Lastly, the function \link ::plane_graph_to_lcc `plane_graph_to_lcc(lcc,ais)`\endlink (formerly `import_from_plane_graph`) adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::plane_graph_to_lcc `reference manual`\endlink for the file format). \subsection Linear_cell_complexModificationOperations Modification Operations \anchor ssecmodifop diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index caf7173fbee..0665d6ce46a 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -62,9 +62,10 @@ \cgalCRPSection{Global Functions} \cgalCRPSubsection{Constructions for Linear Cell Complex} -- `CGAL::import_from_plane_graph` -- `CGAL::import_from_triangulation_3` -- `CGAL::import_from_polyhedron_3` +- `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) +- `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) +- `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) +- `CGAL::polyhedron_3_flux_to_lcc` (formerly `import_from_polyhedron_3_flux`) \cgalCRPSubsection{Operations for Linear Cell Complex} - `CGAL::compute_normal_of_cell_0` diff --git a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp b/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp index 58fd07d2bf9..4aa82742a06 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp @@ -42,7 +42,7 @@ int main(int narg, char** argv) std::ifstream is(filename.c_str()); std::cout<<"Import plane graph from "< vol_to_dart; - Dart_descriptor d=CGAL::import_from_triangulation_3 + Dart_descriptor d=CGAL::triangulation_3_to_lcc (lcc, T, &vol_to_dart); std::cout<<"Delaunay triangulation :"< - typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, + typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& alcc, const std::vector& vertices, const std::vector& edge_indices) { @@ -130,6 +130,16 @@ namespace CGAL { return first; } +template< class LCC > +[[deprecated("Use plane_graph_to_lcc instead")]] +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, + const std::vector& vertices, + const std::vector& edge_indices) +{ + return plane_graph_to_lcc(alcc, vertices, edge_indices); +} + /** * Imports a plane-embedded graph from a file into a LinearCellComplex. * @@ -138,7 +148,7 @@ namespace CGAL { * @return A dart created during the conversion. */ template< class LCC > - typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, + typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& alcc, std::istream& ais) { using FT = typename LCC::FT; @@ -185,18 +195,36 @@ namespace CGAL { edge_indices.push_back(v2); } - return import_from_plane_graph(alcc, vertices, edge_indices); + return plane_graph_to_lcc(alcc, vertices, edge_indices); } +template +[[deprecated("Use plane_graph_to_lcc instead")]] +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, std::istream& ais) +{ + return plane_graph_to_lcc(alcc, ais); +} + template < class LCC > typename LCC::Dart_descriptor - import_from_plane_graph(LCC& alcc, const char* filename) + iplane_graph_to_lcc(LCC& alcc, const char* filename) { std::ifstream input(filename); if (!input.is_open()) return alcc.null_descriptor; - return import_from_plane_graph(alcc, input); + return plane_graph_to_lcc(alcc, input); } +template +[[deprecated("Use plane_graph_to_lcc instead")]] +typename LCC::Dart_descriptor +import_from_plane_graph(LCC& alcc, const char* filename) +{ + std::ifstream input(filename); + if (!input.is_open()) return alcc.null_descriptor; + return plane_graph_to_lcc(alcc, input); +} + template < class LCC > bool load_off(LCC& alcc, std::istream& in) { diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index d19fc827d59..249c1f9c8be 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -15,6 +15,9 @@ create_single_source_cgal_program(Linear_cell_complex_3_test.cpp ${hfiles}) create_single_source_cgal_program(Linear_cell_complex_4_test.cpp ${hfiles}) create_single_source_cgal_program(Linear_cell_complex_copy_test.cpp ${hfiles}) create_single_source_cgal_program(LCC_3_incremental_builder_test.cpp ${hfiles}) +create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles}) +create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles}) +create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles}) # Same targets, defining USE_COMPACT_CONTAINER_WITH_INDEX to test index version add_executable(Linear_cell_complex_2_test_index Linear_cell_complex_2_test.cpp ${hfiles}) @@ -35,4 +38,4 @@ cgal_add_compilation_test(Linear_cell_complex_4_test_index) add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test.cpp ${hfiles}) target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(Linear_cell_complex_copy_test_index) +cgal_add_compilation_test(Linear_cell_complex_copy_test_index) \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index f22bd0a480a..122163f433f 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -382,7 +382,7 @@ bool test_LCC_2() std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::plane_graph_to_lcc(lcc,in); if ( !check_number_of_cells_2(lcc, 66, 166, 104, 2) ) return false; lcc.clear(); @@ -431,7 +431,7 @@ struct Test_change_orientation_LCC_2 std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::plane_graph_to_lcc(lcc,in); trace_test_begin(); diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index 1f696a41811..a7b20879296 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -997,7 +997,7 @@ bool test_LCC_3() } in >> P; - CGAL::import_from_polyhedron_3(lcc,P); + CGAL::polyhedron_3_flux_to_lcc(lcc,P); if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) ) return false; @@ -1029,7 +1029,7 @@ bool test_LCC_3() } T.insert ( std::istream_iterator < Point >(in), std::istream_iterator < Point >() ); - CGAL::import_from_triangulation_3(lcc,T); + CGAL::triangulation_3_to_lcc(lcc,T); if ( !lcc.is_valid() ) return false; diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp new file mode 100644 index 00000000000..aac5108ee6d --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC; + +int main() +{ + LCC lcc1, lcc2; + + // Planar graph with 3 vertices and 3 edges (triangle) + std::stringstream input; + input << "3 3\n0.0 0.0\n1.0 0.0\n0.0 1.0\n0 1\n1 2\n2 0\n"; + + // Test new function + auto d1 = CGAL::plane_graph_to_lcc(lcc1, input); + assert(d1 != LCC::null_descriptor); + + // Rewind input stream for second test + input.clear(); + input.seekg(0, std::ios::beg); + + // Test deprecated function + auto d2 = CGAL::import_from_plane_graph(lcc2, input); + assert(d2 != LCC::null_descriptor); + + return 0; +} \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp new file mode 100644 index 00000000000..11fc4fe5434 --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; +typedef CGAL::Polyhedron_3 Polyhedron; + +int main() +{ + std::stringstream ss("OFF\n0 0 0\n"); + + Polyhedron P; + ss >> P; + + LCC lcc1, lcc2; + + auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); + assert(d1 == LCC::null_descriptor); + + auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); + assert(d2 == LCC::null_descriptor); + + return 0; +} \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp new file mode 100644 index 00000000000..7a2da81bb3d --- /dev/null +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3; +typedef CGAL::Delaunay_triangulation_3 Triangulation; + +int main() +{ + LCC_3 lcc1, lcc2; + Triangulation T; + + assert(T.dimension() == -1); + + auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); + assert(d1 == LCC_3::null_descriptor); + + auto d2 = CGAL::import_from_triangulation_3(lcc2, T); + assert(d2 == LCC_3::null_descriptor); + + return 0; +} \ No newline at end of file diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index bda362a0d2d..72e66bd02f3 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -30,7 +30,7 @@ namespace CGAL { * @return A dart created during the conversion. */ template< class LCC, class Polyhedron > - typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc, + typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& alcc, const Polyhedron &apoly) { static_assert( LCC::dimension>=2 && LCC::ambient_dimension==3 ); @@ -94,6 +94,14 @@ namespace CGAL { return firstAll; } +template< class LCC, class Polyhedron > +[[deprecated("Use polyhedron_3_to_lcc instead")]] +typename LCC::Dart_descriptor +import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) +{ + return polyhedron_3_to_lcc(alcc, apoly); +} + /** Convert a Polyhedron_3 read into a flux into 3D linear cell complex. * @param alcc the linear cell complex where Polyhedron_3 will be converted. * @param ais the istream where read the Polyhedron_3. @@ -101,7 +109,7 @@ namespace CGAL { */ template < class LCC > typename LCC::Dart_descriptor - import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais) + polyhedron_3_flux_to_lcc(LCC& alcc, std::istream& ais) { if (!ais.good()) { @@ -110,10 +118,18 @@ namespace CGAL { } CGAL::Polyhedron_3 P; ais >> P; - return import_from_polyhedron_3 > (alcc, P); } +template < class LCC > +[[deprecated("Use polyhedron_3_flux_to_lcc instead")]] +typename LCC::Dart_descriptor +import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais) +{ + return polyhedron_3_flux_to_lcc(alcc, ais); +} + } // namespace CGAL #endif // CGAL_IMPORT_FROM_POLYHEDRON_3_H diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 19f495dbfbe..abd6caf2c51 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -47,7 +47,7 @@ namespace CGAL { * @return A dart incident to the infinite vertex. */ template < class LCC, class Triangulation > - typename LCC::Dart_descriptor import_from_triangulation_3 + typename LCC::Dart_descriptor triangulation_3_to_lcc (LCC& alcc, const Triangulation &atr, std::map* avol_to_dart=nullptr) @@ -149,6 +149,16 @@ namespace CGAL { return dart; } + template < class LCC, class Triangulation > +[[deprecated("Use triangulation_3_to_lcc instead")]] +typename LCC::Dart_descriptor import_from_triangulation_3 +(LCC& alcc, const Triangulation &atr, + std::map* avol_to_dart=nullptr) +{ + return triangulation_3_to_lcc(alcc, atr, avol_to_dart); +} + } // namespace CGAL #endif // CGAL_TRIANGULATION_3_TO_LCC_H From 5bfaaac6509e9e1b6165d01906fc255fec06cfc9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 1 Jul 2025 11:41:06 +0100 Subject: [PATCH 052/145] Addd source for filter generator --- .../include/CGAL/NewKernel_d/orientationC4.h | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h new file mode 100644 index 00000000000..0a12b57b258 --- /dev/null +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h @@ -0,0 +1,62 @@ + + + +inline int orientationC4(double p0, double p1, double p2, double p3, + double q0, double q1, double q2, double q3, + double r0, double r1, double r2, double r3, + double s0, double s1, double s2, double s3, + double t0, double t1, double t2, double t3) +{ + + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + + double m11; + m01 = (q1 - p1); + double m12; + m02 = (r1 - p1); + double m13; + m03 = (s1 - p1); + double m14; + m04 = (t1 - p1); + + double m21; + m01 = (q2 - p2); + double m22; + m02 = (r2 - p2); + double m23; + m03 = (s2 - p2); + double m24; + m04 = (t2 - p2); + + double m31; + m01 = (q3 - p3); + double m32; + m02 = (r3 - p3); + double m33; + m03 = (s3 - p3); + double m34; + m04 = (t3 - p3); + + double det = determinant(m01, m02, m03, m04, + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34); + if (det > 0) { + return 1; // positive orientation + } else if (det < 0) { + return -1; // negative orientation + } else { + return 0; // zero orientation + } + +} + + + From 8daad7fc093457ebf9f0a7f129f4178187a87ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Jul 2025 15:47:57 +0200 Subject: [PATCH 053/145] fix predicate and add filtered version --- .../include/CGAL/NewKernel_d/orientationC4.h | 258 ++++++++- .../include/CGAL/NewKernel_d/orientationC5.h | 523 ++++++++---------- 2 files changed, 452 insertions(+), 329 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h index 0a12b57b258..1c6cce210e0 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h @@ -1,11 +1,34 @@ +double determinant( + double a00, double a01, double a02, double a03, + double a10, double a11, double a12, double a13, + double a20, double a21, double a22, double a23, + double a30, double a31, double a32, double a33) +{ + double m01 = a10*a01 - a00*a11; + double m02 = a20*a01 - a00*a21; + double m03 = a30*a01 - a00*a31; + double m12 = a20*a11 - a10*a21; + double m13 = a30*a11 - a10*a31; + double m23 = a30*a21 - a20*a31; + double m012 = m12*a02 - m02*a12 + m01*a22; + double m013 = m13*a02 - m03*a12 + m01*a32; + double m023 = m23*a02 - m03*a22 + m02*a32; + double m123 = m23*a12 - m13*a22 + m12*a32; + double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + return m0123; +} -inline int orientationC4(double p0, double p1, double p2, double p3, - double q0, double q1, double q2, double q3, - double r0, double r1, double r2, double r3, - double s0, double s1, double s2, double s3, - double t0, double t1, double t2, double t3) +int orientationC4(double p0, double p1, double p2, double p3, + double q0, double q1, double q2, double q3, + double r0, double r1, double r2, double r3, + double s0, double s1, double s2, double s3, + double t0, double t1, double t2, double t3) +group p0 q0 r0 t0 q0; +group p1 q1 r1 t1 q1; +group p2 q2 r2 t2 q2; +group p3 q3 r3 t3 q3; { double m01; @@ -18,45 +41,232 @@ inline int orientationC4(double p0, double p1, double p2, double p3, m04 = (t0 - p0); double m11; - m01 = (q1 - p1); + m11 = (q1 - p1); double m12; - m02 = (r1 - p1); + m12 = (r1 - p1); double m13; - m03 = (s1 - p1); + m13 = (s1 - p1); double m14; - m04 = (t1 - p1); + m14 = (t1 - p1); double m21; - m01 = (q2 - p2); + m21 = (q2 - p2); double m22; - m02 = (r2 - p2); + m22 = (r2 - p2); double m23; - m03 = (s2 - p2); + m23 = (s2 - p2); double m24; - m04 = (t2 - p2); + m24 = (t2 - p2); double m31; - m01 = (q3 - p3); + m31 = (q3 - p3); double m32; - m02 = (r3 - p3); + m32 = (r3 - p3); double m33; - m03 = (s3 - p3); + m33 = (s3 - p3); double m34; - m04 = (t3 - p3); + m34 = (t3 - p3); double det = determinant(m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34); - if (det > 0) { - return 1; // positive orientation - } else if (det < 0) { - return -1; // negative orientation - } else { - return 0; // zero orientation - } + return sign(det); + } +//===========generated ================== +inline int orientationC4( double p0, double p1, double p2, double p3, double q0, double q1, double q2, double q3, double r0, double r1, double r2, double r3, double s0, double s1, double s2, double s3, double t0, double t1, double t2, double t3) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double det; + det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); + int int_tmp_result; + double eps; + double max1 = fabs(m01); + if( (max1 < fabs(m02)) ) + { + max1 = fabs(m02); + } + if( (max1 < fabs(m03)) ) + { + max1 = fabs(m03); + } + if( (max1 < fabs(m11)) ) + { + max1 = fabs(m11); + } + if( (max1 < fabs(m12)) ) + { + max1 = fabs(m12); + } + if( (max1 < fabs(m13)) ) + { + max1 = fabs(m13); + } + if( (max1 < fabs(m23)) ) + { + max1 = fabs(m23); + } + double max2 = fabs(m01); + if( (max2 < fabs(m02)) ) + { + max2 = fabs(m02); + } + if( (max2 < fabs(m11)) ) + { + max2 = fabs(m11); + } + if( (max2 < fabs(m12)) ) + { + max2 = fabs(m12); + } + if( (max2 < fabs(m21)) ) + { + max2 = fabs(m21); + } + if( (max2 < fabs(m22)) ) + { + max2 = fabs(m22); + } + if( (max2 < fabs(m23)) ) + { + max2 = fabs(m23); + } + if( (max2 < fabs(m33)) ) + { + max2 = fabs(m33); + } + double max3 = fabs(m04); + if( (max3 < fabs(m14)) ) + { + max3 = fabs(m14); + } + if( (max3 < fabs(m24)) ) + { + max3 = fabs(m24); + } + if( (max3 < fabs(m34)) ) + { + max3 = fabs(m34); + } + double max4 = fabs(m11); + if( (max4 < fabs(m12)) ) + { + max4 = fabs(m12); + } + if( (max4 < fabs(m21)) ) + { + max4 = fabs(m21); + } + if( (max4 < fabs(m22)) ) + { + max4 = fabs(m22); + } + if( (max4 < fabs(m31)) ) + { + max4 = fabs(m31); + } + if( (max4 < fabs(m32)) ) + { + max4 = fabs(m32); + } + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max1; + upper_bound_1 = max1; + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 2.89273249588395272840e-74) ) + { + return FPG_UNCERTAIN_VALUE; + } + else + { + if( (upper_bound_1 > 7.23700557733225900010e+75) ) + { + return FPG_UNCERTAIN_VALUE; + } + eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3)); + if( (det > eps) ) + { + int_tmp_result = 1; + } + else + { + if( (det < -eps) ) + { + int_tmp_result = -1; + } + else + { + return FPG_UNCERTAIN_VALUE; + } + } + } + return int_tmp_result; +} diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index 6433d905b4f..981395fd978 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -1,138 +1,52 @@ -// Copyright (c) 2025 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Andreas Fabri - - -inline double determinant_with_1_in_row_0( double a01, double a02, double a03, double a04, double a05, double a11, double a12, double a13, double a14, double a15, double a21, double a22, double a23, double a24, double a25, double a31, double a32, double a33, double a34, double a35, double a41, double a42, double a43, double a44, double a45, double a51, double a52, double a53, double a54, double a55) { - double m01; - m01 = (a11 - a01); - double m02; - m02 = (a21 - a01); - double m03; - m03 = (a31 - a01); - double m04; - m04 = (a41 - a01); - double m05; - m05 = (a51 - a01); - double m12; - m12 = (a21 - a11); - double m13; - m13 = (a31 - a11); - double m14; - m14 = (a41 - a11); - double m15; - m15 = (a51 - a11); - double m23; - m23 = (a31 - a21); - double m24; - m24 = (a41 - a21); - double m25; - m25 = (a51 - a21); - double m34; - m34 = (a41 - a31); - double m35; - m35 = (a51 - a31); - double m45; - m45 = (a51 - a41); - double m012; - m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); - double m013; - m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); - double m014; - m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); - double m015; - m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); - double m023; - m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); - double m024; - m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); - double m025; - m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); - double m034; - m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); - double m035; - m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); - double m045; - m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); - double m123; - m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); - double m124; - m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); - double m125; - m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); - double m134; - m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); - double m135; - m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); - double m145; - m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); - double m234; - m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); - double m235; - m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); - double m245; - m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); - double m345; - m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); - double m0123; - m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); - double m0124; - m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); - double m0125; - m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); - double m0134; - m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); - double m0135; - m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); - double m0145; - m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); - double m0234; - m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); - double m0235; - m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); - double m0245; - m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); - double m0345; - m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); - double m1234; - m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); - double m1235; - m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); - double m1245; - m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); - double m1345; - m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); - double m2345; - m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); - double m01234; - m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); - double m01235; - m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); - double m01245; - m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); - double m01345; - m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); - double m02345; - m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); - double m12345; - m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); - double m012345; - m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); - return m012345; +double +determinant( + double a00, double a01, double a02, double a03, double a04, + double a10, double a11, double a12, double a13, double a14, + double a20, double a21, double a22, double a23, double a24, + double a30, double a31, double a32, double a33, double a34, + double a40, double a41, double a42, double a43, double a44) +{ + double m01 = a10*a01 - a00*a11; + double m02 = a20*a01 - a00*a21; + double m03 = a30*a01 - a00*a31; + double m04 = a40*a01 - a00*a41; + double m12 = a20*a11 - a10*a21; + double m13 = a30*a11 - a10*a31; + double m14 = a40*a11 - a10*a41; + double m23 = a30*a21 - a20*a31; + double m24 = a40*a21 - a20*a41; + double m34 = a40*a31 - a30*a41; + double m012 = m12*a02 - m02*a12 + m01*a22; + double m013 = m13*a02 - m03*a12 + m01*a32; + double m014 = m14*a02 - m04*a12 + m01*a42; + double m023 = m23*a02 - m03*a22 + m02*a32; + double m024 = m24*a02 - m04*a22 + m02*a42; + double m034 = m34*a02 - m04*a32 + m03*a42; + double m123 = m23*a12 - m13*a22 + m12*a32; + double m124 = m24*a12 - m14*a22 + m12*a42; + double m134 = m34*a12 - m14*a32 + m13*a42; + double m234 = m34*a22 - m24*a32 + m23*a42; + double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + double m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + double m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + double m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + double m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; + double m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + return m01234; } - -inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { - double det; - double determinant_with_1_in_row_0_return_value; +int orientationC5(double p0, double p1, double p2, double p3, double p4, + double q0, double q1, double q2, double q3, double q4, + double r0, double r1, double r2, double r3, double r4, + double s0, double s1, double s2, double s3, double s4, + double t0, double t1, double t2, double t3, double t4, + double u0, double u1, double u2, double u3, double u4) +group p0 q0 r0 t0 q0 u0; +group p1 q1 r1 t1 q1 u1; +group p2 q2 r2 t2 q2 u2; +group p3 q3 r3 t3 q3 u3; +group p4 q4 r4 t4 q4 u4; +{ double m01; m01 = (q0 - p0); double m02; @@ -143,254 +57,256 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, m04 = (t0 - p0); double m05; m05 = (u0 - p0); + + double m11; + m11 = (q1 - p1); double m12; - m12 = (r0 - q0); + m12 = (r1 - p1); double m13; - m13 = (s0 - q0); + m13 = (s1 - p1); double m14; - m14 = (t0 - q0); + m14 = (t1 - p1); double m15; - m15 = (u0 - q0); + m15 = (u1 - p1); + + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); double m23; - m23 = (s0 - r0); + m23 = (s2 - p2); double m24; - m24 = (t0 - r0); + m24 = (t2 - p2); double m25; - m25 = (u0 - r0); + m25 = (u2 - p2); + + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); double m34; - m34 = (t0 - s0); + m34 = (t3 - p3); double m35; - m35 = (u0 - s0); + m35 = (u3 - p3); + + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); double m45; - m45 = (u0 - t0); - double m012; - m012 = (((m01 * r1) - (m02 * q1)) + (m12 * p1)); - double m013; - m013 = (((m01 * s1) - (m03 * q1)) + (m13 * p1)); - double m014; - m014 = (((m01 * t1) - (m04 * q1)) + (m14 * p1)); - double m015; - m015 = (((m01 * u1) - (m05 * q1)) + (m15 * p1)); - double m023; - m023 = (((m02 * s1) - (m03 * r1)) + (m23 * p1)); - double m024; - m024 = (((m02 * t1) - (m04 * r1)) + (m24 * p1)); - double m025; - m025 = (((m02 * u1) - (m05 * r1)) + (m25 * p1)); - double m034; - m034 = (((m03 * t1) - (m04 * s1)) + (m34 * p1)); - double m035; - m035 = (((m03 * u1) - (m05 * s1)) + (m35 * p1)); - double m045; - m045 = (((m04 * u1) - (m05 * t1)) + (m45 * p1)); - double m123; - m123 = (((m12 * s1) - (m13 * r1)) + (m23 * q1)); - double m124; - m124 = (((m12 * t1) - (m14 * r1)) + (m24 * q1)); - double m125; - m125 = (((m12 * u1) - (m15 * r1)) + (m25 * q1)); - double m134; - m134 = (((m13 * t1) - (m14 * s1)) + (m34 * q1)); - double m135; - m135 = (((m13 * u1) - (m15 * s1)) + (m35 * q1)); - double m145; - m145 = (((m14 * u1) - (m15 * t1)) + (m45 * q1)); - double m234; - m234 = (((m23 * t1) - (m24 * s1)) + (m34 * r1)); - double m235; - m235 = (((m23 * u1) - (m25 * s1)) + (m35 * r1)); - double m245; - m245 = (((m24 * u1) - (m25 * t1)) + (m45 * r1)); - double m345; - m345 = (((m34 * u1) - (m35 * t1)) + (m45 * s1)); - double m0123; - m0123 = ((((m012 * s2) - (m013 * r2)) + (m023 * q2)) - (m123 * p2)); - double m0124; - m0124 = ((((m012 * t2) - (m014 * r2)) + (m024 * q2)) - (m124 * p2)); - double m0125; - m0125 = ((((m012 * u2) - (m015 * r2)) + (m025 * q2)) - (m125 * p2)); - double m0134; - m0134 = ((((m013 * t2) - (m014 * s2)) + (m034 * q2)) - (m134 * p2)); - double m0135; - m0135 = ((((m013 * u2) - (m015 * s2)) + (m035 * q2)) - (m135 * p2)); - double m0145; - m0145 = ((((m014 * u2) - (m015 * t2)) + (m045 * q2)) - (m145 * p2)); - double m0234; - m0234 = ((((m023 * t2) - (m024 * s2)) + (m034 * r2)) - (m234 * p2)); - double m0235; - m0235 = ((((m023 * u2) - (m025 * s2)) + (m035 * r2)) - (m235 * p2)); - double m0245; - m0245 = ((((m024 * u2) - (m025 * t2)) + (m045 * r2)) - (m245 * p2)); - double m0345; - m0345 = ((((m034 * u2) - (m035 * t2)) + (m045 * s2)) - (m345 * p2)); - double m1234; - m1234 = ((((m123 * t2) - (m124 * s2)) + (m134 * r2)) - (m234 * q2)); - double m1235; - m1235 = ((((m123 * u2) - (m125 * s2)) + (m135 * r2)) - (m235 * q2)); - double m1245; - m1245 = ((((m124 * u2) - (m125 * t2)) + (m145 * r2)) - (m245 * q2)); - double m1345; - m1345 = ((((m134 * u2) - (m135 * t2)) + (m145 * s2)) - (m345 * q2)); - double m2345; - m2345 = ((((m234 * u2) - (m235 * t2)) + (m245 * s2)) - (m345 * r2)); - double m01234; - m01234 = (((((m0123 * t3) - (m0124 * s3)) + (m0134 * r3)) - (m0234 * q3)) + (m1234 * p3)); - double m01235; - m01235 = (((((m0123 * u3) - (m0125 * s3)) + (m0135 * r3)) - (m0235 * q3)) + (m1235 * p3)); - double m01245; - m01245 = (((((m0124 * u3) - (m0125 * t3)) + (m0145 * r3)) - (m0245 * q3)) + (m1245 * p3)); - double m01345; - m01345 = (((((m0134 * u3) - (m0135 * t3)) + (m0145 * s3)) - (m0345 * q3)) + (m1345 * p3)); - double m02345; - m02345 = (((((m0234 * u3) - (m0235 * t3)) + (m0245 * s3)) - (m0345 * r3)) + (m2345 * p3)); - double m12345; - m12345 = (((((m1234 * u3) - (m1235 * t3)) + (m1245 * s3)) - (m1345 * r3)) + (m2345 * q3)); - double m012345; - m012345 = ((((((m01234 * u4) - (m01235 * t4)) + (m01245 * s4)) - (m01345 * r4)) + (m02345 * q4)) - (m12345 * p4)); - determinant_with_1_in_row_0_return_value = m012345; - det = determinant_with_1_in_row_0_return_value; + m45 = (u4 - p4); + + double det = determinant(m01, m02, m03, m04, m05, + m11, m12, m13, m14, m15, + m21, m22, m23, m24, m25, + m31, m32, m33, m34, m35, + m41, m42, m43, m44, m45); + return sign(det); +} + +//===========generated ================== + +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double det; + det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); int int_tmp_result; double eps; - double max1 = fabs(p1); - if( (max1 < fabs(q1)) ) + double max1 = fabs(m01); + if( (max1 < fabs(m02)) ) { - max1 = fabs(q1); + max1 = fabs(m02); } - if( (max1 < fabs(r1)) ) + if( (max1 < fabs(m03)) ) { - max1 = fabs(r1); + max1 = fabs(m03); } - if( (max1 < fabs(s1)) ) + if( (max1 < fabs(m11)) ) { - max1 = fabs(s1); + max1 = fabs(m11); } - if( (max1 < fabs(t1)) ) + if( (max1 < fabs(m12)) ) { - max1 = fabs(t1); + max1 = fabs(m12); } - if( (max1 < fabs(u1)) ) + if( (max1 < fabs(m13)) ) { - max1 = fabs(u1); + max1 = fabs(m13); } - double max2 = fabs(p2); - if( (max2 < fabs(q2)) ) + if( (max1 < fabs(m21)) ) { - max2 = fabs(q2); + max1 = fabs(m21); } - if( (max2 < fabs(r2)) ) + if( (max1 < fabs(m22)) ) { - max2 = fabs(r2); + max1 = fabs(m22); } - if( (max2 < fabs(s2)) ) + if( (max1 < fabs(m23)) ) { - max2 = fabs(s2); + max1 = fabs(m23); } - if( (max2 < fabs(t2)) ) + if( (max1 < fabs(m33)) ) { - max2 = fabs(t2); + max1 = fabs(m33); } - if( (max2 < fabs(u2)) ) + double max2 = fabs(m01); + if( (max2 < fabs(m02)) ) { - max2 = fabs(u2); + max2 = fabs(m02); } - double max3 = fabs(p3); - if( (max3 < fabs(q3)) ) + if( (max2 < fabs(m11)) ) { - max3 = fabs(q3); + max2 = fabs(m11); } - if( (max3 < fabs(r3)) ) + if( (max2 < fabs(m12)) ) { - max3 = fabs(r3); + max2 = fabs(m12); } - if( (max3 < fabs(s3)) ) + if( (max2 < fabs(m21)) ) { - max3 = fabs(s3); + max2 = fabs(m21); } - if( (max3 < fabs(t3)) ) + if( (max2 < fabs(m22)) ) { - max3 = fabs(t3); + max2 = fabs(m22); } - if( (max3 < fabs(u3)) ) + if( (max2 < fabs(m23)) ) { - max3 = fabs(u3); + max2 = fabs(m23); } - double max4 = fabs(p4); - if( (max4 < fabs(q4)) ) + if( (max2 < fabs(m31)) ) { - max4 = fabs(q4); + max2 = fabs(m31); } - if( (max4 < fabs(r4)) ) + if( (max2 < fabs(m32)) ) { - max4 = fabs(r4); + max2 = fabs(m32); } - if( (max4 < fabs(s4)) ) + if( (max2 < fabs(m33)) ) { - max4 = fabs(s4); + max2 = fabs(m33); } - if( (max4 < fabs(t4)) ) + if( (max2 < fabs(m43)) ) { - max4 = fabs(t4); + max2 = fabs(m43); } - if( (max4 < fabs(u4)) ) + double max3 = fabs(m04); + if( (max3 < fabs(m14)) ) { - max4 = fabs(u4); + max3 = fabs(m14); } - double max5 = fabs(m01); - if( (max5 < fabs(m05)) ) + if( (max3 < fabs(m24)) ) { - max5 = fabs(m05); + max3 = fabs(m24); } - if( (max5 < fabs(m04)) ) + if( (max3 < fabs(m34)) ) { - max5 = fabs(m04); + max3 = fabs(m34); } - if( (max5 < fabs(m03)) ) + if( (max3 < fabs(m44)) ) { - max5 = fabs(m03); + max3 = fabs(m44); } - if( (max5 < fabs(m02)) ) + double max4 = fabs(m05); + if( (max4 < fabs(m15)) ) { - max5 = fabs(m02); + max4 = fabs(m15); } - if( (max5 < fabs(m15)) ) + if( (max4 < fabs(m25)) ) { - max5 = fabs(m15); + max4 = fabs(m25); } - if( (max5 < fabs(m14)) ) + if( (max4 < fabs(m35)) ) { - max5 = fabs(m14); + max4 = fabs(m35); } - if( (max5 < fabs(m13)) ) + if( (max4 < fabs(m45)) ) { - max5 = fabs(m13); + max4 = fabs(m45); } + double max5 = fabs(m11); if( (max5 < fabs(m12)) ) { max5 = fabs(m12); } - if( (max5 < fabs(m34)) ) + if( (max5 < fabs(m21)) ) { - max5 = fabs(m34); + max5 = fabs(m21); } - if( (max5 < fabs(m25)) ) + if( (max5 < fabs(m22)) ) { - max5 = fabs(m25); + max5 = fabs(m22); } - if( (max5 < fabs(m24)) ) + if( (max5 < fabs(m31)) ) { - max5 = fabs(m24); + max5 = fabs(m31); } - if( (max5 < fabs(m23)) ) + if( (max5 < fabs(m32)) ) { - max5 = fabs(m23); + max5 = fabs(m32); } - if( (max5 < fabs(m45)) ) + if( (max5 < fabs(m41)) ) { - max5 = fabs(m45); + max5 = fabs(m41); } - if( (max5 < fabs(m35)) ) + if( (max5 < fabs(m42)) ) { - max5 = fabs(m35); + max5 = fabs(m42); } double lower_bound_1; double upper_bound_1; @@ -440,7 +356,7 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, upper_bound_1 = max4; } } - if( (lower_bound_1 < 8.19482853969781542511e-60) ) + if( (lower_bound_1 < 9.99657131447050328602e-60) ) { return FPG_UNCERTAIN_VALUE; } @@ -450,7 +366,7 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, { return FPG_UNCERTAIN_VALUE; } - eps = (6.02067348555779570000e-13 * ((((max5 * max1) * max2) * max3) * max4)); + eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4)); if( (det > eps) ) { int_tmp_result = 1; @@ -469,6 +385,3 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, } return int_tmp_result; } - - - From f2e16bd0c900fb5046427b1102ec9d29d4f1c159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 1 Jul 2025 16:05:37 +0200 Subject: [PATCH 054/145] dim 6 --- .../include/CGAL/NewKernel_d/orientationC6.h | 676 +++++++++--------- 1 file changed, 335 insertions(+), 341 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h index 77525c8a21b..0c1792230a9 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -1,464 +1,458 @@ -// Copyright (c) 2025 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Andreas Fabri +double +determinant( + double a00, double a01, double a02, double a03, double a04, double a05, + double a10, double a11, double a12, double a13, double a14, double a15, + double a20, double a21, double a22, double a23, double a24, double a25, + double a30, double a31, double a32, double a33, double a34, double a35, + double a40, double a41, double a42, double a43, double a44, double a45, + double a50, double a51, double a52, double a53, double a54, double a55) +{ + double m01 = a00*a11 - a10*a01; + double m02 = a00*a21 - a20*a01; + double m03 = a00*a31 - a30*a01; + double m04 = a00*a41 - a40*a01; + double m05 = a00*a51 - a50*a01; + double m12 = a10*a21 - a20*a11; + double m13 = a10*a31 - a30*a11; + double m14 = a10*a41 - a40*a11; + double m15 = a10*a51 - a50*a11; + double m23 = a20*a31 - a30*a21; + double m24 = a20*a41 - a40*a21; + double m25 = a20*a51 - a50*a21; + double m34 = a30*a41 - a40*a31; + double m35 = a30*a51 - a50*a31; + double m45 = a40*a51 - a50*a41; + double m012 = m01*a22 - m02*a12 + m12*a02; + double m013 = m01*a32 - m03*a12 + m13*a02; + double m014 = m01*a42 - m04*a12 + m14*a02; + double m015 = m01*a52 - m05*a12 + m15*a02; + double m023 = m02*a32 - m03*a22 + m23*a02; + double m024 = m02*a42 - m04*a22 + m24*a02; + double m025 = m02*a52 - m05*a22 + m25*a02; + double m034 = m03*a42 - m04*a32 + m34*a02; + double m035 = m03*a52 - m05*a32 + m35*a02; + double m045 = m04*a52 - m05*a42 + m45*a02; + double m123 = m12*a32 - m13*a22 + m23*a12; + double m124 = m12*a42 - m14*a22 + m24*a12; + double m125 = m12*a52 - m15*a22 + m25*a12; + double m134 = m13*a42 - m14*a32 + m34*a12; + double m135 = m13*a52 - m15*a32 + m35*a12; + double m145 = m14*a52 - m15*a42 + m45*a12; + double m234 = m23*a42 - m24*a32 + m34*a22; + double m235 = m23*a52 - m25*a32 + m35*a22; + double m245 = m24*a52 - m25*a42 + m45*a22; + double m345 = m34*a52 - m35*a42 + m45*a32; -inline int orientation( double a01, double a02, double a03, double a04, double a05, double a06, double a11, double a12, double a13, double a14, double a15, double a16, double a21, double a22, double a23, double a24, double a25, double a26, double a31, double a32, double a33, double a34, double a35, double a36, double a41, double a42, double a43, double a44, double a45, double a46, double a51, double a52, double a53, double a54, double a55, double a56, double a61, double a62, double a63, double a64, double a65, double a66) { + double m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + double m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + double m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + double m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + double m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + double m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + double m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + double m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + double m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + double m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + double m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + double m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + double m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + double m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + double m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; + + double m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + double m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + double m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + double m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + double m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + double m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; + + double m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + + m02345*a15 - m12345*a05; + return m012345; +} + +int orientationC5(double p0, double p1, double p2, double p3, double p4, double p5, + double q0, double q1, double q2, double q3, double q4, double q5, + double r0, double r1, double r2, double r3, double r4, double r5, + double s0, double s1, double s2, double s3, double s4, double s5, + double t0, double t1, double t2, double t3, double t4, double t5, + double u0, double u1, double u2, double u3, double u4, double u5, + double v0, double v1, double v2, double v3, double v4, double v5) +group p0 q0 r0 t0 q0 u0 v0; +group p1 q1 r1 t1 q1 u1 v1; +group p2 q2 r2 t2 q2 u2 v2; +group p3 q3 r3 t3 q3 u3 v3; +group p4 q4 r4 t4 q4 u4 v4; +group p5 q5 r5 t5 q5 u5 v5; +{ double m01; - m01 = (a11 - a01); + m01 = (q0 - p0); double m02; - m02 = (a21 - a01); + m02 = (r0 - p0); double m03; - m03 = (a31 - a01); + m03 = (s0 - p0); double m04; - m04 = (a41 - a01); + m04 = (t0 - p0); double m05; - m05 = (a51 - a01); + m05 = (u0 - p0); double m06; - m06 = (a61 - a01); + m06 = (v0 - p0); + + double m11; + m11 = (q1 - p1); double m12; - m12 = (a21 - a11); + m12 = (r1 - p1); double m13; - m13 = (a31 - a11); + m13 = (s1 - p1); double m14; - m14 = (a41 - a11); + m14 = (t1 - p1); double m15; - m15 = (a51 - a11); + m15 = (u1 - p1); double m16; - m16 = (a61 - a11); + m16 = (v1 - p1); + + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); double m23; - m23 = (a31 - a21); + m23 = (s2 - p2); double m24; - m24 = (a41 - a21); + m24 = (t2 - p2); double m25; - m25 = (a51 - a21); + m25 = (u2 - p2); double m26; - m26 = (a61 - a21); + m26 = (v2 - p2); + + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); double m34; - m34 = (a41 - a31); + m34 = (t3 - p3); double m35; - m35 = (a51 - a31); + m35 = (u3 - p3); double m36; - m36 = (a61 - a31); + m36 = (v3 - p3); + + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); double m45; - m45 = (a51 - a41); + m45 = (u4 - p4); double m46; - m46 = (a61 - a41); + m46 = (v4 - p4); + + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); double m56; - m56 = (a61 - a51); - double m012; - m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); - double m013; - m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); - double m014; - m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); - double m015; - m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); - double m016; - m016 = (((m01 * a62) - (m06 * a12)) + (m16 * a02)); - double m023; - m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); - double m024; - m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); - double m025; - m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); - double m026; - m026 = (((m02 * a62) - (m06 * a22)) + (m26 * a02)); - double m034; - m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); - double m035; - m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); - double m036; - m036 = (((m03 * a62) - (m06 * a32)) + (m36 * a02)); - double m045; - m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); - double m046; - m046 = (((m04 * a62) - (m06 * a42)) + (m46 * a02)); - double m056; - m056 = (((m05 * a62) - (m06 * a52)) + (m56 * a02)); - double m123; - m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); - double m124; - m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); - double m125; - m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); - double m126; - m126 = (((m12 * a62) - (m16 * a22)) + (m26 * a12)); - double m134; - m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); - double m135; - m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); - double m136; - m136 = (((m13 * a62) - (m16 * a32)) + (m36 * a12)); - double m145; - m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); - double m146; - m146 = (((m14 * a62) - (m16 * a42)) + (m46 * a12)); - double m156; - m156 = (((m15 * a62) - (m16 * a52)) + (m56 * a12)); - double m234; - m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); - double m235; - m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); - double m236; - m236 = (((m23 * a62) - (m26 * a32)) + (m36 * a22)); - double m245; - m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); - double m246; - m246 = (((m24 * a62) - (m26 * a42)) + (m46 * a22)); - double m256; - m256 = (((m25 * a62) - (m26 * a52)) + (m56 * a22)); - double m345; - m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); - double m346; - m346 = (((m34 * a62) - (m36 * a42)) + (m46 * a32)); - double m356; - m356 = (((m35 * a62) - (m36 * a52)) + (m56 * a32)); - double m456; - m456 = (((m45 * a62) - (m46 * a52)) + (m56 * a42)); - double m0123; - m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); - double m0124; - m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); - double m0125; - m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); - double m0126; - m0126 = ((((m012 * a63) - (m016 * a23)) + (m026 * a13)) - (m126 * a03)); - double m0134; - m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); - double m0135; - m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); - double m0136; - m0136 = ((((m013 * a63) - (m016 * a33)) + (m036 * a13)) - (m136 * a03)); - double m0145; - m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); - double m0146; - m0146 = ((((m014 * a63) - (m016 * a43)) + (m046 * a13)) - (m146 * a03)); - double m0156; - m0156 = ((((m015 * a63) - (m016 * a53)) + (m056 * a13)) - (m156 * a03)); - double m0234; - m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); - double m0235; - m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); - double m0236; - m0236 = ((((m023 * a63) - (m026 * a33)) + (m036 * a23)) - (m236 * a03)); - double m0245; - m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); - double m0246; - m0246 = ((((m024 * a63) - (m026 * a43)) + (m046 * a23)) - (m246 * a03)); - double m0256; - m0256 = ((((m025 * a63) - (m026 * a53)) + (m056 * a23)) - (m256 * a03)); - double m0345; - m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); - double m0346; - m0346 = ((((m034 * a63) - (m036 * a43)) + (m046 * a33)) - (m346 * a03)); - double m0356; - m0356 = ((((m035 * a63) - (m036 * a53)) + (m056 * a33)) - (m356 * a03)); - double m0456; - m0456 = ((((m045 * a63) - (m046 * a53)) + (m056 * a43)) - (m456 * a03)); - double m1234; - m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); - double m1235; - m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); - double m1236; - m1236 = ((((m123 * a63) - (m126 * a33)) + (m136 * a23)) - (m236 * a13)); - double m1245; - m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); - double m1246; - m1246 = ((((m124 * a63) - (m126 * a43)) + (m146 * a23)) - (m246 * a13)); - double m1256; - m1256 = ((((m125 * a63) - (m126 * a53)) + (m156 * a23)) - (m256 * a13)); - double m1345; - m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); - double m1346; - m1346 = ((((m134 * a63) - (m136 * a43)) + (m146 * a33)) - (m346 * a13)); - double m1356; - m1356 = ((((m135 * a63) - (m136 * a53)) + (m156 * a33)) - (m356 * a13)); - double m1456; - m1456 = ((((m145 * a63) - (m146 * a53)) + (m156 * a43)) - (m456 * a13)); - double m2345; - m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); - double m2346; - m2346 = ((((m234 * a63) - (m236 * a43)) + (m246 * a33)) - (m346 * a23)); - double m2356; - m2356 = ((((m235 * a63) - (m236 * a53)) + (m256 * a33)) - (m356 * a23)); - double m2456; - m2456 = ((((m245 * a63) - (m246 * a53)) + (m256 * a43)) - (m456 * a23)); - double m3456; - m3456 = ((((m345 * a63) - (m346 * a53)) + (m356 * a43)) - (m456 * a33)); - double m01234; - m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); - double m01235; - m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); - double m01236; - m01236 = (((((m0123 * a64) - (m0126 * a34)) + (m0136 * a24)) - (m0236 * a14)) + (m1236 * a04)); - double m01245; - m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); - double m01246; - m01246 = (((((m0124 * a64) - (m0126 * a44)) + (m0146 * a24)) - (m0246 * a14)) + (m1246 * a04)); - double m01256; - m01256 = (((((m0125 * a64) - (m0126 * a54)) + (m0156 * a24)) - (m0256 * a14)) + (m1256 * a04)); - double m01345; - m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); - double m01346; - m01346 = (((((m0134 * a64) - (m0136 * a44)) + (m0146 * a34)) - (m0346 * a14)) + (m1346 * a04)); - double m01356; - m01356 = (((((m0135 * a64) - (m0136 * a54)) + (m0156 * a34)) - (m0356 * a14)) + (m1356 * a04)); - double m01456; - m01456 = (((((m0145 * a64) - (m0146 * a54)) + (m0156 * a44)) - (m0456 * a14)) + (m1456 * a04)); - double m02345; - m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); - double m02346; - m02346 = (((((m0234 * a64) - (m0236 * a44)) + (m0246 * a34)) - (m0346 * a24)) + (m2346 * a04)); - double m02356; - m02356 = (((((m0235 * a64) - (m0236 * a54)) + (m0256 * a34)) - (m0356 * a24)) + (m2356 * a04)); - double m02456; - m02456 = (((((m0245 * a64) - (m0246 * a54)) + (m0256 * a44)) - (m0456 * a24)) + (m2456 * a04)); - double m03456; - m03456 = (((((m0345 * a64) - (m0346 * a54)) + (m0356 * a44)) - (m0456 * a34)) + (m3456 * a04)); - double m12345; - m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); - double m12346; - m12346 = (((((m1234 * a64) - (m1236 * a44)) + (m1246 * a34)) - (m1346 * a24)) + (m2346 * a14)); - double m12356; - m12356 = (((((m1235 * a64) - (m1236 * a54)) + (m1256 * a34)) - (m1356 * a24)) + (m2356 * a14)); - double m12456; - m12456 = (((((m1245 * a64) - (m1246 * a54)) + (m1256 * a44)) - (m1456 * a24)) + (m2456 * a14)); - double m13456; - m13456 = (((((m1345 * a64) - (m1346 * a54)) + (m1356 * a44)) - (m1456 * a34)) + (m3456 * a14)); - double m23456; - m23456 = (((((m2345 * a64) - (m2346 * a54)) + (m2356 * a44)) - (m2456 * a34)) + (m3456 * a24)); - double m012345; - m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); - double m012346; - m012346 = ((((((m01234 * a65) - (m01236 * a45)) + (m01246 * a35)) - (m01346 * a25)) + (m02346 * a15)) - (m12346 * a05)); - double m012356; - m012356 = ((((((m01235 * a65) - (m01236 * a55)) + (m01256 * a35)) - (m01356 * a25)) + (m02356 * a15)) - (m12356 * a05)); - double m012456; - m012456 = ((((((m01245 * a65) - (m01246 * a55)) + (m01256 * a45)) - (m01456 * a25)) + (m02456 * a15)) - (m12456 * a05)); - double m013456; - m013456 = ((((((m01345 * a65) - (m01346 * a55)) + (m01356 * a45)) - (m01456 * a35)) + (m03456 * a15)) - (m13456 * a05)); - double m023456; - m023456 = ((((((m02345 * a65) - (m02346 * a55)) + (m02356 * a45)) - (m02456 * a35)) + (m03456 * a25)) - (m23456 * a05)); - double m123456; - m123456 = ((((((m12345 * a65) - (m12346 * a55)) + (m12356 * a45)) - (m12456 * a35)) + (m13456 * a25)) - (m23456 * a15)); - double m0123456; - m0123456 = (((((((m012345 * a66) - (m012346 * a56)) + (m012356 * a46)) - (m012456 * a36)) + (m013456 * a26)) - (m023456 * a16)) + (m123456 * a06)); + m56 = (v5 - p5); + + double det = determinant(m01, m02, m03, m04, m05, m06, + m11, m12, m13, m14, m15, m16, + m21, m22, m23, m24, m25, m26, + m31, m32, m33, m34, m35, m36, + m41, m42, m43, m44, m45, m46, + m51, m52, m53, m54, m55, m56); + return sign(det); +} + +//===========generated ================== + +inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) { + double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m05; + m05 = (u0 - p0); + double m06; + m06 = (v0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m15; + m15 = (u1 - p1); + double m16; + m16 = (v1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m25; + m25 = (u2 - p2); + double m26; + m26 = (v2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double m35; + m35 = (u3 - p3); + double m36; + m36 = (v3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); + double m45; + m45 = (u4 - p4); + double m46; + m46 = (v4 - p4); + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); + double m56; + m56 = (v5 - p5); + double det; + det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); int int_tmp_result; double eps; - double max1 = fabs(a02); - if( (max1 < fabs(a12)) ) + double max1 = fabs(m01); + if( (max1 < fabs(m02)) ) { - max1 = fabs(a12); + max1 = fabs(m02); } - if( (max1 < fabs(a22)) ) + if( (max1 < fabs(m11)) ) { - max1 = fabs(a22); + max1 = fabs(m11); } - if( (max1 < fabs(a32)) ) + if( (max1 < fabs(m12)) ) { - max1 = fabs(a32); + max1 = fabs(m12); } - if( (max1 < fabs(a42)) ) + if( (max1 < fabs(m21)) ) { - max1 = fabs(a42); + max1 = fabs(m21); } - if( (max1 < fabs(a52)) ) + if( (max1 < fabs(m22)) ) { - max1 = fabs(a52); + max1 = fabs(m22); } - if( (max1 < fabs(a62)) ) + if( (max1 < fabs(m31)) ) { - max1 = fabs(a62); + max1 = fabs(m31); } - double max2 = fabs(a03); - if( (max2 < fabs(a13)) ) + if( (max1 < fabs(m32)) ) { - max2 = fabs(a13); + max1 = fabs(m32); } - if( (max2 < fabs(a23)) ) + if( (max1 < fabs(m41)) ) { - max2 = fabs(a23); + max1 = fabs(m41); } - if( (max2 < fabs(a33)) ) + if( (max1 < fabs(m42)) ) { - max2 = fabs(a33); + max1 = fabs(m42); } - if( (max2 < fabs(a43)) ) + double max2 = fabs(m03); + if( (max2 < fabs(m11)) ) { - max2 = fabs(a43); + max2 = fabs(m11); } - if( (max2 < fabs(a53)) ) + if( (max2 < fabs(m12)) ) { - max2 = fabs(a53); + max2 = fabs(m12); } - if( (max2 < fabs(a63)) ) + if( (max2 < fabs(m13)) ) { - max2 = fabs(a63); + max2 = fabs(m13); } - double max3 = fabs(a04); - if( (max3 < fabs(a14)) ) + if( (max2 < fabs(m21)) ) { - max3 = fabs(a14); + max2 = fabs(m21); } - if( (max3 < fabs(a24)) ) + if( (max2 < fabs(m22)) ) { - max3 = fabs(a24); + max2 = fabs(m22); } - if( (max3 < fabs(a34)) ) + if( (max2 < fabs(m23)) ) { - max3 = fabs(a34); + max2 = fabs(m23); } - if( (max3 < fabs(a44)) ) + if( (max2 < fabs(m31)) ) { - max3 = fabs(a44); + max2 = fabs(m31); } - if( (max3 < fabs(a54)) ) + if( (max2 < fabs(m32)) ) { - max3 = fabs(a54); + max2 = fabs(m32); } - if( (max3 < fabs(a64)) ) + if( (max2 < fabs(m33)) ) { - max3 = fabs(a64); + max2 = fabs(m33); } - double max4 = fabs(a05); - if( (max4 < fabs(a15)) ) + if( (max2 < fabs(m41)) ) { - max4 = fabs(a15); + max2 = fabs(m41); } - if( (max4 < fabs(a25)) ) + if( (max2 < fabs(m42)) ) { - max4 = fabs(a25); + max2 = fabs(m42); } - if( (max4 < fabs(a35)) ) + if( (max2 < fabs(m51)) ) { - max4 = fabs(a35); + max2 = fabs(m51); } - if( (max4 < fabs(a45)) ) + if( (max2 < fabs(m52)) ) { - max4 = fabs(a45); + max2 = fabs(m52); } - if( (max4 < fabs(a55)) ) + double max3 = fabs(m04); + if( (max3 < fabs(m14)) ) { - max4 = fabs(a55); + max3 = fabs(m14); } - if( (max4 < fabs(a65)) ) + if( (max3 < fabs(m24)) ) { - max4 = fabs(a65); + max3 = fabs(m24); } - double max5 = fabs(a06); - if( (max5 < fabs(a16)) ) + if( (max3 < fabs(m34)) ) { - max5 = fabs(a16); + max3 = fabs(m34); } - if( (max5 < fabs(a26)) ) + if( (max3 < fabs(m44)) ) { - max5 = fabs(a26); + max3 = fabs(m44); } - if( (max5 < fabs(a36)) ) + if( (max3 < fabs(m54)) ) { - max5 = fabs(a36); + max3 = fabs(m54); } - if( (max5 < fabs(a46)) ) + double max4 = fabs(m05); + if( (max4 < fabs(m15)) ) { - max5 = fabs(a46); + max4 = fabs(m15); } - if( (max5 < fabs(a56)) ) + if( (max4 < fabs(m25)) ) { - max5 = fabs(a56); + max4 = fabs(m25); } - if( (max5 < fabs(a66)) ) + if( (max4 < fabs(m35)) ) { - max5 = fabs(a66); + max4 = fabs(m35); } - double max6 = fabs(m01); - if( (max6 < fabs(m02)) ) + if( (max4 < fabs(m45)) ) { - max6 = fabs(m02); + max4 = fabs(m45); } - if( (max6 < fabs(m03)) ) + if( (max4 < fabs(m55)) ) { - max6 = fabs(m03); + max4 = fabs(m55); } - if( (max6 < fabs(m04)) ) + double max5 = fabs(m06); + if( (max5 < fabs(m16)) ) { - max6 = fabs(m04); + max5 = fabs(m16); } - if( (max6 < fabs(m05)) ) + if( (max5 < fabs(m26)) ) { - max6 = fabs(m05); + max5 = fabs(m26); } - if( (max6 < fabs(m06)) ) + if( (max5 < fabs(m36)) ) { - max6 = fabs(m06); + max5 = fabs(m36); } - if( (max6 < fabs(m12)) ) + if( (max5 < fabs(m46)) ) { - max6 = fabs(m12); + max5 = fabs(m46); } - if( (max6 < fabs(m13)) ) + if( (max5 < fabs(m56)) ) { - max6 = fabs(m13); + max5 = fabs(m56); } - if( (max6 < fabs(m14)) ) + double max6 = fabs(m13); + if( (max6 < fabs(m21)) ) { - max6 = fabs(m14); + max6 = fabs(m21); } - if( (max6 < fabs(m15)) ) + if( (max6 < fabs(m22)) ) { - max6 = fabs(m15); - } - if( (max6 < fabs(m16)) ) - { - max6 = fabs(m16); + max6 = fabs(m22); } if( (max6 < fabs(m23)) ) { max6 = fabs(m23); } - if( (max6 < fabs(m24)) ) + if( (max6 < fabs(m31)) ) { - max6 = fabs(m24); + max6 = fabs(m31); } - if( (max6 < fabs(m25)) ) + if( (max6 < fabs(m32)) ) { - max6 = fabs(m25); + max6 = fabs(m32); } - if( (max6 < fabs(m26)) ) + if( (max6 < fabs(m33)) ) { - max6 = fabs(m26); + max6 = fabs(m33); } - if( (max6 < fabs(m34)) ) + if( (max6 < fabs(m41)) ) { - max6 = fabs(m34); + max6 = fabs(m41); } - if( (max6 < fabs(m35)) ) + if( (max6 < fabs(m42)) ) { - max6 = fabs(m35); + max6 = fabs(m42); } - if( (max6 < fabs(m36)) ) + if( (max6 < fabs(m43)) ) { - max6 = fabs(m36); + max6 = fabs(m43); } - if( (max6 < fabs(m45)) ) + if( (max6 < fabs(m51)) ) { - max6 = fabs(m45); + max6 = fabs(m51); } - if( (max6 < fabs(m46)) ) + if( (max6 < fabs(m52)) ) { - max6 = fabs(m46); + max6 = fabs(m52); } - if( (max6 < fabs(m56)) ) + if( (max6 < fabs(m53)) ) { - max6 = fabs(m56); + max6 = fabs(m53); } double lower_bound_1; double upper_bound_1; @@ -519,7 +513,7 @@ inline int orientation( double a01, double a02, double a03, double a04, double a upper_bound_1 = max4; } } - if( (lower_bound_1 < 3.98278627399642140002e-50) ) + if( (lower_bound_1 < 4.82472686053427214432e-50) ) { return FPG_UNCERTAIN_VALUE; } @@ -529,14 +523,14 @@ inline int orientation( double a01, double a02, double a03, double a04, double a { return FPG_UNCERTAIN_VALUE; } - eps = (5.57471180948088246730e-12 * (((((max6 * max1) * max2) * max3) * max4) * max5)); - if( (m0123456 > eps) ) + eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5)); + if( (det > eps) ) { int_tmp_result = 1; } else { - if( (m0123456 < -eps) ) + if( (det < -eps) ) { int_tmp_result = -1; } From e170d7b0de7b7552203f1f5e5a3fd0e4b57986f4 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Tue, 1 Jul 2025 17:30:00 +0200 Subject: [PATCH 055/145] [Small Feature] Apply review: cleanup doc, remove old alias, fix tests --- .../CGAL/Linear_cell_complex_constructors.h | 5 ++--- .../doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h | 4 ++-- .../doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h | 5 ++--- .../Concepts/LinearCellComplexTraits.h | 4 ++-- .../doc/Linear_cell_complex/Linear_cell_complex.txt | 6 +++--- .../doc/Linear_cell_complex/PackageDescription.txt | 1 - .../include/CGAL/Linear_cell_complex_constructors.h | 6 ++---- .../test/Linear_cell_complex/Linear_cell_complex_3_test.h | 2 +- .../test/Linear_cell_complex/test_plane_graph_alias.cpp | 3 ++- .../test/Linear_cell_complex/test_polyhedron_3_alias.cpp | 3 ++- .../test/Linear_cell_complex/test_triangulation_alias.cpp | 6 ++++-- Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 8 -------- 12 files changed, 22 insertions(+), 31 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h index 7b18234b216..b91112d1dff 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h @@ -24,9 +24,8 @@ Here a small example: Middle: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure. Right: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure. -\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) -\sa `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) - +\sa `CGAL::triangulation_3_to_lcc` +\sa `CGAL::polyhedron_3_to_lcc` */ template typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& lcc, diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h index f4381dcf71c..ce0dc47401f 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h @@ -5,8 +5,8 @@ namespace CGAL{ Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) -\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) +\sa `CGAL::plane_graph_to_lcc` +\sa `CGAL::triangulation_3_to_lcc` */ template typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& lcc, diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h index 5106a95c923..aa86e5e6ffa 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h @@ -8,9 +8,8 @@ Objects are added in `lcc`, existing darts are not modified. Returns a dart crea \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) -\sa `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) -/// \sa `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) +\sa `CGAL::plane_graph_to_lcc` +\sa `CGAL::polyhedron_3_to_lcc` */ template diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h index 542e66c6137..e6a6f767393 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h @@ -64,7 +64,7 @@ which constructs a vector as the difference of points `p2-p1`, and \link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)` which constructs a vector as the difference of point `p` and a point at the origin (used in \link CGAL::barycenter `barycenter`\endlink -and `CGAL::plane_graph_to_lcc`, formerly `import_from_plane_graph`). +and `CGAL::plane_graph_to_lcc`). typedef unspecified_type Construct_vector; /*! @@ -103,7 +103,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink. typedef unspecified_type Direction_2; /*! -a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::plane_graph_to_lcc`, formerly `import_from_plane_graph`). +a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::plane_graph_to_lcc`). */ typedef unspecified_type Construct_direction_2; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index aaec8a6a6f1..7d2db0cbfd7 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -105,11 +105,11 @@ There are several member functions allowing to insert specific configurations of There are two functions allowing to build a linear cell complex from two other \cgal data types:
    -
  • \link ::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; (formerly `import_from_triangulation_3`) -
  • \link ::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. (formerly `import_from_polyhedron_3`) +
  • \link ::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; +
  • \link ::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
-Lastly, the function \link ::plane_graph_to_lcc `plane_graph_to_lcc(lcc,ais)`\endlink (formerly `import_from_plane_graph`) adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::plane_graph_to_lcc `reference manual`\endlink for the file format). +Lastly, the function \link ::plane_graph_to_lcc `plane_graph_to_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::plane_graph_to_lcc `reference manual`\endlink for the file format). \subsection Linear_cell_complexModificationOperations Modification Operations \anchor ssecmodifop diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 0665d6ce46a..0a521ff5a3c 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -65,7 +65,6 @@ - `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) - `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) - `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) -- `CGAL::polyhedron_3_flux_to_lcc` (formerly `import_from_polyhedron_3_flux`) \cgalCRPSubsection{Operations for Linear Cell Complex} - `CGAL::compute_normal_of_cell_0` diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index e858e72c620..cfa7fc077cd 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -208,7 +208,7 @@ import_from_plane_graph(LCC& alcc, std::istream& ais) template < class LCC > typename LCC::Dart_descriptor - iplane_graph_to_lcc(LCC& alcc, const char* filename) + plane_graph_to_lcc(LCC& alcc, const char* filename) { std::ifstream input(filename); if (!input.is_open()) return alcc.null_descriptor; @@ -220,9 +220,7 @@ template typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const char* filename) { - std::ifstream input(filename); - if (!input.is_open()) return alcc.null_descriptor; - return plane_graph_to_lcc(alcc, input); + return plane_graph_to_lcc(alcc, filename); } template < class LCC > diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index a7b20879296..4222e553c43 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -997,7 +997,7 @@ bool test_LCC_3() } in >> P; - CGAL::polyhedron_3_flux_to_lcc(lcc,P); + CGAL::polyhedron_3_to_lcc(lcc,P); if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) ) return false; diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index aac5108ee6d..9ecc3e3a694 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -2,6 +2,7 @@ #include #include #include +#include typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC; @@ -25,5 +26,5 @@ int main() auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); - return 0; + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 11fc4fe5434..8e12346480c 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -3,6 +3,7 @@ #include #include #include +#include typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; typedef CGAL::Polyhedron_3 Polyhedron; @@ -22,5 +23,5 @@ int main() auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); - return 0; + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index 7a2da81bb3d..b32fb2bcd03 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -2,6 +2,7 @@ #include #include #include +#include typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3; typedef CGAL::Delaunay_triangulation_3 Triangulation; @@ -19,5 +20,6 @@ int main() auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); - return 0; -} \ No newline at end of file + return EXIT_SUCCESS; +} + diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index 72e66bd02f3..cdcf6317ea1 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -122,14 +122,6 @@ import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) > (alcc, P); } -template < class LCC > -[[deprecated("Use polyhedron_3_flux_to_lcc instead")]] -typename LCC::Dart_descriptor -import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais) -{ - return polyhedron_3_flux_to_lcc(alcc, ais); -} - } // namespace CGAL #endif // CGAL_IMPORT_FROM_POLYHEDRON_3_H From 68d2be27986bae0c2a97ff02cbb37976f697442e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 1 Jul 2025 17:28:34 +0100 Subject: [PATCH 056/145] Less calls to abs() --- .../include/CGAL/NewKernel_d/orientationC4.h | 142 +++++++----------- 1 file changed, 54 insertions(+), 88 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h index 1c6cce210e0..5a921ab6473 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h @@ -115,94 +115,60 @@ inline int orientationC4( double p0, double p1, double p2, double p3, double q0, det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); int int_tmp_result; double eps; - double max1 = fabs(m01); - if( (max1 < fabs(m02)) ) - { - max1 = fabs(m02); - } - if( (max1 < fabs(m03)) ) - { - max1 = fabs(m03); - } - if( (max1 < fabs(m11)) ) - { - max1 = fabs(m11); - } - if( (max1 < fabs(m12)) ) - { - max1 = fabs(m12); - } - if( (max1 < fabs(m13)) ) - { - max1 = fabs(m13); - } - if( (max1 < fabs(m23)) ) - { - max1 = fabs(m23); - } - double max2 = fabs(m01); - if( (max2 < fabs(m02)) ) - { - max2 = fabs(m02); - } - if( (max2 < fabs(m11)) ) - { - max2 = fabs(m11); - } - if( (max2 < fabs(m12)) ) - { - max2 = fabs(m12); - } - if( (max2 < fabs(m21)) ) - { - max2 = fabs(m21); - } - if( (max2 < fabs(m22)) ) - { - max2 = fabs(m22); - } - if( (max2 < fabs(m23)) ) - { - max2 = fabs(m23); - } - if( (max2 < fabs(m33)) ) - { - max2 = fabs(m33); - } - double max3 = fabs(m04); - if( (max3 < fabs(m14)) ) - { - max3 = fabs(m14); - } - if( (max3 < fabs(m24)) ) - { - max3 = fabs(m24); - } - if( (max3 < fabs(m34)) ) - { - max3 = fabs(m34); - } - double max4 = fabs(m11); - if( (max4 < fabs(m12)) ) - { - max4 = fabs(m12); - } - if( (max4 < fabs(m21)) ) - { - max4 = fabs(m21); - } - if( (max4 < fabs(m22)) ) - { - max4 = fabs(m22); - } - if( (max4 < fabs(m31)) ) - { - max4 = fabs(m31); - } - if( (max4 < fabs(m32)) ) - { - max4 = fabs(m32); - } + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m21); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m22); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m31); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m32); + if( (max4 < am) ) { max4 = am; } + + double lower_bound_1; double upper_bound_1; lower_bound_1 = max1; From 63cc54c36701ed407a801cd975fcd7736af0755e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 1 Jul 2025 18:15:07 +0100 Subject: [PATCH 057/145] Less abs() --- .../include/CGAL/NewKernel_d/orientationC5.h | 223 +++++------- .../include/CGAL/NewKernel_d/orientationC6.h | 321 +++++++----------- 2 files changed, 201 insertions(+), 343 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index 981395fd978..692bad04bfe 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -167,147 +167,88 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); int int_tmp_result; double eps; - double max1 = fabs(m01); - if( (max1 < fabs(m02)) ) - { - max1 = fabs(m02); - } - if( (max1 < fabs(m03)) ) - { - max1 = fabs(m03); - } - if( (max1 < fabs(m11)) ) - { - max1 = fabs(m11); - } - if( (max1 < fabs(m12)) ) - { - max1 = fabs(m12); - } - if( (max1 < fabs(m13)) ) - { - max1 = fabs(m13); - } - if( (max1 < fabs(m21)) ) - { - max1 = fabs(m21); - } - if( (max1 < fabs(m22)) ) - { - max1 = fabs(m22); - } - if( (max1 < fabs(m23)) ) - { - max1 = fabs(m23); - } - if( (max1 < fabs(m33)) ) - { - max1 = fabs(m33); - } - double max2 = fabs(m01); - if( (max2 < fabs(m02)) ) - { - max2 = fabs(m02); - } - if( (max2 < fabs(m11)) ) - { - max2 = fabs(m11); - } - if( (max2 < fabs(m12)) ) - { - max2 = fabs(m12); - } - if( (max2 < fabs(m21)) ) - { - max2 = fabs(m21); - } - if( (max2 < fabs(m22)) ) - { - max2 = fabs(m22); - } - if( (max2 < fabs(m23)) ) - { - max2 = fabs(m23); - } - if( (max2 < fabs(m31)) ) - { - max2 = fabs(m31); - } - if( (max2 < fabs(m32)) ) - { - max2 = fabs(m32); - } - if( (max2 < fabs(m33)) ) - { - max2 = fabs(m33); - } - if( (max2 < fabs(m43)) ) - { - max2 = fabs(m43); - } - double max3 = fabs(m04); - if( (max3 < fabs(m14)) ) - { - max3 = fabs(m14); - } - if( (max3 < fabs(m24)) ) - { - max3 = fabs(m24); - } - if( (max3 < fabs(m34)) ) - { - max3 = fabs(m34); - } - if( (max3 < fabs(m44)) ) - { - max3 = fabs(m44); - } - double max4 = fabs(m05); - if( (max4 < fabs(m15)) ) - { - max4 = fabs(m15); - } - if( (max4 < fabs(m25)) ) - { - max4 = fabs(m25); - } - if( (max4 < fabs(m35)) ) - { - max4 = fabs(m35); - } - if( (max4 < fabs(m45)) ) - { - max4 = fabs(m45); - } - double max5 = fabs(m11); - if( (max5 < fabs(m12)) ) - { - max5 = fabs(m12); - } - if( (max5 < fabs(m21)) ) - { - max5 = fabs(m21); - } - if( (max5 < fabs(m22)) ) - { - max5 = fabs(m22); - } - if( (max5 < fabs(m31)) ) - { - max5 = fabs(m31); - } - if( (max5 < fabs(m32)) ) - { - max5 = fabs(m32); - } - if( (max5 < fabs(m41)) ) - { - max5 = fabs(m41); - } - if( (max5 < fabs(m42)) ) - { - max5 = fabs(m42); - } + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m33); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + + + double max5 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m21); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m22); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m31); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m32); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m41); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m42); + if( (max5 < am) ) { max5 = am; } + double lower_bound_1; double upper_bound_1; lower_bound_1 = max5; diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h index 0c1792230a9..a9654bcd781 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -252,208 +252,125 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); int int_tmp_result; double eps; - double max1 = fabs(m01); - if( (max1 < fabs(m02)) ) - { - max1 = fabs(m02); - } - if( (max1 < fabs(m11)) ) - { - max1 = fabs(m11); - } - if( (max1 < fabs(m12)) ) - { - max1 = fabs(m12); - } - if( (max1 < fabs(m21)) ) - { - max1 = fabs(m21); - } - if( (max1 < fabs(m22)) ) - { - max1 = fabs(m22); - } - if( (max1 < fabs(m31)) ) - { - max1 = fabs(m31); - } - if( (max1 < fabs(m32)) ) - { - max1 = fabs(m32); - } - if( (max1 < fabs(m41)) ) - { - max1 = fabs(m41); - } - if( (max1 < fabs(m42)) ) - { - max1 = fabs(m42); - } - double max2 = fabs(m03); - if( (max2 < fabs(m11)) ) - { - max2 = fabs(m11); - } - if( (max2 < fabs(m12)) ) - { - max2 = fabs(m12); - } - if( (max2 < fabs(m13)) ) - { - max2 = fabs(m13); - } - if( (max2 < fabs(m21)) ) - { - max2 = fabs(m21); - } - if( (max2 < fabs(m22)) ) - { - max2 = fabs(m22); - } - if( (max2 < fabs(m23)) ) - { - max2 = fabs(m23); - } - if( (max2 < fabs(m31)) ) - { - max2 = fabs(m31); - } - if( (max2 < fabs(m32)) ) - { - max2 = fabs(m32); - } - if( (max2 < fabs(m33)) ) - { - max2 = fabs(m33); - } - if( (max2 < fabs(m41)) ) - { - max2 = fabs(m41); - } - if( (max2 < fabs(m42)) ) - { - max2 = fabs(m42); - } - if( (max2 < fabs(m51)) ) - { - max2 = fabs(m51); - } - if( (max2 < fabs(m52)) ) - { - max2 = fabs(m52); - } - double max3 = fabs(m04); - if( (max3 < fabs(m14)) ) - { - max3 = fabs(m14); - } - if( (max3 < fabs(m24)) ) - { - max3 = fabs(m24); - } - if( (max3 < fabs(m34)) ) - { - max3 = fabs(m34); - } - if( (max3 < fabs(m44)) ) - { - max3 = fabs(m44); - } - if( (max3 < fabs(m54)) ) - { - max3 = fabs(m54); - } - double max4 = fabs(m05); - if( (max4 < fabs(m15)) ) - { - max4 = fabs(m15); - } - if( (max4 < fabs(m25)) ) - { - max4 = fabs(m25); - } - if( (max4 < fabs(m35)) ) - { - max4 = fabs(m35); - } - if( (max4 < fabs(m45)) ) - { - max4 = fabs(m45); - } - if( (max4 < fabs(m55)) ) - { - max4 = fabs(m55); - } - double max5 = fabs(m06); - if( (max5 < fabs(m16)) ) - { - max5 = fabs(m16); - } - if( (max5 < fabs(m26)) ) - { - max5 = fabs(m26); - } - if( (max5 < fabs(m36)) ) - { - max5 = fabs(m36); - } - if( (max5 < fabs(m46)) ) - { - max5 = fabs(m46); - } - if( (max5 < fabs(m56)) ) - { - max5 = fabs(m56); - } - double max6 = fabs(m13); - if( (max6 < fabs(m21)) ) - { - max6 = fabs(m21); - } - if( (max6 < fabs(m22)) ) - { - max6 = fabs(m22); - } - if( (max6 < fabs(m23)) ) - { - max6 = fabs(m23); - } - if( (max6 < fabs(m31)) ) - { - max6 = fabs(m31); - } - if( (max6 < fabs(m32)) ) - { - max6 = fabs(m32); - } - if( (max6 < fabs(m33)) ) - { - max6 = fabs(m33); - } - if( (max6 < fabs(m41)) ) - { - max6 = fabs(m41); - } - if( (max6 < fabs(m42)) ) - { - max6 = fabs(m42); - } - if( (max6 < fabs(m43)) ) - { - max6 = fabs(m43); - } - if( (max6 < fabs(m51)) ) - { - max6 = fabs(m51); - } - if( (max6 < fabs(m52)) ) - { - max6 = fabs(m52); - } - if( (max6 < fabs(m53)) ) - { - max6 = fabs(m53); - } + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m31); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m32); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m41); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m42); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m03); + am = CGAL::abs(m11); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m13); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m41); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m42); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m51); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m52); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m54); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m05); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m15); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m25); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m35); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m45); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m55); + if( (max3 < am) ) { max3 = am; } + + d + double max5 = CGAL::abs(m06); + am = CGAL::abs(m16); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m26); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m36); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m46); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m56); + if( (max5 < am) ) { max5 = am; } + + + double max6 = CGAL::abs(m13); + am = CGAL::abs(m21); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m22); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m23); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m31); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m32); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m33); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m41); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m42); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m43); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m51); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m52); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m53); + if( (max6 < am) ) { max6 = am; } + + double lower_bound_1; double upper_bound_1; lower_bound_1 = max6; From 496239a0ed62022154720a48ba3cf1007f285629 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Jul 2025 10:32:21 +0100 Subject: [PATCH 058/145] Integrate generated files --- .../internal/Static_filters/Orientation_4.h | 226 ++++++ .../internal/Static_filters/Orientation_5.h | 372 ++++------ .../internal/Static_filters/Orientation_6.h | 701 +++++------------- .../NewKernel_d/Cartesian_static_filters.h | 27 + .../include/CGAL/NewKernel_d/orientationC6.h | 30 +- .../benchmark/Triangulation/CMakeLists.txt | 2 + .../benchmark/Triangulation/bench4d.cpp | 62 ++ 7 files changed, 656 insertions(+), 764 deletions(-) create mode 100644 Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h create mode 100644 Triangulation/benchmark/Triangulation/bench4d.cpp diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h new file mode 100644 index 00000000000..a1cc4d494a1 --- /dev/null +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -0,0 +1,226 @@ +// Copyright (c) 2025 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H +#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H + +#include +#include +#include + +namespace CGAL { namespace internal { namespace Static_filters_predicates { + + + +template < typename K_base > +class Orientation_4 + : public K_base::Orientation_4 +{ + typedef typename K_base::Orientation Orientation; + typedef typename K_base::Point_4 Point_4; + typedef typename K_base::Orientation_4 Base; + +public: + using Base::operator(); + + Orientation + operator()(const Point_4 &p, const Point_4 &q, + const Point_4 &r, const Point_4 &s, + const Point_4 &t) const + { + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp); + + double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4; + + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(p.c4(), p4) && + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(q.c4(), q4) && + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(r.c4(), r4) && + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(s.c4(), s4) && + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && + fit_in_double(t.c4(), t4) ) + { + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t)); +double m01; + m01 = (q0 - p0); + double m02; + m02 = (r0 - p0); + double m03; + m03 = (s0 - p0); + double m04; + m04 = (t0 - p0); + double m11; + m11 = (q1 - p1); + double m12; + m12 = (r1 - p1); + double m13; + m13 = (s1 - p1); + double m14; + m14 = (t1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); + double m23; + m23 = (s2 - p2); + double m24; + m24 = (t2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); + double m34; + m34 = (t3 - p3); + double det; + det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); + int int_tmp_result; + double eps; + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m21); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m22); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m31); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m32); + if( (max4 < am) ) { max4 = am; } + + + double lower_bound_1; + double upper_bound_1; + lower_bound_1 = max1; + upper_bound_1 = max1; + if( (max2 < lower_bound_1) ) + { + lower_bound_1 = max2; + } + else + { + if( (max2 > upper_bound_1) ) + { + upper_bound_1 = max2; + } + } + if( (max3 < lower_bound_1) ) + { + lower_bound_1 = max3; + } + else + { + if( (max3 > upper_bound_1) ) + { + upper_bound_1 = max3; + } + } + if( (max4 < lower_bound_1) ) + { + lower_bound_1 = max4; + } + else + { + if( (max4 > upper_bound_1) ) + { + upper_bound_1 = max4; + } + } + if( (lower_bound_1 < 2.89273249588395272840e-74) ) + { + return Base::operator()(p, q, r, s, t); + } + else + { + if( (upper_bound_1 > 7.23700557733225900010e+75) ) + { + return Base::operator()(p, q, r, s, t); + } + eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3)); + if( (det > eps) ) + { + CGAL_assertion(should_be == POSITIVE); + return POSITIVE; + } + else + { + if( (det < -eps) ) + { + CGAL_assertion(should_be == NEGATIVE); + return NEGATIVE; + } + else + { + return Base::operator()(p, q, r, s, t); + } + } + } +} + return Base::operator()(p, q, r, s, t); + + } + +}; + +} } } // namespace CGAL::internal::Static_filters_predicates + +#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index 0ddf9dfb364..c266ee694e8 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -59,11 +59,10 @@ public: fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) && fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && fit_in_double(u.c4(), u4)) + { - CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u)); - double det; - double determinant_with_1_in_row_0_return_value; - double m01; + CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u)); + double m01; m01 = (q0 - p0); double m02; m02 = (r0 - p0); @@ -73,254 +72,132 @@ public: m04 = (t0 - p0); double m05; m05 = (u0 - p0); + double m11; + m11 = (q1 - p1); double m12; - m12 = (r0 - q0); + m12 = (r1 - p1); double m13; - m13 = (s0 - q0); + m13 = (s1 - p1); double m14; - m14 = (t0 - q0); + m14 = (t1 - p1); double m15; - m15 = (u0 - q0); + m15 = (u1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); double m23; - m23 = (s0 - r0); + m23 = (s2 - p2); double m24; - m24 = (t0 - r0); + m24 = (t2 - p2); double m25; - m25 = (u0 - r0); + m25 = (u2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); double m34; - m34 = (t0 - s0); + m34 = (t3 - p3); double m35; - m35 = (u0 - s0); + m35 = (u3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); double m45; - m45 = (u0 - t0); - double m012; - m012 = (((m01 * r1) - (m02 * q1)) + (m12 * p1)); - double m013; - m013 = (((m01 * s1) - (m03 * q1)) + (m13 * p1)); - double m014; - m014 = (((m01 * t1) - (m04 * q1)) + (m14 * p1)); - double m015; - m015 = (((m01 * u1) - (m05 * q1)) + (m15 * p1)); - double m023; - m023 = (((m02 * s1) - (m03 * r1)) + (m23 * p1)); - double m024; - m024 = (((m02 * t1) - (m04 * r1)) + (m24 * p1)); - double m025; - m025 = (((m02 * u1) - (m05 * r1)) + (m25 * p1)); - double m034; - m034 = (((m03 * t1) - (m04 * s1)) + (m34 * p1)); - double m035; - m035 = (((m03 * u1) - (m05 * s1)) + (m35 * p1)); - double m045; - m045 = (((m04 * u1) - (m05 * t1)) + (m45 * p1)); - double m123; - m123 = (((m12 * s1) - (m13 * r1)) + (m23 * q1)); - double m124; - m124 = (((m12 * t1) - (m14 * r1)) + (m24 * q1)); - double m125; - m125 = (((m12 * u1) - (m15 * r1)) + (m25 * q1)); - double m134; - m134 = (((m13 * t1) - (m14 * s1)) + (m34 * q1)); - double m135; - m135 = (((m13 * u1) - (m15 * s1)) + (m35 * q1)); - double m145; - m145 = (((m14 * u1) - (m15 * t1)) + (m45 * q1)); - double m234; - m234 = (((m23 * t1) - (m24 * s1)) + (m34 * r1)); - double m235; - m235 = (((m23 * u1) - (m25 * s1)) + (m35 * r1)); - double m245; - m245 = (((m24 * u1) - (m25 * t1)) + (m45 * r1)); - double m345; - m345 = (((m34 * u1) - (m35 * t1)) + (m45 * s1)); - double m0123; - m0123 = ((((m012 * s2) - (m013 * r2)) + (m023 * q2)) - (m123 * p2)); - double m0124; - m0124 = ((((m012 * t2) - (m014 * r2)) + (m024 * q2)) - (m124 * p2)); - double m0125; - m0125 = ((((m012 * u2) - (m015 * r2)) + (m025 * q2)) - (m125 * p2)); - double m0134; - m0134 = ((((m013 * t2) - (m014 * s2)) + (m034 * q2)) - (m134 * p2)); - double m0135; - m0135 = ((((m013 * u2) - (m015 * s2)) + (m035 * q2)) - (m135 * p2)); - double m0145; - m0145 = ((((m014 * u2) - (m015 * t2)) + (m045 * q2)) - (m145 * p2)); - double m0234; - m0234 = ((((m023 * t2) - (m024 * s2)) + (m034 * r2)) - (m234 * p2)); - double m0235; - m0235 = ((((m023 * u2) - (m025 * s2)) + (m035 * r2)) - (m235 * p2)); - double m0245; - m0245 = ((((m024 * u2) - (m025 * t2)) + (m045 * r2)) - (m245 * p2)); - double m0345; - m0345 = ((((m034 * u2) - (m035 * t2)) + (m045 * s2)) - (m345 * p2)); - double m1234; - m1234 = ((((m123 * t2) - (m124 * s2)) + (m134 * r2)) - (m234 * q2)); - double m1235; - m1235 = ((((m123 * u2) - (m125 * s2)) + (m135 * r2)) - (m235 * q2)); - double m1245; - m1245 = ((((m124 * u2) - (m125 * t2)) + (m145 * r2)) - (m245 * q2)); - double m1345; - m1345 = ((((m134 * u2) - (m135 * t2)) + (m145 * s2)) - (m345 * q2)); - double m2345; - m2345 = ((((m234 * u2) - (m235 * t2)) + (m245 * s2)) - (m345 * r2)); - double m01234; - m01234 = (((((m0123 * t3) - (m0124 * s3)) + (m0134 * r3)) - (m0234 * q3)) + (m1234 * p3)); - double m01235; - m01235 = (((((m0123 * u3) - (m0125 * s3)) + (m0135 * r3)) - (m0235 * q3)) + (m1235 * p3)); - double m01245; - m01245 = (((((m0124 * u3) - (m0125 * t3)) + (m0145 * r3)) - (m0245 * q3)) + (m1245 * p3)); - double m01345; - m01345 = (((((m0134 * u3) - (m0135 * t3)) + (m0145 * s3)) - (m0345 * q3)) + (m1345 * p3)); - double m02345; - m02345 = (((((m0234 * u3) - (m0235 * t3)) + (m0245 * s3)) - (m0345 * r3)) + (m2345 * p3)); - double m12345; - m12345 = (((((m1234 * u3) - (m1235 * t3)) + (m1245 * s3)) - (m1345 * r3)) + (m2345 * q3)); - double m012345; - m012345 = ((((((m01234 * u4) - (m01235 * t4)) + (m01245 * s4)) - (m01345 * r4)) + (m02345 * q4)) - (m12345 * p4)); - determinant_with_1_in_row_0_return_value = m012345; - det = determinant_with_1_in_row_0_return_value; + m45 = (u4 - p4); + double det; + det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); + int int_tmp_result; double eps; - double max1 = CGAL::abs(p1); - if( (max1 < CGAL::abs(q1)) ) - { - max1 = CGAL::abs(q1); - } - if( (max1 < CGAL::abs(r1)) ) - { - max1 = CGAL::abs(r1); - } - if( (max1 < CGAL::abs(s1)) ) - { - max1 = CGAL::abs(s1); - } - if( (max1 < CGAL::abs(t1)) ) - { - max1 = CGAL::abs(t1); - } - if( (max1 < CGAL::abs(u1)) ) - { - max1 = CGAL::abs(u1); - } - double max2 = CGAL::abs(p2); - if( (max2 < CGAL::abs(q2)) ) - { - max2 = CGAL::abs(q2); - } - if( (max2 < CGAL::abs(r2)) ) - { - max2 = CGAL::abs(r2); - } - if( (max2 < CGAL::abs(s2)) ) - { - max2 = CGAL::abs(s2); - } - if( (max2 < CGAL::abs(t2)) ) - { - max2 = CGAL::abs(t2); - } - if( (max2 < CGAL::abs(u2)) ) - { - max2 = CGAL::abs(u2); - } - double max3 = CGAL::abs(p3); - if( (max3 < CGAL::abs(q3)) ) - { - max3 = CGAL::abs(q3); - } - if( (max3 < CGAL::abs(r3)) ) - { - max3 = CGAL::abs(r3); - } - if( (max3 < CGAL::abs(s3)) ) - { - max3 = CGAL::abs(s3); - } - if( (max3 < CGAL::abs(t3)) ) - { - max3 = CGAL::abs(t3); - } - if( (max3 < CGAL::abs(u3)) ) - { - max3 = CGAL::abs(u3); - } - double max4 = CGAL::abs(p4); - if( (max4 < CGAL::abs(q4)) ) - { - max4 = CGAL::abs(q4); - } - if( (max4 < CGAL::abs(r4)) ) - { - max4 = CGAL::abs(r4); - } - if( (max4 < CGAL::abs(s4)) ) - { - max4 = CGAL::abs(s4); - } - if( (max4 < CGAL::abs(t4)) ) - { - max4 = CGAL::abs(t4); - } - if( (max4 < CGAL::abs(u4)) ) - { - max4 = CGAL::abs(u4); - } - double max5 = CGAL::abs(m01); - if( (max5 < CGAL::abs(m05)) ) - { - max5 = CGAL::abs(m05); - } - if( (max5 < CGAL::abs(m04)) ) - { - max5 = CGAL::abs(m04); - } - if( (max5 < CGAL::abs(m03)) ) - { - max5 = CGAL::abs(m03); - } - if( (max5 < CGAL::abs(m02)) ) - { - max5 = CGAL::abs(m02); - } - if( (max5 < CGAL::abs(m15)) ) - { - max5 = CGAL::abs(m15); - } - if( (max5 < CGAL::abs(m14)) ) - { - max5 = CGAL::abs(m14); - } - if( (max5 < CGAL::abs(m13)) ) - { - max5 = CGAL::abs(m13); - } - if( (max5 < CGAL::abs(m12)) ) - { - max5 = CGAL::abs(m12); - } - if( (max5 < CGAL::abs(m34)) ) - { - max5 = CGAL::abs(m34); - } - if( (max5 < CGAL::abs(m25)) ) - { - max5 = CGAL::abs(m25); - } - if( (max5 < CGAL::abs(m24)) ) - { - max5 = CGAL::abs(m24); - } - if( (max5 < CGAL::abs(m23)) ) - { - max5 = CGAL::abs(m23); - } - if( (max5 < CGAL::abs(m45)) ) - { - max5 = CGAL::abs(m45); - } - if( (max5 < CGAL::abs(m35)) ) - { - max5 = CGAL::abs(m35); - } + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m03); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m13); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m23); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m33); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m01); + am = CGAL::abs(m02); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m11); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + + + double max5 = CGAL::abs(m11); + am = CGAL::abs(m12); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m21); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m22); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m31); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m32); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m41); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m42); + if( (max5 < am) ) { max5 = am; } + double lower_bound_1; double upper_bound_1; lower_bound_1 = max5; @@ -369,7 +246,7 @@ public: upper_bound_1 = max4; } } - if( (lower_bound_1 < 8.19482853969781542511e-60) ) + if( (lower_bound_1 < 9.99657131447050328602e-60) ) { return Base::operator()(p, q, r, s, t, u); } @@ -379,7 +256,7 @@ public: { return Base::operator()(p, q, r, s, t, u); } - eps = (6.02067348555779570000e-13 * ((((max5 * max1) * max2) * max3) * max4)); + eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4)); if( (det > eps) ) { CGAL_assertion(should_be == POSITIVE); @@ -392,10 +269,15 @@ public: CGAL_assertion(should_be == NEGATIVE); return NEGATIVE; } - + else + { + return Base::operator()(p, q, r, s, t, u); + } } } - } + + } + return Base::operator()(p, q, r, s, t, u); } diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 935b164645d..46d3570f7f4 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -45,534 +45,229 @@ public: a51, a52, a53, a54, a55, a56, a61, a62, a63, a64, a65, a66; - if (fit_in_double(p.c0(), a01) && fit_in_double(p.c1(), a02) && - fit_in_double(p.c2(), a03) && fit_in_double(p.c3(), a04) && - fit_in_double(p.c4(), a05) && fit_in_double(p.c5(), a06) && + double p0, p1, p2, p3, p4, p5, q0, q1, q2, q3, q4, q5, r0, r1, r2, r3, r4, r5, s0, s1, s2, s3, s4, s5, t0, t1, t2, t3, t4, t5, u0, u1, u2, u3, u4, u5, v0, v1, v2, v3, v4, v5; + if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && + fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && + fit_in_double(p.c4(), p4) && fit_in_double(p.c5(), p5) && - fit_in_double(q.c0(), a11) && fit_in_double(q.c1(), a12) && - fit_in_double(q.c2(), a13) && fit_in_double(q.c3(), a14) && - fit_in_double(q.c4(), a15) && fit_in_double(q.c5(), a16) && + fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && + fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && + fit_in_double(q.c4(), q4) && fit_in_double(q.c5(), q5) && - fit_in_double(r.c0(), a21) && fit_in_double(r.c1(), a22) && - fit_in_double(r.c2(), a23) && fit_in_double(r.c3(), a24) && - fit_in_double(r.c4(), a25) && fit_in_double(r.c5(), a26) && + fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && + fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && + fit_in_double(r.c4(), r4) && fit_in_double(r.c5(), r5) && - fit_in_double(s.c0(), a31) && fit_in_double(s.c1(), a32) && - fit_in_double(s.c2(), a33) && fit_in_double(s.c3(), a34) && - fit_in_double(s.c4(), a35) && fit_in_double(s.c5(), a36) && + fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && + fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && + fit_in_double(s.c4(), s4) && fit_in_double(s.c5(), s5) && - fit_in_double(t.c0(), a41) && fit_in_double(t.c1(), a42) && - fit_in_double(t.c2(), a43) && fit_in_double(t.c3(), a44) && - fit_in_double(t.c4(), a45) && fit_in_double(t.c5(), a46) && + fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && + fit_in_double(t.c4(), t4) && fit_in_double(t.c5(), t5) && - fit_in_double(u.c0(), a51) && fit_in_double(u.c1(), a52) && - fit_in_double(u.c2(), a53) && fit_in_double(u.c3(), a54) && - fit_in_double(u.c4(), a55) && fit_in_double(u.c5(), a56) && + fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) && + fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) && + fit_in_double(u.c4(), u4) && fit_in_double(u.c5(), u5) && - fit_in_double(v.c0(), a61) && fit_in_double(v.c1(), a62) && - fit_in_double(v.c2(), a63) && fit_in_double(v.c3(), a64) && - fit_in_double(v.c4(), a65) && fit_in_double(v.c5(), a66)) + fit_in_double(v.c0(), v0) && fit_in_double(v.c1(), v1) && + fit_in_double(v.c2(), v2) && fit_in_double(v.c3(), v3) && + fit_in_double(v.c4(), v4) && fit_in_double(v.c5(), v5)) { CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u, v)); double m01; - m01 = (a11 - a01); + m01 = (q0 - p0); double m02; - m02 = (a21 - a01); + m02 = (r0 - p0); double m03; - m03 = (a31 - a01); + m03 = (s0 - p0); double m04; - m04 = (a41 - a01); + m04 = (t0 - p0); double m05; - m05 = (a51 - a01); + m05 = (u0 - p0); double m06; - m06 = (a61 - a01); + m06 = (v0 - p0); + double m11; + m11 = (q1 - p1); double m12; - m12 = (a21 - a11); + m12 = (r1 - p1); double m13; - m13 = (a31 - a11); + m13 = (s1 - p1); double m14; - m14 = (a41 - a11); + m14 = (t1 - p1); double m15; - m15 = (a51 - a11); + m15 = (u1 - p1); double m16; - m16 = (a61 - a11); + m16 = (v1 - p1); + double m21; + m21 = (q2 - p2); + double m22; + m22 = (r2 - p2); double m23; - m23 = (a31 - a21); + m23 = (s2 - p2); double m24; - m24 = (a41 - a21); + m24 = (t2 - p2); double m25; - m25 = (a51 - a21); + m25 = (u2 - p2); double m26; - m26 = (a61 - a21); + m26 = (v2 - p2); + double m31; + m31 = (q3 - p3); + double m32; + m32 = (r3 - p3); + double m33; + m33 = (s3 - p3); double m34; - m34 = (a41 - a31); + m34 = (t3 - p3); double m35; - m35 = (a51 - a31); + m35 = (u3 - p3); double m36; - m36 = (a61 - a31); + m36 = (v3 - p3); + double m41; + m41 = (q4 - p4); + double m42; + m42 = (r4 - p4); + double m43; + m43 = (s4 - p4); + double m44; + m44 = (t4 - p4); double m45; - m45 = (a51 - a41); + m45 = (u4 - p4); double m46; - m46 = (a61 - a41); + m46 = (v4 - p4); + double m51; + m51 = (q5 - p5); + double m52; + m52 = (r5 - p5); + double m53; + m53 = (s5 - p5); + double m54; + m54 = (t5 - p5); + double m55; + m55 = (u5 - p5); double m56; - m56 = (a61 - a51); - double m012; - m012 = (((m01 * a22) - (m02 * a12)) + (m12 * a02)); - double m013; - m013 = (((m01 * a32) - (m03 * a12)) + (m13 * a02)); - double m014; - m014 = (((m01 * a42) - (m04 * a12)) + (m14 * a02)); - double m015; - m015 = (((m01 * a52) - (m05 * a12)) + (m15 * a02)); - double m016; - m016 = (((m01 * a62) - (m06 * a12)) + (m16 * a02)); - double m023; - m023 = (((m02 * a32) - (m03 * a22)) + (m23 * a02)); - double m024; - m024 = (((m02 * a42) - (m04 * a22)) + (m24 * a02)); - double m025; - m025 = (((m02 * a52) - (m05 * a22)) + (m25 * a02)); - double m026; - m026 = (((m02 * a62) - (m06 * a22)) + (m26 * a02)); - double m034; - m034 = (((m03 * a42) - (m04 * a32)) + (m34 * a02)); - double m035; - m035 = (((m03 * a52) - (m05 * a32)) + (m35 * a02)); - double m036; - m036 = (((m03 * a62) - (m06 * a32)) + (m36 * a02)); - double m045; - m045 = (((m04 * a52) - (m05 * a42)) + (m45 * a02)); - double m046; - m046 = (((m04 * a62) - (m06 * a42)) + (m46 * a02)); - double m056; - m056 = (((m05 * a62) - (m06 * a52)) + (m56 * a02)); - double m123; - m123 = (((m12 * a32) - (m13 * a22)) + (m23 * a12)); - double m124; - m124 = (((m12 * a42) - (m14 * a22)) + (m24 * a12)); - double m125; - m125 = (((m12 * a52) - (m15 * a22)) + (m25 * a12)); - double m126; - m126 = (((m12 * a62) - (m16 * a22)) + (m26 * a12)); - double m134; - m134 = (((m13 * a42) - (m14 * a32)) + (m34 * a12)); - double m135; - m135 = (((m13 * a52) - (m15 * a32)) + (m35 * a12)); - double m136; - m136 = (((m13 * a62) - (m16 * a32)) + (m36 * a12)); - double m145; - m145 = (((m14 * a52) - (m15 * a42)) + (m45 * a12)); - double m146; - m146 = (((m14 * a62) - (m16 * a42)) + (m46 * a12)); - double m156; - m156 = (((m15 * a62) - (m16 * a52)) + (m56 * a12)); - double m234; - m234 = (((m23 * a42) - (m24 * a32)) + (m34 * a22)); - double m235; - m235 = (((m23 * a52) - (m25 * a32)) + (m35 * a22)); - double m236; - m236 = (((m23 * a62) - (m26 * a32)) + (m36 * a22)); - double m245; - m245 = (((m24 * a52) - (m25 * a42)) + (m45 * a22)); - double m246; - m246 = (((m24 * a62) - (m26 * a42)) + (m46 * a22)); - double m256; - m256 = (((m25 * a62) - (m26 * a52)) + (m56 * a22)); - double m345; - m345 = (((m34 * a52) - (m35 * a42)) + (m45 * a32)); - double m346; - m346 = (((m34 * a62) - (m36 * a42)) + (m46 * a32)); - double m356; - m356 = (((m35 * a62) - (m36 * a52)) + (m56 * a32)); - double m456; - m456 = (((m45 * a62) - (m46 * a52)) + (m56 * a42)); - double m0123; - m0123 = ((((m012 * a33) - (m013 * a23)) + (m023 * a13)) - (m123 * a03)); - double m0124; - m0124 = ((((m012 * a43) - (m014 * a23)) + (m024 * a13)) - (m124 * a03)); - double m0125; - m0125 = ((((m012 * a53) - (m015 * a23)) + (m025 * a13)) - (m125 * a03)); - double m0126; - m0126 = ((((m012 * a63) - (m016 * a23)) + (m026 * a13)) - (m126 * a03)); - double m0134; - m0134 = ((((m013 * a43) - (m014 * a33)) + (m034 * a13)) - (m134 * a03)); - double m0135; - m0135 = ((((m013 * a53) - (m015 * a33)) + (m035 * a13)) - (m135 * a03)); - double m0136; - m0136 = ((((m013 * a63) - (m016 * a33)) + (m036 * a13)) - (m136 * a03)); - double m0145; - m0145 = ((((m014 * a53) - (m015 * a43)) + (m045 * a13)) - (m145 * a03)); - double m0146; - m0146 = ((((m014 * a63) - (m016 * a43)) + (m046 * a13)) - (m146 * a03)); - double m0156; - m0156 = ((((m015 * a63) - (m016 * a53)) + (m056 * a13)) - (m156 * a03)); - double m0234; - m0234 = ((((m023 * a43) - (m024 * a33)) + (m034 * a23)) - (m234 * a03)); - double m0235; - m0235 = ((((m023 * a53) - (m025 * a33)) + (m035 * a23)) - (m235 * a03)); - double m0236; - m0236 = ((((m023 * a63) - (m026 * a33)) + (m036 * a23)) - (m236 * a03)); - double m0245; - m0245 = ((((m024 * a53) - (m025 * a43)) + (m045 * a23)) - (m245 * a03)); - double m0246; - m0246 = ((((m024 * a63) - (m026 * a43)) + (m046 * a23)) - (m246 * a03)); - double m0256; - m0256 = ((((m025 * a63) - (m026 * a53)) + (m056 * a23)) - (m256 * a03)); - double m0345; - m0345 = ((((m034 * a53) - (m035 * a43)) + (m045 * a33)) - (m345 * a03)); - double m0346; - m0346 = ((((m034 * a63) - (m036 * a43)) + (m046 * a33)) - (m346 * a03)); - double m0356; - m0356 = ((((m035 * a63) - (m036 * a53)) + (m056 * a33)) - (m356 * a03)); - double m0456; - m0456 = ((((m045 * a63) - (m046 * a53)) + (m056 * a43)) - (m456 * a03)); - double m1234; - m1234 = ((((m123 * a43) - (m124 * a33)) + (m134 * a23)) - (m234 * a13)); - double m1235; - m1235 = ((((m123 * a53) - (m125 * a33)) + (m135 * a23)) - (m235 * a13)); - double m1236; - m1236 = ((((m123 * a63) - (m126 * a33)) + (m136 * a23)) - (m236 * a13)); - double m1245; - m1245 = ((((m124 * a53) - (m125 * a43)) + (m145 * a23)) - (m245 * a13)); - double m1246; - m1246 = ((((m124 * a63) - (m126 * a43)) + (m146 * a23)) - (m246 * a13)); - double m1256; - m1256 = ((((m125 * a63) - (m126 * a53)) + (m156 * a23)) - (m256 * a13)); - double m1345; - m1345 = ((((m134 * a53) - (m135 * a43)) + (m145 * a33)) - (m345 * a13)); - double m1346; - m1346 = ((((m134 * a63) - (m136 * a43)) + (m146 * a33)) - (m346 * a13)); - double m1356; - m1356 = ((((m135 * a63) - (m136 * a53)) + (m156 * a33)) - (m356 * a13)); - double m1456; - m1456 = ((((m145 * a63) - (m146 * a53)) + (m156 * a43)) - (m456 * a13)); - double m2345; - m2345 = ((((m234 * a53) - (m235 * a43)) + (m245 * a33)) - (m345 * a23)); - double m2346; - m2346 = ((((m234 * a63) - (m236 * a43)) + (m246 * a33)) - (m346 * a23)); - double m2356; - m2356 = ((((m235 * a63) - (m236 * a53)) + (m256 * a33)) - (m356 * a23)); - double m2456; - m2456 = ((((m245 * a63) - (m246 * a53)) + (m256 * a43)) - (m456 * a23)); - double m3456; - m3456 = ((((m345 * a63) - (m346 * a53)) + (m356 * a43)) - (m456 * a33)); - double m01234; - m01234 = (((((m0123 * a44) - (m0124 * a34)) + (m0134 * a24)) - (m0234 * a14)) + (m1234 * a04)); - double m01235; - m01235 = (((((m0123 * a54) - (m0125 * a34)) + (m0135 * a24)) - (m0235 * a14)) + (m1235 * a04)); - double m01236; - m01236 = (((((m0123 * a64) - (m0126 * a34)) + (m0136 * a24)) - (m0236 * a14)) + (m1236 * a04)); - double m01245; - m01245 = (((((m0124 * a54) - (m0125 * a44)) + (m0145 * a24)) - (m0245 * a14)) + (m1245 * a04)); - double m01246; - m01246 = (((((m0124 * a64) - (m0126 * a44)) + (m0146 * a24)) - (m0246 * a14)) + (m1246 * a04)); - double m01256; - m01256 = (((((m0125 * a64) - (m0126 * a54)) + (m0156 * a24)) - (m0256 * a14)) + (m1256 * a04)); - double m01345; - m01345 = (((((m0134 * a54) - (m0135 * a44)) + (m0145 * a34)) - (m0345 * a14)) + (m1345 * a04)); - double m01346; - m01346 = (((((m0134 * a64) - (m0136 * a44)) + (m0146 * a34)) - (m0346 * a14)) + (m1346 * a04)); - double m01356; - m01356 = (((((m0135 * a64) - (m0136 * a54)) + (m0156 * a34)) - (m0356 * a14)) + (m1356 * a04)); - double m01456; - m01456 = (((((m0145 * a64) - (m0146 * a54)) + (m0156 * a44)) - (m0456 * a14)) + (m1456 * a04)); - double m02345; - m02345 = (((((m0234 * a54) - (m0235 * a44)) + (m0245 * a34)) - (m0345 * a24)) + (m2345 * a04)); - double m02346; - m02346 = (((((m0234 * a64) - (m0236 * a44)) + (m0246 * a34)) - (m0346 * a24)) + (m2346 * a04)); - double m02356; - m02356 = (((((m0235 * a64) - (m0236 * a54)) + (m0256 * a34)) - (m0356 * a24)) + (m2356 * a04)); - double m02456; - m02456 = (((((m0245 * a64) - (m0246 * a54)) + (m0256 * a44)) - (m0456 * a24)) + (m2456 * a04)); - double m03456; - m03456 = (((((m0345 * a64) - (m0346 * a54)) + (m0356 * a44)) - (m0456 * a34)) + (m3456 * a04)); - double m12345; - m12345 = (((((m1234 * a54) - (m1235 * a44)) + (m1245 * a34)) - (m1345 * a24)) + (m2345 * a14)); - double m12346; - m12346 = (((((m1234 * a64) - (m1236 * a44)) + (m1246 * a34)) - (m1346 * a24)) + (m2346 * a14)); - double m12356; - m12356 = (((((m1235 * a64) - (m1236 * a54)) + (m1256 * a34)) - (m1356 * a24)) + (m2356 * a14)); - double m12456; - m12456 = (((((m1245 * a64) - (m1246 * a54)) + (m1256 * a44)) - (m1456 * a24)) + (m2456 * a14)); - double m13456; - m13456 = (((((m1345 * a64) - (m1346 * a54)) + (m1356 * a44)) - (m1456 * a34)) + (m3456 * a14)); - double m23456; - m23456 = (((((m2345 * a64) - (m2346 * a54)) + (m2356 * a44)) - (m2456 * a34)) + (m3456 * a24)); - double m012345; - m012345 = ((((((m01234 * a55) - (m01235 * a45)) + (m01245 * a35)) - (m01345 * a25)) + (m02345 * a15)) - (m12345 * a05)); - double m012346; - m012346 = ((((((m01234 * a65) - (m01236 * a45)) + (m01246 * a35)) - (m01346 * a25)) + (m02346 * a15)) - (m12346 * a05)); - double m012356; - m012356 = ((((((m01235 * a65) - (m01236 * a55)) + (m01256 * a35)) - (m01356 * a25)) + (m02356 * a15)) - (m12356 * a05)); - double m012456; - m012456 = ((((((m01245 * a65) - (m01246 * a55)) + (m01256 * a45)) - (m01456 * a25)) + (m02456 * a15)) - (m12456 * a05)); - double m013456; - m013456 = ((((((m01345 * a65) - (m01346 * a55)) + (m01356 * a45)) - (m01456 * a35)) + (m03456 * a15)) - (m13456 * a05)); - double m023456; - m023456 = ((((((m02345 * a65) - (m02346 * a55)) + (m02356 * a45)) - (m02456 * a35)) + (m03456 * a25)) - (m23456 * a05)); - double m123456; - m123456 = ((((((m12345 * a65) - (m12346 * a55)) + (m12356 * a45)) - (m12456 * a35)) + (m13456 * a25)) - (m23456 * a15)); - double m0123456; - m0123456 = (((((((m012345 * a66) - (m012346 * a56)) + (m012356 * a46)) - (m012456 * a36)) + (m013456 * a26)) - (m023456 * a16)) + (m123456 * a06)); + m56 = (v5 - p5); + double det; + det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); int int_tmp_result; double eps; - double max1 = CGAL::abs(a02); - double tmp = CGAL::abs(a12); - if( max1 < tmp ) - { - max1 = tmp; - } - tmp = CGAL::abs(a22); - if( max1 < tmp ) - { - max1 = tmp; - } - tmp = CGAL::abs(a32); - if( max1 < tmp) - { - max1 = tmp; - } - tmp = CGAL::abs(a42); - if( max1 < tmp) - { - max1 = tmp; - } - tmp = CGAL::abs(a52); - if(max1 < tmp ) - { - max1 = tmp; - } - tmp = CGAL::abs(a62); - if( (max1 < tmp) ) - { - max1 = tmp; - } - double max2 = CGAL::abs(a03); - tmp = CGAL::abs(a13); - if( (max2 < tmp) ) - { - max2 = tmp; - } - tmp = CGAL::abs(a23); - if( (max2 < tmp) ) - { - max2 = tmp; - } - tmp = CGAL::abs(a33); - if( (max2 < tmp) ) - { - max2 = tmp; - } - tmp = CGAL::abs(a43); - if( (max2 < tmp) ) - { - max2 = tmp; - } - tmp = CGAL::abs(a53); - if( (max2 < tmp) ) - { - max2 = tmp; - } - tmp = CGAL::abs(a63); - if( (max2 < tmp) ) - { - max2 = tmp; - } - double max3 = CGAL::abs(a04); - tmp = CGAL::abs(a14); - if( (max3 < tmp) ) - { - max3 = tmp; - } - tmp = CGAL::abs(a24); - if( (max3 < tmp) ) - { - max3 = tmp; - } - tmp = CGAL::abs(a34); - if( (max3 < tmp) ) - { - max3 = tmp; - } - tmp = CGAL::abs(a44); - if( (max3 < tmp) ) - { - max3 = tmp; - } - tmp = CGAL::abs(a54); - if( (max3 < tmp) ) - { - max3 = tmp; - } - tmp = CGAL::abs(a64); - if( (max3 < tmp) ) - { - max3 = tmp; - } - double max4 = CGAL::abs(a05); - tmp = CGAL::abs(a15); - if( (max4 < tmp) ) - { - max4 = tmp; - } - tmp = CGAL::abs(a25); - if( (max4 < tmp) ) - { - max4 = tmp; - } - tmp = CGAL::abs(a35); - if( (max4 < tmp) ) - { - max4 = tmp; - } - tmp = CGAL::abs(a45); - if( (max4 < tmp) ) - { - max4 = tmp; - } - tmp = CGAL::abs(a55); - if( (max4 < tmp) ) - { - max4 = tmp; - } - tmp = CGAL::abs(a65); - if( (max4 < tmp) ) - { - max4 = tmp; - } - double max5 = CGAL::abs(a06); - tmp = CGAL::abs(a16); - if( (max5 < tmp) ) - { - max5 = tmp; - } - tmp = CGAL::abs(a26); - if( (max5 < tmp) ) - { - max5 = tmp; - } - tmp = CGAL::abs(a36); - if( (max5 < tmp) ) - { - max5 = tmp; - } - tmp = CGAL::abs(a46); - if( (max5 < tmp) ) - { - max5 = tmp; - } - tmp = CGAL::abs(a56); - if( (max5 < tmp) ) - { - max5 = tmp; - } - tmp = CGAL::abs(a66); - if( (max5 < tmp) ) - { - max5 = tmp; - } + double max1 = CGAL::abs(m01); + double am = CGAL::abs(m02); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m11); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m12); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m21); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m22); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m31); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m32); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m41); + if( (max1 < am) ) { max1 = am; } + am = CGAL::abs(m42); + if( (max1 < am) ) { max1 = am; } + + + double max2 = CGAL::abs(m03); + am = CGAL::abs(m11); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m12); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m13); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m21); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m22); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m23); + + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m31); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m32); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m33); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m41); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m42); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m43); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m51); + if( (max2 < am) ) { max2 = am; } + am = CGAL::abs(m52); + if( (max2 < am) ) { max2 = am; } + + + double max3 = CGAL::abs(m04); + am = CGAL::abs(m14); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m24); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m34); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m44); + if( (max3 < am) ) { max3 = am; } + am = CGAL::abs(m54); + if( (max3 < am) ) { max3 = am; } + + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max3 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4= am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m55); + if( (max4 < am) ) { max4 = am; } + + double max5 = CGAL::abs(m06); + am = CGAL::abs(m16); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m26); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m36); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m46); + if( (max5 < am) ) { max5 = am; } + am = CGAL::abs(m56); + if( (max5 < am) ) { max5 = am; } + + + double max6 = CGAL::abs(m13); + am = CGAL::abs(m21); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m22); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m23); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m31); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m32); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m33); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m41); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m42); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m43); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m51); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m52); + if( (max6 < am) ) { max6 = am; } + am = CGAL::abs(m53); + if( (max6 < am) ) { max6 = am; } - double max6 = CGAL::abs(m01); - tmp = CGAL::abs(m02); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m03); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m04); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m05); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m06); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m12); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m13); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m14); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m15); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m16); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m23); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m24); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m25); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m26); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m34); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m35); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m36); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m45); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m46); - if( (max6 < tmp) ) - { - max6 = tmp; - } - tmp = CGAL::abs(m56); - if( (max6 < tmp) ) - { - max6 = tmp; - } double lower_bound_1; double upper_bound_1; @@ -633,7 +328,7 @@ public: upper_bound_1 = max4; } } - if( (lower_bound_1 < 3.98278627399642140002e-50) ) + if( (lower_bound_1 < 4.82472686053427214432e-50) ) { return Base::operator()(p, q, r, s, t, u, v); } @@ -643,26 +338,24 @@ public: { return Base::operator()(p, q, r, s, t, u, v); } - eps = (5.57471180948088246730e-12 * (((((max6 * max1) * max2) * max3) * max4) * max5)); - if( (m0123456 > eps) ) + eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5)); + if( (det > eps) ) { CGAL_assertion(should_be == POSITIVE); return POSITIVE; } else { - if( (m0123456 < -eps) ) + if( (det < -eps) ) { CGAL_assertion(should_be == NEGATIVE); return NEGATIVE; } } } +} + return Base::operator()(p, q, r, s, t, u, v); } - return Base::operator()(p, q, r, s, t, u, v); - } - - }; } } } // namespace CGAL::internal::Static_filters_predicates diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index 67a2d84070a..c05b67ea2ee 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,30 @@ template struct Side_of_oriented_sphere_3 : private Store }; +template struct Adapter_4 { + typedef typename Get_type::type Orientation; + typedef typename Get_type::type Oriented_side; + typedef typename Get_type::type Point; + typedef typename Get_functor::type CC; + typedef typename Get_functor::type Orientation_base; + struct Point_4 { + R_ const&r; CC const&c; Point const& p; + Point_4(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){} + decltype(auto) c0()const{return c(p,0);} + decltype(auto) c1()const{return c(p,1);} + decltype(auto) c2()const{return c(p,2);} + decltype(auto) c3()const{return c(p,3);} + }; + struct Orientation_4 { + typedef typename Get_type::type result_type; + auto operator()(Point_4 const&A, Point_4 const&B, Point_4 const&C, + Point_4 const&D, Point_4 const&E)const{ + Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p}; + return Orientation_base(A.r)(make_transforming_iterator(t+0),make_transforming_iterator(t+5)); + } + }; +}; + template struct Adapter_5 { typedef typename Get_type::type Orientation; typedef typename Get_type::type Oriented_side; @@ -179,6 +204,8 @@ template struct Adapter_5 { } }; }; + + template struct Orientation_of_points_5 : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_5) typedef typename Get_type::type Point; diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h index a9654bcd781..6706d595291 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -72,7 +72,7 @@ determinant( return m012345; } -int orientationC5(double p0, double p1, double p2, double p3, double p4, double p5, +int orientationC6(double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, @@ -175,7 +175,7 @@ group p5 q5 r5 t5 q5 u5 v5; //===========generated ================== -inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) { +inline int orientationC6( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) { double m01; m01 = (q0 - p0); double m02; @@ -317,20 +317,20 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, if( (max3 < am) ) { max3 = am; } am = CGAL::abs(m54); if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m05); - if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m15); - if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m25); - if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m35); - if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m45); - if( (max3 < am) ) { max3 = am; } - am = CGAL::abs(m55); - if( (max3 < am) ) { max3 = am; } - d + double max4 = CGAL::abs(m05); + am = CGAL::abs(m15); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m25); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m35); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m45); + if( (max4 < am) ) { max4 = am; } + am = CGAL::abs(m55); + if( (max4 < am) ) { max4 = am; } + + double max5 = CGAL::abs(m06); am = CGAL::abs(m16); if( (max5 < am) ) { max5 = am; } diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 7513af82322..40dbbfd3e36 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -12,12 +12,14 @@ if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") create_single_source_cgal_program("generate_d.cpp") + create_single_source_cgal_program("bench4d.cpp") create_single_source_cgal_program("bench5d.cpp") create_single_source_cgal_program("bench6d.cpp") create_single_source_cgal_program("delaunay.cpp") target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support) create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support) + target_link_libraries(bench4d PRIVATE CGAL::Eigen3_support) target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support) target_link_libraries(bench6d PRIVATE CGAL::Eigen3_support) else() diff --git a/Triangulation/benchmark/Triangulation/bench4d.cpp b/Triangulation/benchmark/Triangulation/bench4d.cpp new file mode 100644 index 00000000000..b90593b7220 --- /dev/null +++ b/Triangulation/benchmark/Triangulation/bench4d.cpp @@ -0,0 +1,62 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 4; // we work in Euclidean 4-space + + std::vector points; + std::ifstream in("points.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0}; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file From c6b19ed0e3a8f64badcbd2ec482373ec8019486b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Jul 2025 10:40:52 +0100 Subject: [PATCH 059/145] Add license header --- .../include/CGAL/NewKernel_d/orientationC4.h | 16 ++++++++++++++++ .../include/CGAL/NewKernel_d/orientationC5.h | 17 +++++++++++++++++ .../include/CGAL/NewKernel_d/orientationC6.h | 15 +++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h index 5a921ab6473..3915204817a 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC4.h @@ -1,3 +1,18 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 + double determinant( double a00, double a01, double a02, double a03, double a10, double a11, double a12, double a13, @@ -236,3 +251,4 @@ inline int orientationC4( double p0, double p1, double p2, double p3, double q0, return int_tmp_result; } +#endif diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h index 692bad04bfe..a97977fb89e 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC5.h @@ -1,3 +1,18 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 + double determinant( double a00, double a01, double a02, double a03, double a04, @@ -326,3 +341,5 @@ inline int orientationC5( double p0, double p1, double p2, double p3, double p4, } return int_tmp_result; } + +#endif diff --git a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h index 6706d595291..ca9f32a5d99 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/orientationC6.h @@ -1,3 +1,17 @@ +// Copyright (c) 2025 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri + +// Files needed as input for the static filter generator + +#if 0 double determinant( double a00, double a01, double a02, double a03, double a04, double a05, @@ -460,3 +474,4 @@ inline int orientationC6( double p0, double p1, double p2, double p3, double p4, return int_tmp_result; } +#endif From 605afd3fe5bcc4b22ea82bf312fd69d48e51dce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 2 Jul 2025 15:10:27 +0200 Subject: [PATCH 060/145] add missing include --- .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h | 1 + .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h | 1 + .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h | 1 + 3 files changed, 3 insertions(+) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h index a1cc4d494a1..883e1baa797 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace CGAL { namespace internal { namespace Static_filters_predicates { diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index c266ee694e8..729608c0052 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace CGAL { namespace internal { namespace Static_filters_predicates { diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 46d3570f7f4..64780101571 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace CGAL { namespace internal { namespace Static_filters_predicates { From 1e991ff6addef96667c4c97758e9578bdae832ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 2 Jul 2025 16:51:20 +0200 Subject: [PATCH 061/145] disambiguate determinant call --- .../Filtered_kernel/internal/Static_filters/Orientation_4.h | 2 +- .../Filtered_kernel/internal/Static_filters/Orientation_5.h | 2 +- .../Filtered_kernel/internal/Static_filters/Orientation_6.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h index 883e1baa797..f37646ed068 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -92,7 +92,7 @@ double m01; double m34; m34 = (t3 - p3); double det; - det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); + det = ::CGAL::determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); int int_tmp_result; double eps; double max1 = CGAL::abs(m01); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index 729608c0052..8555f6f823c 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -114,7 +114,7 @@ public: double m45; m45 = (u4 - p4); double det; - det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); + det = ::CGAL::determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); int int_tmp_result; double eps; double max1 = CGAL::abs(m01); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 64780101571..89425ffd333 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -149,7 +149,7 @@ public: double m56; m56 = (v5 - p5); double det; - det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); + det = ::CGAL::determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); int int_tmp_result; double eps; double max1 = CGAL::abs(m01); @@ -267,6 +267,7 @@ public: am = CGAL::abs(m52); if( (max6 < am) ) { max6 = am; } am = CGAL::abs(m53); + am = CGAL::abs(m53); if( (max6 < am) ) { max6 = am; } From b38b13e2ef970c5a15f5714deeb9f4f60d1cc174 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Jul 2025 16:54:47 +0100 Subject: [PATCH 062/145] WIP for bench4 --- .../internal/Static_filters/Orientation_4.h | 11 +++--- .../NewKernel_d/Cartesian_static_filters.h | 34 +++++++++++++++++++ .../benchmark/Triangulation/bench4d.cpp | 4 +-- .../benchmark/Triangulation/generate_d.cpp | 6 ++-- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h index f37646ed068..f45a614e303 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -38,25 +38,22 @@ public: const Point_4 &r, const Point_4 &s, const Point_4 &t) const { + std::cout << "XX" << std::endl; + CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp); - double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4; + double p0, p1, p2, p3, q0, q1, q2, q3, r0, r1, r2, r3, s0, s1, s2, s3, t0, t1, t2, t3; if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && - fit_in_double(p.c4(), p4) && fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) && fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) && - fit_in_double(q.c4(), q4) && fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) && fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) && - fit_in_double(r.c4(), r4) && fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) && fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) && - fit_in_double(s.c4(), s4) && fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) && - fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) && - fit_in_double(t.c4(), t4) ) + fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) ) { CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t)); double m01; diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index c05b67ea2ee..d1639ca46e7 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -180,6 +180,27 @@ template struct Adapter_4 { }; }; + +template struct Orientation_of_points_4 : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_4) + typedef typename Get_type::type Point; + typedef typename Get_type::type result_type; + typedef typename Get_functor::type CC; + typedef Adapter_4 Adapter; + template result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ + CC c(this->kernel()); + Point const& A=*f; + Point const& B=*++f; + Point const& C=*++f; + Point const& D=*++f; + Point const& E=*++f; + CGAL_assertion(++f==e); + typedef typename Adapter::Point_4 P; + return typename internal::Static_filters_predicates::Orientation_4()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C), + P(this->kernel(),c,D),P(this->kernel(),c,E)); + } +}; + template struct Adapter_5 { typedef typename Get_type::type Orientation; typedef typename Get_type::type Oriented_side; @@ -322,6 +343,19 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { }; #ifndef CGAL_NO_STATIC_FILTER_5 + +template +struct Cartesian_static_filters, R_, Derived_> : public R_ { + constexpr Cartesian_static_filters(){} + constexpr Cartesian_static_filters(int d):R_(d){} + typedef Cartesian_static_filters, R_, Derived_> Self; + typedef typename Default::Get::type Derived; + template struct Functor : Inherit_functor {}; + template struct Functor { + typedef SFA::Orientation_of_points_4 type; + }; +}; + template struct Cartesian_static_filters, R_, Derived_> : public R_ { constexpr Cartesian_static_filters(){} diff --git a/Triangulation/benchmark/Triangulation/bench4d.cpp b/Triangulation/benchmark/Triangulation/bench4d.cpp index b90593b7220..10c3f969ae7 100644 --- a/Triangulation/benchmark/Triangulation/bench4d.cpp +++ b/Triangulation/benchmark/Triangulation/bench4d.cpp @@ -23,18 +23,18 @@ int main() const int D = 4; // we work in Euclidean 4-space std::vector points; - std::ifstream in("points.txt"); + std::ifstream in("points_4.txt"); Triangulation::Point p; int d; in >> d; assert(d == D); int n; in >> n; + std::cout << n << " points in dimension " << d << std::endl; points.reserve(n); while (in >> p) { points.push_back(p); } - CGAL::Timer timer; timer.start(); Triangulation t(D); // create triangulation diff --git a/Triangulation/benchmark/Triangulation/generate_d.cpp b/Triangulation/benchmark/Triangulation/generate_d.cpp index 5ba73aa57a3..6759b9c908f 100644 --- a/Triangulation/benchmark/Triangulation/generate_d.cpp +++ b/Triangulation/benchmark/Triangulation/generate_d.cpp @@ -5,10 +5,10 @@ int main() { CGAL::Random rng; std::cout.precision(17); - std ::cout << 6 << std::endl; + std ::cout << 4 << std::endl; std::cout << 100000 << std::endl; for(int i = 0; i < 100000; ++i) { - std::array arr; + std::array arr; double slength = 0; for(int i = 0; i < arr.size(); ++i) { arr[i] = rng.get_double(-1, 1); @@ -18,7 +18,7 @@ int main() { for(int i = 0; i < arr.size(); ++i) { arr[i] /= slength; } - std::cout << "6 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] << " " << arr[4]<< " " << arr[5] << std::endl; + std::cout << "4 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] /* << " " << arr[4] /* << " " << arr[5] */ << std::endl; } return 0; } From 15760cfc78105d11a8f25ef95f00ca339e827d1a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Jul 2025 17:08:49 +0100 Subject: [PATCH 063/145] In 5D we enter Orientation_5, but not in 4D. why? --- .../include/CGAL/NewKernel_d/Cartesian_static_filters.h | 2 +- Triangulation/benchmark/Triangulation/bench5d.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h index d1639ca46e7..a630fdca5cb 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Cartesian_static_filters.h @@ -342,7 +342,7 @@ struct Cartesian_static_filters, R_, Derived_> : public R_ { }; }; -#ifndef CGAL_NO_STATIC_FILTER_5 +#ifndef CGAL_NO_STATIC_FILTER_456 template struct Cartesian_static_filters, R_, Derived_> : public R_ { diff --git a/Triangulation/benchmark/Triangulation/bench5d.cpp b/Triangulation/benchmark/Triangulation/bench5d.cpp index 2bf6fc90bfc..e605c53f9fd 100644 --- a/Triangulation/benchmark/Triangulation/bench5d.cpp +++ b/Triangulation/benchmark/Triangulation/bench5d.cpp @@ -1,3 +1,5 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 #include #include @@ -23,7 +25,7 @@ int main() const int D = 5; // we work in Euclidean 5-space std::vector points; - std::ifstream in("points.txt"); + std::ifstream in("points_5.txt"); Triangulation::Point p; int d; in >> d; From 076ffc109fdb8986eaa6296e1611b5f7a0613f5a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 2 Jul 2025 17:31:21 +0100 Subject: [PATCH 064/145] It works also for 4D and we go from 2sec to 1.2 sec --- .../Filtered_kernel/internal/Static_filters/Orientation_4.h | 2 -- Triangulation/benchmark/Triangulation/bench4d.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h index f45a614e303..e80b295c0c8 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -38,8 +38,6 @@ public: const Point_4 &r, const Point_4 &s, const Point_4 &t) const { - std::cout << "XX" << std::endl; - CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp); double p0, p1, p2, p3, q0, q1, q2, q3, r0, r1, r2, r3, s0, s1, s2, s3, t0, t1, t2, t3; diff --git a/Triangulation/benchmark/Triangulation/bench4d.cpp b/Triangulation/benchmark/Triangulation/bench4d.cpp index 10c3f969ae7..b0746ed464e 100644 --- a/Triangulation/benchmark/Triangulation/bench4d.cpp +++ b/Triangulation/benchmark/Triangulation/bench4d.cpp @@ -1,3 +1,5 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 #include #include From 6bc33ee1acbaf758c740bd93d8e96d48ee27f8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 2 Jul 2025 20:23:46 +0200 Subject: [PATCH 065/145] unused var --- .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h | 1 - .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h | 1 - .../CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h | 1 - 3 files changed, 3 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h index e80b295c0c8..ebd9f99e7f4 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h @@ -88,7 +88,6 @@ double m01; m34 = (t3 - p3); double det; det = ::CGAL::determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 ); - int int_tmp_result; double eps; double max1 = CGAL::abs(m01); double am = CGAL::abs(m02); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h index 8555f6f823c..a57f445e885 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h @@ -115,7 +115,6 @@ public: m45 = (u4 - p4); double det; det = ::CGAL::determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 ); - int int_tmp_result; double eps; double max1 = CGAL::abs(m01); double am = CGAL::abs(m02); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 89425ffd333..372a88c22f7 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -150,7 +150,6 @@ public: m56 = (v5 - p5); double det; det = ::CGAL::determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 ); - int int_tmp_result; double eps; double max1 = CGAL::abs(m01); double am = CGAL::abs(m02); From 143a8e1e88f952ec138b32d019583f0584b07644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 09:31:23 +0200 Subject: [PATCH 066/145] fix warning --- .../internal/tetrahedral_remeshing_helpers.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index c046b985ad4..2c3cfe46cd4 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -1569,7 +1569,6 @@ auto midpoint_with_info(const typename C3t3::Edge& e, const C3t3& c3t3) { using Tr = typename C3t3::Triangulation; - using Vertex_handle = typename Tr::Vertex_handle; using Gt = typename Tr::Geom_traits; using Point_3 = typename Gt::Point_3; using Index = typename C3t3::Index; From 1c61ef7de920e7276fb3c3eba10c2466467de8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 09:34:40 +0200 Subject: [PATCH 067/145] fix warnings --- .../Filtered_kernel/internal/Static_filters/Orientation_6.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h index 372a88c22f7..f5f7fae103d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h @@ -40,12 +40,6 @@ public: { CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp); - double a01, a02, a03, a04, a05, a06, a11, a12, a13, a14, a15, a16, - a21, a22, a23, a24, a25, a26, a31, a32, a33, a34, a35, - a36, a41, a42, a43, a44, a45, a46, - a51, a52, a53, a54, a55, a56, - a61, a62, a63, a64, a65, a66; - double p0, p1, p2, p3, p4, p5, q0, q1, q2, q3, q4, q5, r0, r1, r2, r3, r4, r5, s0, s1, s2, s3, s4, s5, t0, t1, t2, t3, t4, t5, u0, u1, u2, u3, u4, u5, v0, v1, v2, v3, v4, v5; if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) && fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) && From 7977b1f22d3ae712ca2366e90fa5f9acd19ffdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 09:37:41 +0200 Subject: [PATCH 068/145] fix compilation errors --- Triangulation/include/CGAL/Triangulation_data_structure.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 8b45ccaa6e9..93e30b4144c 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -312,7 +312,7 @@ public: Vertex_handle mirror_vertex(Full_cell_handle s, int i) const /* Concept */ { CGAL_precondition(Full_cell_handle() != s && check_range(i)); - return s->mirror_vertex(i, current_dimension); + return s->mirror_vertex(i, current_dimension()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS @@ -790,7 +790,7 @@ Triangulation_data_structure CGAL_precondition( (1 <= fd ) && (fd < current_dimension())); std::vector simps; // save the Face's vertices: - Full_cell s(current_dimension); + Full_cell s(current_dimension()); for( int i = 0; i <= fd; ++i ) s.set_vertex(i, f.vertex(i)); // compute the star of f From 1d9c84f9ef54426e27c0ed2584a86a98b6dde11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 09:41:43 +0200 Subject: [PATCH 069/145] static -> inline --- .../include/CGAL/Cartesian/CrossProduct.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h index bde522d5930..a0882d63b61 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h @@ -19,7 +19,7 @@ namespace CGAL { // a*b - c*d // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products - static double diff_of_products_kahan(const double a, const double b, const double c, const double d) + inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) { double w = d * c; double e = std::fma(c, -d, w); @@ -27,7 +27,7 @@ namespace CGAL { return f + e; } - static double diff_of_products_cht(const double a, const double b, const double c, const double d) + inline double diff_of_products_cht(const double a, const double b, const double c, const double d) { double p1 = a * b; double p2 = c * d; @@ -38,7 +38,7 @@ namespace CGAL { return r + e; } - static double diff_of_products(const double a, const double b, const double c, const double d) + inline double diff_of_products(const double a, const double b, const double c, const double d) { // return a*b - c*d; // the next two are equivalent in results and speed @@ -47,7 +47,7 @@ namespace CGAL { } template - static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) + inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) { return a*b - c*d; } From 388632e0fa74520b24a49850b739c853266c802d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 09:46:32 +0200 Subject: [PATCH 070/145] fix warning --- .../CGAL/Surface_mesh_simplification/internal/Edge_collapse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index c2259c55504..2335bb5a843 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -610,7 +610,7 @@ loop() auto mPQ_clone = *mPQ; std::optional opt_th; - while(opt_th = mPQ_clone.extract_top()) + while((opt_th = mPQ_clone.extract_top())) { CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th)); Cost_type tcost = get_data(*opt_th).cost(); From 0cf1ff531b088057786f4f4974726f3eec919b7e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Thu, 3 Jul 2025 10:33:38 +0200 Subject: [PATCH 071/145] comment verbose macro --- .../test_tetrahedral_remeshing_determinism.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp index e1fa238da4a..7bf3bc26a7f 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_determinism.cpp @@ -1,4 +1,4 @@ -#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE +//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE //#define CGAL_TETRAHEDRAL_REMESHING_DEBUG #include From ce87535e11040eac86897c657a72c56c0fdecaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2025 14:05:46 +0200 Subject: [PATCH 072/145] fix doxygen command --- .../Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h index 6b4136dd777..55d1a3547fa 100644 --- a/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h +++ b/Triangulation/doc/Triangulation/CGAL/TDS_full_cell_mirror_storage_policy.h @@ -4,7 +4,7 @@ namespace CGAL { /*! \ingroup PkgTriangulationsRef A tag class to indicate that mirror indices are stored in full cells. - \precondition The dimension is not larger than 127. + \pre The dimension is not larger than 127. */ class TDS_full_cell_mirror_storage_policy {}; From f9bf2571dd2366572914f86148fd144d09a2795f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 4 Jul 2025 08:27:55 +0100 Subject: [PATCH 073/145] Add a test for the 4D static filters --- .../test/Triangulation/CMakeLists.txt | 3 +- .../test/Triangulation/data/points_4.txt | 100 ++++++++++++++++++ .../test_triangulation_static_filters_4.cpp | 64 +++++++++++ 3 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Triangulation/test/Triangulation/data/points_4.txt create mode 100644 Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index 23b67f9c497..c29c8df0d88 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -17,6 +17,7 @@ if(TARGET CGAL::Eigen3_support) include_directories(BEFORE "include") create_single_source_cgal_program("test_triangulation.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_4.cpp") create_single_source_cgal_program("test_delaunay.cpp") create_single_source_cgal_program("test_regular.cpp") create_single_source_cgal_program("test_tds.cpp") @@ -24,7 +25,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("test_insert_if_in_star.cpp") create_single_source_cgal_program("simple_io_test.cpp") create_single_source_cgal_program("issue_8347.cpp") - foreach(target test_triangulation test_delaunay test_regular test_tds + foreach(target test_triangulation test_triangulation_static_filters_4 test_delaunay test_regular test_tds test_torture test_insert_if_in_star simple_io_test issue_8347) target_link_libraries(${target} PRIVATE CGAL::Eigen3_support) endforeach() diff --git a/Triangulation/test/Triangulation/data/points_4.txt b/Triangulation/test/Triangulation/data/points_4.txt new file mode 100644 index 00000000000..a4cf574bb48 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_4.txt @@ -0,0 +1,100 @@ +4 +99 +4 0.52895023818873566 0.76946003711969879 0.10332507879995133 -0.34273433572785694 +4 0.41163016466811042 -0.3682073981839451 -0.52956435788869938 0.64385208729322574 +4 0.093453054760633439 0.2119054808051985 0.80105365911776638 -0.5519743010092597 +4 -0.52686178424608165 0.012815670898233643 0.37212064538747264 -0.76405408457574153 +4 0.58805166366770167 0.58151399203483489 -0.47736704319070539 -0.29691315902250165 +4 -0.25264853451566094 -0.78418366656495475 0.26672951531689387 -0.50008005434994851 +4 -0.60084190523524728 -0.5604455825189717 -0.49723069044393314 -0.27865999789869078 +4 -0.14100899254743662 -0.0089631723914645051 0.58363636804963048 -0.79962786060221414 +4 0.66702813144169226 0.71770163828613143 0.1794509474955823 0.088177024840630905 +4 0.067272560205402301 -0.78148557790668927 -0.60747442496113713 -0.12541737194421723 +4 -0.61117866728631531 -0.58630168897870427 0.4298657207341281 0.31293198668811495 +4 -0.35008556358761689 -0.66710053886097986 -0.65486926625208763 -0.059692657315481151 +4 0.46389645798324758 0.47388246271298917 -0.51250089951229549 0.54550739298634399 +4 0.60473888028283973 0.43542140981498328 0.61445566011491715 -0.2591202892514034 +4 -0.63570028008489909 0.069092069777339338 0.3692217899235456 -0.67437875829500826 +4 -0.17348381490574671 -0.72178783898784937 0.63597493154819651 -0.21085911860117806 +4 -0.43092415807804269 0.2933088414657809 -0.54542871271981364 0.65633970841595324 +4 -0.5872648129848288 -0.46519898124859577 0.20233236501175669 -0.63069133603048011 +4 -0.52163736145174866 -0.47914359898299425 0.4166108058131846 -0.56986955627667146 +4 -0.12233355367126869 0.84810365508989349 0.2899362015809886 0.42625308313501986 +4 -0.35742920641469561 -0.89683785609357769 0.062741086193053408 -0.25296200976145039 +4 -0.78852300220962024 -0.5639275096056745 0.02976513928181115 -0.24358012106861993 +4 0.16102552058740011 -0.34832861043240554 -0.77230337173088703 -0.5062464448140741 +4 -0.36473468498674155 -0.62632680133606067 -0.54342581243374721 -0.423523002771376 +4 0.38669371701382688 -0.092732194702578818 -0.68929567367330924 0.60559077233964875 +4 -0.33299174094142142 -0.49029782075996031 0.45014108485129106 0.66790534595235718 +4 -0.91282645715811384 -0.23702217761885661 0.24831940460126919 0.22114660234209427 +4 -0.77031248006615938 0.38630334371017139 0.43488982620221239 0.26126471012839414 +4 0.66172375169441366 -0.12261672629530741 -0.32075261333440069 -0.66648674098982941 +4 0.57034670408866528 0.48753644666462048 -0.36186729861405409 -0.5532313336232858 +4 -0.082725091078310692 0.65143093101200744 0.73450978815824752 0.17114225815572512 +4 0.21876173156734111 0.32898578539329398 0.43347340676139118 -0.80994596328489088 +4 -0.33699604068423233 -0.65780652131241102 -0.37739592337029015 -0.55793957209137057 +4 -0.14452111750932306 -0.29980077878167161 0.44117552773782037 0.83342503763746811 +4 -0.60890866237581964 -0.03479345133360897 -0.43514476779108269 0.66232068342460104 +4 0.71245784249865418 -0.23592015892187332 -0.54082939892555126 0.37980134614593941 +4 -0.60755677753783255 -0.50900445335692879 -0.42092208946750237 0.44115056741317993 +4 -0.58629760542664433 0.70435639453918453 -0.22180443664834243 -0.33307653658859659 +4 -0.011568009781532355 0.74683659337957264 -0.59111127229640315 -0.30444826769587074 +4 -0.73402745671071856 0.45001202934735579 0.34256269222203234 -0.37595700304032337 +4 0.96955534991982739 0.21094272681275947 0.1237686011083543 0.012121172646227195 +4 -0.33515152801797943 0.58731518520960269 -0.73529604380016256 -0.04554178807703145 +4 -0.1695992685331843 0.71732121764303036 0.1045943664094339 -0.66764240229896898 +4 0.41021678724271049 -0.058137600323793059 -0.69428206500086809 -0.58848502199375474 +4 -0.39592571191104603 0.58200935707952561 -0.50286009397814668 0.50163698508373367 +4 -0.45424480336633766 0.10665895997127596 0.74939096527122961 0.469785808685594 +4 -0.3454697098753714 0.55281901613449536 -0.74845218643798317 0.12190627373075473 +4 -0.59790770721886854 0.60881430552998739 0.02530587143431251 0.52077934665390191 +4 -0.56362033043166415 -0.60248915001345682 -0.43114306807172986 0.36531438801922317 +4 -0.053942383466521714 -0.3825000007038053 -0.90743388492682919 -0.16537144014049615 +4 0.38943960202183897 0.59168265087118188 -0.56545151418878548 -0.4225080142869867 +4 0.32757750767416155 -0.37422123516358158 0.86705900240528766 -0.029327972425235223 +4 0.30707527803241386 -0.44803155642495435 0.41282918565941928 -0.73112554430585286 +4 -0.073800290225580531 0.40020628037959349 0.0842177799924263 0.90955803324499174 +4 -0.64001436371529896 -0.072225436170897023 0.49413648819736417 -0.5839471137354828 +4 -0.59015206232128126 0.53584682889683521 0.30898692279128281 -0.51876372352268263 +4 0.54724228238081274 0.035143265750607743 0.11919629083806163 0.8276974565005436 +4 -0.35323392216813781 0.82302655685535431 -0.42310323289497054 -0.13724699360772272 +4 -0.41065725894900967 -0.61041191065378753 -0.022994082078545822 -0.67692627899487234 +4 -0.70970746461224699 -0.22383791996053623 0.012330134011180993 -0.66787713544982452 +4 0.55072527194049248 0.69518182768471604 -0.32858051402398963 0.32474412559234861 +4 0.71368785213334873 -0.29618392689360484 0.41394892791451326 -0.48121826258528067 +4 -0.19788064543206449 -0.52332638918801311 -0.42611224498755368 -0.7109156737718566 +4 -0.73260416198605427 0.61391060086551386 -0.29356437748944109 0.014995741225163756 +4 0.06751903424971531 0.71405042477407443 0.5473252660834188 0.4312867074240343 +4 -0.18348163268247566 -0.050192144559362807 -0.64188866758252738 -0.74282849805445195 +4 0.63687181402246784 -0.22003876193015062 -0.51659922543729686 -0.52830150106692175 +4 -0.11028158722874594 0.88420614899701044 0.42720087446642768 -0.15335211263397941 +4 -0.013748538374202431 -0.56244270297759258 0.21313224138875758 -0.79877645886720827 +4 -0.33934630169439356 0.87504428007586932 -0.32234472481531135 0.1234320615423013 +4 0.020641313329517623 -0.034793745494681526 -0.4958497406739199 -0.86746548411570279 +4 0.52203848059009927 0.43330117515096306 0.47283390118077567 -0.56227574933491786 +4 -0.40054895466475599 -0.79547572989096216 -0.4476148397395544 -0.080123987147080605 +4 -0.71649876630467513 0.4523690473971671 0.41922525050126752 0.32594777523862256 +4 -0.36070581595586504 -0.41026930366011455 -0.32455192495028179 0.77216349358210712 +4 0.7705609584869002 -0.4953157763775814 -0.39996122520888822 -0.030481293552415547 +4 0.28303350219616347 0.63943282663784418 0.11251583685128733 0.70594467439748088 +4 -0.40169841911732779 0.38324938887974475 0.68336451387909214 0.4741004399626032 +4 -0.62006911748363935 -0.55619344959426886 -0.52050366542307425 0.18772072462206343 +4 -0.49268718648182941 -0.31898831529416238 -0.80785558586700856 0.053620363350908903 +4 -0.36696017144017445 0.25428710781938241 -0.75112771736490647 0.48629769851361304 +4 -0.6762857935197728 -0.60184509135112363 0.12406042037932141 -0.40623764423695996 +4 -0.3666763716786815 0.59232631101849398 0.084652342433469516 0.71241277406311754 +4 -0.76719307170352091 0.45208369346607641 -0.34422833381589385 0.29756004273174891 +4 0.82489704276678244 0.34579891834392634 0.064163335194787313 -0.44255061103049992 +4 0.45564567873025064 -0.22926076391181213 0.74158978325192637 -0.43574202340534296 +4 0.52214745052855083 0.27359451350772929 0.80769505426164601 -0.011695358322007989 +4 -0.41332356519969343 -0.4212363812082196 0.33906221189151459 0.73263930966366508 +4 0.1838662558741771 -0.35081918453578126 -0.0091141922386424549 0.9181699359118104 +4 0.65789904901077378 -0.64943157580971833 0.27398923148746029 -0.2652119354043791 +4 -0.37303592269023383 0.60300377304686248 -0.10667396639645926 -0.69703035440871652 +4 0.10315594841993071 -0.82693376104025118 0.4808678171094436 -0.27259043935143445 +4 -0.89464835998641834 -0.023071055052995115 0.22497109841239393 0.38530513008714889 +4 0.2653611823080248 0.61537576292522267 0.13785152217861019 -0.7293099966141473 +4 -0.21380924996700196 -0.13124084180973827 0.96126618299929023 0.11414364411387168 +4 0.87240111990088531 -0.36008466117017685 0.27199676339958556 0.18781129754567474 +4 -0.44220740212185472 -0.70374614146887182 -0.24198731969355564 -0.50063571485047287 +4 0.63576818856786788 0.49539717675654271 0.44626626174819567 -0.38887899312262875 diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp new file mode 100644 index 00000000000..aa332b213a8 --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_4.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 4; // we work in Euclidean 4-space + + std::vector points; + std::ifstream in("data/points_4.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + std::cout << n << " points in dimension " << d << std::endl; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0}; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file From b54a4268d0421b66e0c73375773363c726c15122 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 4 Jul 2025 10:24:56 +0100 Subject: [PATCH 074/145] Add 5d and 6d test --- .../test/Triangulation/CMakeLists.txt | 5 +- .../test/Triangulation/data/points_5.txt | 100 ++++++++++++++++++ .../test/Triangulation/data/points_6.txt | 100 ++++++++++++++++++ .../test_triangulation_static_filters_5.cpp | 64 +++++++++++ .../test_triangulation_static_filters_6.cpp | 83 +++++++++++++++ 5 files changed, 351 insertions(+), 1 deletion(-) create mode 100644 Triangulation/test/Triangulation/data/points_5.txt create mode 100644 Triangulation/test/Triangulation/data/points_6.txt create mode 100644 Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp create mode 100644 Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index c29c8df0d88..3d38d402271 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -18,6 +18,8 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("test_triangulation.cpp") create_single_source_cgal_program("test_triangulation_static_filters_4.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_5.cpp") + create_single_source_cgal_program("test_triangulation_static_filters_6.cpp") create_single_source_cgal_program("test_delaunay.cpp") create_single_source_cgal_program("test_regular.cpp") create_single_source_cgal_program("test_tds.cpp") @@ -25,7 +27,8 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("test_insert_if_in_star.cpp") create_single_source_cgal_program("simple_io_test.cpp") create_single_source_cgal_program("issue_8347.cpp") - foreach(target test_triangulation test_triangulation_static_filters_4 test_delaunay test_regular test_tds + foreach(target test_triangulation test_delaunay test_regular test_tds + test_triangulation_static_filters_4 test_triangulation_static_filters_5 test_triangulation_static_filters_6 test_torture test_insert_if_in_star simple_io_test issue_8347) target_link_libraries(${target} PRIVATE CGAL::Eigen3_support) endforeach() diff --git a/Triangulation/test/Triangulation/data/points_5.txt b/Triangulation/test/Triangulation/data/points_5.txt new file mode 100644 index 00000000000..6b885d39507 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_5.txt @@ -0,0 +1,100 @@ +5 +99 +5 -0.64095941196659478 0.42422061910202236 -0.11427904012605219 -0.54638535945002176 -0.31242797331012567 +5 0.44732454860440324 0.49607483933338892 0.47235547227129621 -0.45736405185315043 -0.34858131602833875 +5 0.049977903241973112 -0.41566435029188453 0.47034156364498109 0.5314014231286428 0.56667159633142805 +5 -0.31858406166597525 0.55293922510375226 -0.098876917441046278 0.66185744478651076 0.38069736927394077 +5 0.1883028908220821 0.1625166528920311 -0.90658142749714132 0.11334777454589573 -0.32154743998911944 +5 0.32925500379336742 0.6048540056497308 -0.086063069913405219 -0.69326730751901255 0.19420700978318073 +5 0.43778721990629893 -0.33151202897445026 -0.41155460656703702 -0.59664728782302312 0.41602517289082297 +5 0.62257265376051363 0.69293819835728199 0.30234871432571214 -0.053274980604846874 0.19490247672643263 +5 0.44105487515035374 -0.42039030928286697 -0.48068520779332113 0.34447782922782266 -0.52822281392073556 +5 0.016084439725856742 -0.25191131235609143 0.7629458374992345 0.52353744836895799 -0.28302680209416425 +5 0.43354106860716723 -0.22705781874127151 0.068849436504207148 0.73368495821250479 0.46631858848343127 +5 -0.64456383107308368 0.37500823725746141 0.15272334561406656 -0.44653621962219042 0.47030551127050385 +5 -0.01363735448457239 0.30485208355187349 0.43905750564271206 -0.62699965173691685 0.56655023888206812 +5 0.0078606115325960974 0.13430751581905762 0.2181755898170861 0.53805349733372398 0.8029928692060484 +5 0.52338099659430393 -0.014615020320186925 -0.48914523816770017 -0.47549568516135032 0.51039153887559274 +5 -0.69482670411781933 -0.030010825193797691 0.34327877508094107 0.56440594895759255 0.28270268653863861 +5 -0.75400593882254485 0.20528914441943982 -0.011183249996636422 0.28305090197467592 -0.5559573124033016 +5 -0.26478115474184827 -0.45814239612429802 0.058790619333674764 -0.82550288646510983 -0.18731025728238973 +5 0.75370149289146393 0.041265752398890396 -0.31598075959816507 -0.50970148811628602 -0.26569107976735346 +5 -0.4519268127481933 0.17613049993809574 0.64157833191917701 -0.1199529988420301 -0.58200405925682863 +5 -0.67422492315129878 0.0052508128669294055 -0.34989951630863758 0.59640231454536097 -0.25936034711917605 +5 -0.84536670492017962 -0.023545078714723985 0.23188336199914605 -0.39941072573741931 -0.26739847059135646 +5 -0.6832142989651836 -0.12691169799999982 0.57357419956766675 -0.1281663346418801 0.41436417660681707 +5 0.63151709095033293 0.11572773552335802 -0.45061917023719628 0.14637578686667163 -0.6027518125249961 +5 -0.63457899564060283 -0.52966844727893914 -0.51456049526593051 -0.21838548693858054 -0.06554471798063273 +5 -0.72586407046590262 0.53323169069976017 0.32142119181324058 -0.28443313725001818 -0.067613039627090948 +5 0.11048228638172189 0.12809754988080219 -0.40887921694271862 -0.77092857165846906 0.45811745815166749 +5 0.51397355334880024 0.32553149207748472 0.5186652471029648 -0.19028592634504338 -0.56977018332521023 +5 0.52471838621722444 0.20265571519982001 -0.5961767637385692 -0.2552020089464791 -0.51288056823234041 +5 -0.42618238121168606 0.67925070936879339 0.11809074419895899 0.5837804744939592 -0.047349609300101507 +5 -0.75979859206098521 -0.17280413824019189 -0.1813534331371959 0.59978037174150067 -0.014807676123859496 +5 0.39184709577815358 -0.46011983815751623 -0.55867615995912812 -0.43478136258019162 -0.36550198783366711 +5 -0.47631197080770421 -0.13866838726394107 0.56944074766219055 -0.20924017616748669 -0.62117128750307116 +5 0.69836618593825928 -0.31047848566369102 0.30402750685925439 0.12607668433628302 -0.55458067494075669 +5 0.1869131312461339 -0.14541256019221543 -0.88720967185608168 -0.37122076821132544 0.13774181688843901 +5 0.066168156653027055 -0.79153357077416386 -0.0022462197273692267 0.46469566632383441 -0.39134291047548841 +5 0.89469701530926082 0.11759766993898985 0.34387377605733604 -0.10906814641318215 0.23567563386927023 +5 0.44839548790055422 -0.215872738581219 -0.31689404873737492 0.48576723561113194 -0.64494092896126687 +5 0.6459123373501775 -0.46663502702373549 -0.32530950233450889 -0.039516958959050295 0.50760333101634691 +5 0.050417291553477184 -0.047285079262706954 -0.2138273059584746 -0.90923374708311278 -0.35041988297366083 +5 -0.59264984179337254 -0.45580598211515067 0.41834884196290151 0.32848532800592428 0.39760370647602505 +5 -0.13481014216375148 0.098149972390238663 -0.71288083854571282 -0.46824774456146634 -0.49470978182874609 +5 0.020717171016991894 -0.61151395060645808 0.18739980633705816 -0.63488453348310792 0.43292543095492175 +5 -0.29319280111406504 -0.71141445302303752 0.43866572973669665 -0.42414838726394366 -0.18867427100902645 +5 -0.12195022572923944 0.1597275130261441 0.37359538094266925 0.87248224896209947 -0.24252109312678227 +5 0.26916794620313855 -0.79643329338601399 -0.17842819374734853 0.24827897357108525 0.446949165880907 +5 0.1453113711518611 0.55890701106684326 -0.33506119215671726 -0.56060928342351557 0.4898558841579691 +5 -0.13559765406608318 0.22424015035632619 0.89051035130708844 -0.2844260176919719 -0.23963051945601349 +5 -0.50566728258429727 -0.35078461251646564 -0.44622952634161051 0.39434995372518228 -0.51635073231610096 +5 -0.081206578882796046 0.7080562679527399 -0.42730522360386669 -0.31493163319195694 -0.45857401284294996 +5 -0.56221514665255945 0.26352028510021092 -0.32431871644229199 0.44640018134880266 -0.5567902984716282 +5 0.67127300073285578 -0.56121759668984272 -0.11438199626517255 0.32066898964093893 0.34426083957638576 +5 0.46427394220581342 0.46813361706404572 0.43431336049942787 -0.029219081499168249 0.6130405968051752 +5 0.085830281871806843 -0.68075675673231806 0.36464348542014058 -0.55908690912039871 -0.28924100239757228 +5 0.41364898446754872 0.44051277392034793 -0.51368389933707281 0.27089667753848867 0.54551522006487996 +5 -0.12351866879421199 0.37823568590421885 0.070649994572097946 -0.14105158010103419 -0.90376652648006106 +5 -0.55545110175425316 -0.57820471208033508 -0.43080087411301676 -0.38794497232024833 -0.14512990664568667 +5 0.7651360106358821 0.26858554943456936 -0.32320967256616323 0.45271513727326118 0.18169534916024627 +5 0.45441543922986888 0.5544933959770898 0.37209878757560882 -0.34801976791573092 -0.4758869780020909 +5 -0.48382144387953951 0.21412341598565873 0.48837003184817313 0.56894254401428956 -0.39732488818612011 +5 -0.27038670992649089 0.7177459738405968 -0.024815590179790174 0.61932329771149031 0.16599573345882931 +5 0.52568529402156838 -0.6686179658279312 -0.30453683091328215 0.39362339728539719 -0.17006741942057541 +5 0.15294938992472662 -0.23462980298095978 0.2749232088212652 0.63828078540744748 0.66224633476210426 +5 -0.53568255103656881 0.078022991883987841 -0.31948842617438705 0.62671984273267689 -0.46054967323641327 +5 -0.23310206113273735 0.38122357958778275 -0.62218473180664657 -0.51308258950399432 0.38725240776077069 +5 0.062519229350989067 0.60935859588898855 0.36557460415396498 0.64016700136989868 -0.28515761734925249 +5 0.40055103808277742 0.11420518938708622 -0.13612792768426063 0.2722551771516088 -0.85665765999400478 +5 -0.55472894977000109 0.14438622704861134 0.35711517550786664 0.19748727548511219 0.71056029805301646 +5 -0.039226168712433881 0.53046963553531501 0.58724338979502344 0.3304297025089995 -0.51285932408901158 +5 -0.36549272643511066 -0.1944460632762828 0.42892482070515675 0.54746427240095541 -0.58729223051810131 +5 -0.51444905998852453 -0.54308624712485065 -0.44536997670499018 -0.057662778907800395 0.48858989002966047 +5 -0.15440932419624182 0.48219819045804607 0.047093757444803284 -0.60392043033692211 0.61376294898897477 +5 0.43481889665508638 0.21724186040536617 0.41122418484105694 -0.036198505808205945 0.77027452195845758 +5 -0.45335160348155307 -0.0090240382671407781 -0.54837361755857228 -0.56749016125780805 -0.41428514672308675 +5 0.47114542832518985 0.46505950774730731 -0.62278318402538824 0.41519154489887244 -0.038713387371715736 +5 -0.50136442182277852 0.18939946722006479 -0.44745642645398664 -0.036410595617002037 0.71499550578930915 +5 -0.50890485936191909 -0.54100797605641604 0.44170900156992093 -0.27187048708488765 -0.42344516781455299 +5 -0.18074952593523871 -0.18860582205590692 0.57887192516180996 0.039211533315703977 -0.77144487986847987 +5 -0.47365805515360904 0.01465502819126422 0.85229770070622901 0.15425760518747605 -0.15882851617236068 +5 -0.30745671248873752 0.57057989273713283 0.60645536747604767 0.19965378698854283 -0.41504121307446745 +5 -0.24028271704320009 0.58912913017564106 0.73907633222396696 0.20948416633465156 0.071229509827560183 +5 -0.64228704065956665 -0.37111771514629771 -0.51078840781267765 0.2517172542564432 0.35422115303741308 +5 -0.45413924048414522 0.52788021885267411 0.39677332786249203 0.39688971574050569 -0.44738071553530406 +5 0.41505598340153971 -0.22025041501083814 0.80109954759996271 0.34641357884080504 0.13211900907884189 +5 -0.20025735851245358 -0.6592702299950165 -0.32273296816240932 -0.32053493269293298 0.56423447465442167 +5 0.58716421726361867 -0.17367850226005824 -0.3234252705857012 -0.576311210468198 -0.43397631600486125 +5 0.24500268030283279 -0.37673527821663111 0.26197175324156724 -0.831532046129559 0.1948575724846065 +5 0.5221610049491775 0.15958174522100452 -0.48361390102525659 -0.55613903653367458 0.39838237697118678 +5 0.16962234853857569 -0.58401971243880413 -0.62282869411315633 -0.32534521602588351 -0.36930223741202295 +5 0.58028138836141019 -0.34025869019701482 0.5807426490215255 0.41704964830718566 0.19053897375886178 +5 0.49658935038669683 -0.1325969999793061 -0.64242700913886752 0.43871198504738879 0.36143655706593286 +5 0.6541749555201487 0.11495532575987849 -0.47189266545231384 -0.46477475130993412 0.34661526724417524 +5 -0.37016121969427745 0.68870175579814763 0.23906708910490926 -0.55701266918805681 -0.14578880706657554 +5 -0.61783888880336935 0.32189539528913458 -0.46086045339499304 0.38667673368942418 -0.39082887315768933 +5 0.032116226250772636 0.37788382751053184 0.37339170905185354 0.24931481645654946 0.80906928926017996 +5 -0.062201604939676421 0.48158547236711069 -0.55318649438944401 -0.64020204958944993 0.21984638108110963 +5 0.43963286001154867 -0.58237961543813122 -0.68268015123007919 0.016241394588271955 0.03522726413596125 +5 0.36598575138692213 -0.072439024911306132 -0.56340774519713788 0.68450645966869139 -0.27355006264916204 diff --git a/Triangulation/test/Triangulation/data/points_6.txt b/Triangulation/test/Triangulation/data/points_6.txt new file mode 100644 index 00000000000..ffa708c9f61 --- /dev/null +++ b/Triangulation/test/Triangulation/data/points_6.txt @@ -0,0 +1,100 @@ +6 +99 +6 -0.52248578532016376 -0.48346324138645691 -0.58974456741264414 0.22252777840028556 -0.015931087719839573 -0.30935551046981807 +6 0.34754132905984381 -0.074985127922628902 0.49930955656743814 -0.49297991574953459 0.3743412038014835 -0.49104143176539627 +6 0.49995311666702108 -0.57210736482775315 -0.25164036633515868 0.10175875354232455 -0.17957742984389918 0.56286257029905196 +6 0.39906582656602591 0.47457715471780493 -0.082408075327093433 -0.15562564967545028 0.36076517581009854 -0.67406308643465562 +6 0.47762233059349435 -0.2842328008690938 0.38623842606683151 0.25571542872305203 -0.48436897768414289 -0.49183820045637949 +6 -0.0042314478443558987 0.66049090972627666 0.47606918346155225 0.26460949335869488 -0.47947866280804441 -0.19280563662043465 +6 -0.38374085169832239 -0.58506782737244056 -0.28816302750472883 0.3515802173604044 -0.5279113747823817 -0.15843483463882974 +6 0.23917340386004574 -0.54065741121454236 -0.33612792325867147 0.0073138842190205713 0.49193768445111852 -0.54355081409662509 +6 -0.33027866095233116 -0.56180392557603231 -0.32646623884361697 -0.56886147641690643 0.33908986323916374 -0.17357083718015598 +6 -0.39192523875775492 0.54423469918164857 0.43041308504361298 0.45346132108040205 0.22340600649055789 0.33077237218748201 +6 0.066836254602841441 -0.52920520249210112 -0.33068598406842653 -0.26992400905794661 0.62845484338677204 0.37189660905209698 +6 0.19743860684640982 0.081543364953937478 0.63446506243002354 -0.097012508529634223 0.70768239786789711 -0.2039533222355914 +6 0.42350956524488981 0.53817080890286528 -0.44826665925687231 -0.4630016158560194 0.23378709098204101 0.24706665212948764 +6 0.09785501454807044 -0.11456262890775261 -0.31134303673278318 -0.49637806372022192 0.55949777724624261 0.56651246127285459 +6 -0.10326273668695649 -0.65814304095940668 -0.31725909306625727 -0.555960810177341 -0.25255650990838052 -0.28749608617380074 +6 -0.61542480481483819 0.0011280450683139097 0.55328692027642723 0.34400335684157046 0.37016000457099912 0.24447470724330039 +6 0.43813574182814297 0.29379416544186204 -0.55292433586480871 -0.36707484188102968 0.413424369672585 0.33216425140632733 +6 0.62368126529536638 -0.3064881542207466 -0.43871298975197703 0.53742069886050947 0.15085507286218508 -0.11418994129448788 +6 0.16476372090864744 0.1109205078824663 -0.23399740855607967 -0.44517529682570806 -0.76827227146836241 0.34259515755693032 +6 -0.4582030961925827 -0.2663673224056024 -0.54961052165427071 0.51751923392842392 0.35978158750630773 -0.14056208054272484 +6 -0.11495774297936535 0.17677227221875624 -0.45880764506787858 0.44376921050871543 0.46355481773156476 0.57725007119384819 +6 -0.52160176513875189 0.31426462456544085 -0.35933189154758549 -0.51331867425419864 -0.43205016526292017 0.22335292571602985 +6 -0.20947455578544788 0.47005432960768112 -0.41475967751478227 0.40696776076920221 -0.54940083105174653 0.30932138002011456 +6 -0.35515545955131517 0.28659947063783103 -0.43389023672403004 -0.75423410037367455 -0.13058245691460899 0.1324528189063271 +6 -0.1072324954411312 0.53549378529716085 0.5303451149630013 -0.13897402329310882 -0.090546592722667144 -0.62687254865762698 +6 0.1102357638392452 0.35390965540162767 -0.15921053186861117 0.56662571537935513 -0.50343143562548798 0.51258182470829694 +6 -0.7521414280651405 -0.34476026492334633 0.19505386347651005 -0.49783859325421242 -0.1655035063064634 -0.04629197260795017 +6 -0.43546464287814302 0.23273923325366619 0.0044777062314122424 0.67556119443422513 0.50870812033248003 0.20252423345567822 +6 0.53251647928358914 -0.39729448899929043 0.58369316051078268 0.22564615748686082 0.37811475342857548 0.15491490414482306 +6 0.24289310169624273 0.11859386955210122 -0.29281369162847548 0.59092439680912245 -0.63259583083229609 0.30303374286919554 +6 -0.35598184358712603 0.77960773923442395 0.26584688554881319 -0.18885184748169259 -0.1277532527817529 0.37792620908390379 +6 -0.57775461906181802 0.56398136201948956 0.24716950956221539 0.26633847280431333 -0.37362408068361069 -0.27658763751791582 +6 -0.57990647596989886 -0.28836767266607671 0.22685410250953331 0.14944399270179443 0.64174541296874976 -0.30808943286460289 +6 -0.5335030315141126 0.54805489620934245 0.42406328570339591 0.093393095662535883 -0.12783094169714468 0.45838592457889477 +6 -0.12909382114378909 -0.56639935858156654 -0.58803157227785718 0.43124035398267208 0.24059819736254101 -0.26998090019131404 +6 -0.43975002441797462 0.42549076003343606 -0.10026091502860482 -0.74594444050366826 -0.23934857461929585 0.042478577866581706 +6 0.96344235807064582 -0.019659692709547497 0.15982487206874871 0.15259660437219755 0.14992374705924039 -0.0092453138313178737 +6 -0.084430753927450891 0.54594301169552162 0.53653011372194326 -0.41453990405074331 0.43836397417083728 -0.20723611398676234 +6 -0.15115603394306507 0.55281885912085593 -0.15786414392716869 0.45384926769871159 -0.57847546467799149 0.32559031533506255 +6 0.54204921011102858 -0.48557698424209411 0.063433639091453539 -0.57195606016163636 0.24305832909277175 -0.28313024127949815 +6 -0.20964859633944177 0.64422189446086331 0.49286994349553021 -0.016379507018461248 -0.25142041984651609 -0.48438034619801107 +6 -0.66412915962225783 -0.078748905511993067 0.26534993875875773 -0.46284549334831837 0.1802169516138587 -0.4854033156654165 +6 -0.025354298800610967 -0.39942902492434534 -0.29081623107075677 0.51367327514162064 -0.4798586670872439 0.51099408935197155 +6 -0.45624010445234175 0.49728960762817503 -0.71376636112381542 0.14604468681390875 0.086243214125533443 -0.079489951774571604 +6 0.042777457242166465 -0.45576092006574703 -0.552753958269535 0.42815940751197412 0.21138424160935149 -0.50686424086565252 +6 -0.69726903180472077 0.58427371427586983 -0.26549450486140008 0.04515354794769965 0.28681486789955868 -0.13285774587986951 +6 0.43703961063496144 -0.10262789880626823 -0.30317985370822126 0.4423049505563586 0.66160948460225333 0.2705274293408918 +6 -0.44503643360426454 0.44210396394781937 -0.30552946308447798 -0.087224327910949404 0.29239336350668083 0.64810218531607033 +6 -0.33416852970579863 0.43114438367926067 -0.37015382974558247 0.4394289146016731 -0.4941491374465089 -0.35798172505540032 +6 0.58427360418679308 0.13212854546799202 0.32961365957906164 -0.15457700371906985 -0.52591774988985029 -0.48170292568554879 +6 -0.14692240259726411 0.50795249686667387 0.32018789462677638 0.58144701994589676 0.41352260304947402 -0.32984269044448206 +6 -0.30224776324831804 -0.54016932402525564 0.062437141365121823 0.29982639105377751 -0.48343582303649113 0.53792093713141187 +6 0.62544035465474512 0.14389245436402084 0.11513839092542102 0.44236996603616979 0.59184763957735986 0.16996370188194654 +6 0.16399979716296756 -0.54611276403195308 0.31075827322246652 0.30247091078354782 0.69596494174650481 -0.049379743875720375 +6 -0.11219854773022092 0.61621528084473354 -0.20736244405315685 0.59256100282170987 -0.26794828151981021 -0.37651853434125537 +6 -0.46302684227036922 -0.25443861931412992 0.32594642236734189 0.11169860998106729 0.43606185210305048 0.64187190603214217 +6 -0.45102710013912661 0.34319441954205482 -0.47602676819679662 0.40310344265859838 0.43758453310888407 0.31339759443247434 +6 -0.51942334686053926 -0.37233703787629813 -0.51991348946415983 -0.3753013101271776 -0.41630361563609058 0.084230081681330463 +6 0.58470861285556364 -0.27462643035008216 -0.26429262032141643 -0.3765127120977812 -0.28781649242151536 0.53688491966927399 +6 0.50045126191095868 0.7871626075227196 -0.21282467832228918 0.28028649755337315 -0.043024392064293426 0.064943060010571332 +6 -0.69508790074194882 0.43616299845857603 -0.3591724438510307 -0.049576650667123003 -0.090986178416972305 0.43228864852267174 +6 0.27823226432546638 -0.072653878980126624 0.44563536030377265 -0.1696865917185551 -0.48061373991631517 -0.67744685415092498 +6 -0.30768510623989498 -0.50822449378663159 0.18610948363783017 -0.71726533661442327 -0.23675331849272591 0.20464433167719714 +6 0.46757798287119678 -0.13228547514553321 -0.69909562048719887 0.51494410224708809 -0.069923553034947503 -0.071273871139087508 +6 0.30979245895544522 -0.27528069259249532 0.40534747257084985 0.38280137237753259 0.7111072591652291 0.108315162414837 +6 -0.75447113237181862 0.22335469077359976 -0.078453049118816759 0.57794290835632367 -0.089983576170946739 -0.18059917583172225 +6 0.53097636282674088 0.47993989234775414 -0.14341376704799877 0.37633704676626029 -0.27087538177519738 -0.50214663998975873 +6 -0.54501406879560677 -0.027692701375586291 -0.018425467843559137 -0.18240602791855356 0.27664238093066079 -0.76944805886565038 +6 0.0049593326721196094 -0.55640609995536572 -0.090097818767519516 0.52601054123491187 -0.32750199904052951 -0.54619171646909292 +6 -0.5246820629099288 0.15438725569802475 -0.40052392363106931 0.61912072585885058 -0.28944503954220524 -0.27085972501316796 +6 0.23252207147619353 -0.088889793755518587 -0.43408635618399199 0.060187728890766561 -0.74515951113397694 -0.43671027750096514 +6 -0.082635336835963871 -0.49519261695606376 0.15854845703115641 -0.56216663205680517 0.38233422075054319 -0.51049709248558417 +6 -0.63625730633727418 0.25866481089124316 0.44123359845324261 -0.49027168711023134 -0.27636701110074274 -0.1297575251319382 +6 -0.44887073462772731 -0.49904555043438975 -0.30600411449649562 -0.21972017202857003 -0.37941072591180663 0.51342052078625433 +6 -0.34623422926080971 0.11834562879027813 -0.58051057852027854 0.45782288815419275 -0.27114225180370755 -0.49598762205263436 +6 0.18476465374966927 0.16780923027338854 -0.42003736535999353 0.32891322320538224 0.44078292065455432 0.67734570576710706 +6 -0.58826517628267483 0.13974808135952232 0.62318859849813157 -0.12874611043451153 0.46759218180316064 0.10407938026297492 +6 -0.31641160184325334 0.54818645501247232 -0.1073258390615717 -0.28649693243150826 -0.24692955978787859 0.666934609418251 +6 0.10226792288332755 0.60622551567028793 -0.53017506565965233 0.071605228794985001 0.40996565618803915 -0.40956946640067621 +6 0.46043313457149759 -0.074442042067401834 0.30689113367015464 0.11103519893154284 -0.70251964235567732 0.42710054991633023 +6 -0.064156465396957033 -0.82837155645765004 0.49937300767398479 -0.21915544003533366 -0.10694135232173688 -0.029078374659791989 +6 0.0042208998272006927 0.36747111488458412 0.76684135998135416 -0.29458715192078899 -0.43565218876602341 0.018085151330519758 +6 0.65851529280804311 0.5194851618852423 -0.41811762733101349 -0.12994527743920986 0.1772560295364389 0.27085965055413574 +6 0.12993326316132806 -0.51206545526523228 0.39669591115833769 0.14384532909354469 -0.65561573013643804 0.33617734369548297 +6 0.16664316396641046 -0.13200053855335347 0.33194364778908209 0.60516407129239946 0.65067562957865477 -0.23455702996626543 +6 -0.54726594996923195 -0.092098298754806088 -0.31987289797771662 -0.4279187441318057 -0.62561590332491124 -0.12324569946937439 +6 -0.11298168347438495 0.36544841132413869 -0.60324357694674791 0.55848239564997726 0.23122326525371081 -0.35272227047200261 +6 -0.58723545016046963 0.58944372207482276 -0.22662085714400246 -0.027374002377005865 0.20652708682257323 0.46146596634115078 +6 0.25382119670786951 -0.49035434210113238 -0.46264611340318978 -0.44845091744845272 -0.46735464124745502 0.24810765200085477 +6 0.59601104905273994 -0.4194785680875594 0.33460981878342455 -0.16429160937140283 -0.25171322089750281 -0.51623013376937443 +6 0.41563033855507381 -0.48609408425483569 -0.08739976523333666 -0.061961248085371137 -0.58592390826984109 -0.48598273777543055 +6 -0.031533077985587805 0.13928846673339906 0.58357639428533792 0.48352257655397113 -0.11733201912831731 0.62568530053903204 +6 0.16248922520275433 -0.47085387551133417 -0.66619299328217085 0.14775302067779422 -0.48370792262089657 0.22864047276252492 +6 0.10089789149314744 0.18194720556532579 -0.66592379404892899 -0.44749698377552732 0.46944144644050056 -0.30435424799785848 +6 -0.16137300109253624 0.4975763651263943 0.040717095122033017 -0.55028097459815839 -0.4278321603812576 -0.48874239133681002 +6 -0.046330434202731273 0.36620529921638473 0.42638300010025254 -0.29858665784419686 -0.55582640196409261 0.532773615670874 +6 0.58075496826088835 0.62077282856651106 -0.01995679162257755 -0.40908951563845819 0.11026240062152064 -0.31217696876264217 +6 -0.2011053790337092 -0.462204381963504 0.52235264924999425 -0.52403901785865747 0.0083805492421482313 -0.44540354712899355 diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp new file mode 100644 index 00000000000..fb2cebc8cf5 --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_5.cpp @@ -0,0 +1,64 @@ +// Switch off the static filters for 4, 5, and 6 points. +// #define CGAL_NO_STATIC_FILTER_456 + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 5; // we work in Euclidean 5-space + + std::vector points; + std::ifstream in("data/points_5.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + //std::array ar = { 0, 0, 0, 0, 0 }; + //Triangulation::Point orig(ar.begin(), ar.end()); + //t.insert(orig); // insert origin + t.insert(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 + typedef Triangulation::Face Face; + typedef std::vector Faces; + Faces edges; + std::back_insert_iterator out(edges); + t.tds().incident_faces(t.infinite_vertex(), 1, out); + // collect faces of dimension 1 (edges) incident to the infinite vertex + std::cout << "There are " << edges.size() + << " vertices on the convex hull." << std::endl; + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + return 0; +} \ No newline at end of file diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp new file mode 100644 index 00000000000..8a450ad5e84 --- /dev/null +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp @@ -0,0 +1,83 @@ + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K; +typedef CGAL::Triangulation_vertex Vertex; +typedef CGAL::Triangulation_ds_full_cell DS_full_cell; +typedef CGAL::Triangulation_full_cell Full_cell; +typedef CGAL::Triangulation_data_structure, + Vertex, + Full_cell> TDS; +typedef CGAL::Triangulation Triangulation; + + +int main() +{ + const int D = 6; // we work in Euclidean 6-space + + std::vector points; + std::ifstream in("data/points.txt"); + Triangulation::Point p; + int d; + in >> d; + assert(d == D); + int n; + in >> n; + points.reserve(n); + while (in >> p) { + points.push_back(p); + } + + CGAL::Timer timer; + timer.start(); + Triangulation t(D); // create triangulation + assert(t.empty()); + + + t.insert_and_index(points.begin(), points.end()); // compute triangulation + + std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl; + timer.reset(); + assert( t.is_valid() ); + + std::vector infinite_cells; + t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells)); + + return 0; + std::set> edges; + + for(auto ch : infinite_cells) { + std::vector vertices; + std::cout << "cell" << std::endl; + vertices.reserve(D); + for(int i = 0; i < D + 1; ++i) { + if(ch->vertex(i) != t.infinite_vertex()) { + vertices.push_back(ch->vertex(i)); + std::cout << ch->vertex(i)->data() << " "; + } + } + std::cout << std::endl; + for (int i = 0; i < D-1; i++) { + for (int j = 0; j < D-1; j++) { + + if((i != j) && (vertices[i]->data() < vertices[j]->data())) { + edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data())); + } + } + } + } + for(auto pair : edges) { + std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl; + } + + std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl; + + return 0; +} \ No newline at end of file From afc4f72b26412ecad181d4d0a3420d24dc4564e7 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Tue, 8 Jul 2025 09:45:15 +0200 Subject: [PATCH 075/145] [Small Feature] Rename plane_graph_to_lcc -> read_plane_graph_in_lcc --- .../CGAL/Linear_cell_complex_constructors.h | 6 ++--- .../CGAL/Polyhedron_3_to_lcc.h | 2 +- .../CGAL/Triangulation_3_to_lcc.h | 2 +- .../Concepts/LinearCellComplexTraits.h | 4 ++-- .../Linear_cell_complex.txt | 2 +- .../PackageDescription.txt | 2 +- .../Linear_cell_complex/CMakeLists.txt | 2 +- .../examples/Linear_cell_complex/README.txt | 2 +- ...cc_2.cpp => read_plane_graph_in_lcc_2.cpp} | 2 +- .../CGAL/Linear_cell_complex_constructors.h | 22 +++++++++---------- .../Linear_cell_complex_2_test.h | 4 ++-- .../test_plane_graph_alias.cpp | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) rename Linear_cell_complex/examples/Linear_cell_complex/{plane_graph_to_lcc_2.cpp => read_plane_graph_in_lcc_2.cpp} (97%) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h index b91112d1dff..41b6e029142 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h @@ -28,15 +28,15 @@ Here a small example: \sa `CGAL::polyhedron_3_to_lcc` */ template -typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& lcc, +typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& lcc, std::istream& ais); /*! \ingroup PkgLinearCellComplexConstructions -\deprecated Use `plane_graph_to_lcc()` instead. +\deprecated Use `read_plane_graph_in_lcc()` instead. */ template -[[deprecated("Use plane_graph_to_lcc instead")]] +[[deprecated("Use read_plane_graph_in_lcc instead")]] typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, std::istream& ais); } /* namespace CGAL */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h index ce0dc47401f..88660898143 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h @@ -5,7 +5,7 @@ namespace CGAL{ Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::plane_graph_to_lcc` +\sa `CGAL::read_plane_graph_in_lcc` \sa `CGAL::triangulation_3_to_lcc` */ template diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h index aa86e5e6ffa..4234cc98cab 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h @@ -8,7 +8,7 @@ Objects are added in `lcc`, existing darts are not modified. Returns a dart crea \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::plane_graph_to_lcc` +\sa `CGAL::read_plane_graph_in_lcc` \sa `CGAL::polyhedron_3_to_lcc` */ diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h index e6a6f767393..391c1ad8ece 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h @@ -64,7 +64,7 @@ which constructs a vector as the difference of points `p2-p1`, and \link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)` which constructs a vector as the difference of point `p` and a point at the origin (used in \link CGAL::barycenter `barycenter`\endlink -and `CGAL::plane_graph_to_lcc`). +and `CGAL::read_plane_graph_in_lcc`). typedef unspecified_type Construct_vector; /*! @@ -103,7 +103,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink. typedef unspecified_type Direction_2; /*! -a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::plane_graph_to_lcc`). +a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::read_plane_graph_in_lcc`). */ typedef unspecified_type Construct_direction_2; diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index 7d2db0cbfd7..de286dedf78 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -109,7 +109,7 @@ There are two functions allowing to build a linear cell complex from two other \
  • \link ::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. -Lastly, the function \link ::plane_graph_to_lcc `plane_graph_to_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::plane_graph_to_lcc `reference manual`\endlink for the file format). +Lastly, the function \link ::read_plane_graph_in_lcc `read_plane_graph_in_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::read_plane_graph_in_lcc `reference manual`\endlink for the file format). \subsection Linear_cell_complexModificationOperations Modification Operations \anchor ssecmodifop diff --git a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt index 0a521ff5a3c..f0f70d53797 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/PackageDescription.txt @@ -62,7 +62,7 @@ \cgalCRPSection{Global Functions} \cgalCRPSubsection{Constructions for Linear Cell Complex} -- `CGAL::plane_graph_to_lcc` (formerly `import_from_plane_graph`) +- `CGAL::read_plane_graph_in_lcc` (formerly `import_from_plane_graph`) - `CGAL::triangulation_3_to_lcc` (formerly `import_from_triangulation_3`) - `CGAL::polyhedron_3_to_lcc` (formerly `import_from_polyhedron_3`) diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index e9604793e4b..d5b66adf6fa 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -24,7 +24,7 @@ create_single_source_cgal_program( "linear_cell_complex_3_with_colored_vertices.cpp") create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") create_single_source_cgal_program("linear_cell_complex_4.cpp") -create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") +create_single_source_cgal_program("read_plane_graph_in_lcc_2.cpp") create_single_source_cgal_program("voronoi_2.cpp") create_single_source_cgal_program("voronoi_3.cpp") diff --git a/Linear_cell_complex/examples/Linear_cell_complex/README.txt b/Linear_cell_complex/examples/Linear_cell_complex/README.txt index e461312f2dd..9184123bfeb 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/README.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/README.txt @@ -8,7 +8,7 @@ Examples for Linear_cell_complex package: Three "basic" examples, detailed in the user manual. -* plane_graph_to_lcc_2.cpp +* read_plane_graph_in_lcc_2.cpp Program allowing to transform a planar graph into a 2D linear cell complex. diff --git a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp b/Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp similarity index 97% rename from Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp rename to Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp index 4aa82742a06..c6ef3bac676 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/read_plane_graph_in_lcc_2.cpp @@ -42,7 +42,7 @@ int main(int narg, char** argv) std::ifstream is(filename.c_str()); std::cout<<"Import plane graph from "< - typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& alcc, + typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc, const std::vector& vertices, const std::vector& edge_indices) { @@ -131,13 +131,13 @@ namespace CGAL { } template< class LCC > -[[deprecated("Use plane_graph_to_lcc instead")]] +[[deprecated("Use read_plane_graph_in_lcc instead")]] typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const std::vector& vertices, const std::vector& edge_indices) { - return plane_graph_to_lcc(alcc, vertices, edge_indices); + return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } /** @@ -148,7 +148,7 @@ import_from_plane_graph(LCC& alcc, * @return A dart created during the conversion. */ template< class LCC > - typename LCC::Dart_descriptor plane_graph_to_lcc(LCC& alcc, + typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc, std::istream& ais) { using FT = typename LCC::FT; @@ -195,32 +195,32 @@ import_from_plane_graph(LCC& alcc, edge_indices.push_back(v2); } - return plane_graph_to_lcc(alcc, vertices, edge_indices); + return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } template -[[deprecated("Use plane_graph_to_lcc instead")]] +[[deprecated("Use read_plane_graph_in_lcc instead")]] typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, std::istream& ais) { - return plane_graph_to_lcc(alcc, ais); + return read_plane_graph_in_lcc(alcc, ais); } template < class LCC > typename LCC::Dart_descriptor - plane_graph_to_lcc(LCC& alcc, const char* filename) + read_plane_graph_in_lcc(LCC& alcc, const char* filename) { std::ifstream input(filename); if (!input.is_open()) return alcc.null_descriptor; - return plane_graph_to_lcc(alcc, input); + return read_plane_graph_in_lcc(alcc, input); } template -[[deprecated("Use plane_graph_to_lcc instead")]] +[[deprecated("Use read_plane_graph_in_lcc instead")]] typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const char* filename) { - return plane_graph_to_lcc(alcc, filename); + return read_plane_graph_in_lcc(alcc, filename); } template < class LCC > diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h index 122163f433f..c1a80876d35 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_2_test.h @@ -382,7 +382,7 @@ bool test_LCC_2() std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::read_plane_graph_in_lcc(lcc,in); if ( !check_number_of_cells_2(lcc, 66, 166, 104, 2) ) return false; lcc.clear(); @@ -431,7 +431,7 @@ struct Test_change_orientation_LCC_2 std::cout<<"Error: impossible to open 'data/graph.txt'"<(lcc,in); + CGAL::read_plane_graph_in_lcc(lcc,in); trace_test_begin(); diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index 9ecc3e3a694..905a17f1409 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -15,7 +15,7 @@ int main() input << "3 3\n0.0 0.0\n1.0 0.0\n0.0 1.0\n0 1\n1 2\n2 0\n"; // Test new function - auto d1 = CGAL::plane_graph_to_lcc(lcc1, input); + auto d1 = CGAL::read_plane_graph_in_lcc(lcc1, input); assert(d1 != LCC::null_descriptor); // Rewind input stream for second test From 81e0122efa02c6e7219997ea9c72a9e76ed0649c Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Tue, 8 Jul 2025 12:10:12 +0200 Subject: [PATCH 076/145] [Small Feature] Fix missing comment terminator in doc --- .../doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h index 391c1ad8ece..50aac41da1e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/Concepts/LinearCellComplexTraits.h @@ -64,7 +64,8 @@ which constructs a vector as the difference of points `p2-p1`, and \link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)` which constructs a vector as the difference of point `p` and a point at the origin (used in \link CGAL::barycenter `barycenter`\endlink -and `CGAL::read_plane_graph_in_lcc`). +and `CGAL::read_plane_graph_in_lcc`).*/ + typedef unspecified_type Construct_vector; /*! From 8d4877b02542b54cf7206e8efcd8fda300e42855 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 Jul 2025 15:09:42 +0100 Subject: [PATCH 077/145] Triangulation_2: Document degree() --- .../doc/Triangulation_2/CGAL/Triangulation_2.h | 14 +++++++++++++- Triangulation_2/include/CGAL/Triangulation_2.h | 9 +++++++++ .../doc/Triangulation_3/CGAL/Triangulation_3.h | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index ffc29f933bb..d467d1f1d67 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -472,7 +472,7 @@ const TriangulationDataStructure_2 & tds() const; /// @} -/// \name Non const access +/// \name Non Const Access /// \attention The responsibility of keeping a valid triangulation belongs to the /// user when using advanced operations allowing a direct manipulation /// of the `tds`. This method is mainly a help for users implementing @@ -528,6 +528,11 @@ is_infinite(Edge_circulator ec) const; bool is_infinite(All_edges_iterator ei) const; +/*! +`true` if `v` is a vertex of the triangulation. +*/ +bool is_vertex(Vertex_handle v); + /*! `true` if there is an edge having `va` and `vb` as vertices. @@ -1117,6 +1122,13 @@ in counterclockwise order around `v`. */ Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) ; +/*! +Returns the degree of `v`, that is, the number of incident vertices. +The infinite vertex is counted. +\pre `v != Vertex_handle()`, `t.is_vertex(v)`. +*/ +size_type degree(Vertex_handle v) const; + /// @} /// \name Traversal Between Adjacent Faces diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 5078301504b..95e331ef2b7 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -294,6 +294,7 @@ public: bool is_infinite(const Edge& e) const; bool is_infinite(const Edge_circulator& ec) const; bool is_infinite(const All_edges_iterator& ei) const; + bool is_vertex(Vertex_handle va) const; bool is_edge(Vertex_handle va, Vertex_handle vb) const; bool is_edge(Vertex_handle va, Vertex_handle vb, Face_handle& fr, int & i) const; @@ -1096,6 +1097,14 @@ is_infinite(const All_edges_iterator& ei) const return is_infinite(*ei); } +template +inline bool +Triangulation_2:: +is_vertex(Vertex_handle va) const +{ + return _tds.is_vertex(va); +} + template inline bool Triangulation_2:: diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h index 045d2be3c20..b4a4c8e672c 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h @@ -1669,7 +1669,7 @@ OutputIterator finite_adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of incident vertices. +Returns the degree of a `v`, that is, the number of incident vertices. The infinite vertex is counted. \pre `v != Vertex_handle()`, `t.is_vertex(v)`. */ From 289716dbab53a174bd32113a0fecc77a1e94aa4f Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Tue, 15 Jul 2025 07:53:26 +0200 Subject: [PATCH 078/145] [Small Feature] Fix deprecation warnings in test files --- .../test/Linear_cell_complex/test_plane_graph_alias.cpp | 2 ++ .../test/Linear_cell_complex/test_polyhedron_3_alias.cpp | 2 ++ .../test/Linear_cell_complex/test_triangulation_alias.cpp | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index 905a17f1409..72c51642c0e 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -22,9 +22,11 @@ int main() input.clear(); input.seekg(0, std::ios::beg); + #if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) // Test deprecated function auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); + #endif return EXIT_SUCCESS; } \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 8e12346480c..9b471aa4822 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -20,8 +20,10 @@ int main() auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); assert(d1 == LCC::null_descriptor); +#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); +#endif return EXIT_SUCCESS; } \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index b32fb2bcd03..0cc22dd6727 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -17,9 +17,10 @@ int main() auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); assert(d1 == LCC_3::null_descriptor); +#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); +#endif return EXIT_SUCCESS; -} - +} \ No newline at end of file From 61baefa79ae21ca77e848ff93332d81fbecae149 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 15 Jul 2025 12:00:44 +0200 Subject: [PATCH 079/145] Apply suggestions from code review Co-authored-by: Mael --- Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index d467d1f1d67..8ae0ea8c2fe 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -472,7 +472,7 @@ const TriangulationDataStructure_2 & tds() const; /// @} -/// \name Non Const Access +/// \name Non-Const Access /// \attention The responsibility of keeping a valid triangulation belongs to the /// user when using advanced operations allowing a direct manipulation /// of the `tds`. This method is mainly a help for users implementing @@ -531,7 +531,7 @@ is_infinite(All_edges_iterator ei) const; /*! `true` if `v` is a vertex of the triangulation. */ -bool is_vertex(Vertex_handle v); +bool is_vertex(Vertex_handle v) const; /*! `true` if there is an edge having `va` and `vb` as From 3fbdc2deed2b1c03e7f140c7abaf25d3c353f41c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 15 Jul 2025 11:03:47 +0100 Subject: [PATCH 080/145] polish --- .../CGAL/Periodic_3_triangulation_3.h | 2 +- TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h | 2 +- Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h index 8a4de97b43a..daec23b7c5d 100644 --- a/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/doc/Periodic_3_triangulation_3/CGAL/Periodic_3_triangulation_3.h @@ -1312,7 +1312,7 @@ OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of adjacent vertices. +Returns the degree of `v`, that is, the number of adjacent vertices. \pre `v` \f$ \neq\f$ `Vertex_handle()`, `t`.`is_vertex(v)`. */ size_type degree(Vertex_handle v) const; diff --git a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h index 03e4ad24928..752093512af 100644 --- a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h +++ b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h @@ -960,7 +960,7 @@ OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a vertex, that is, the number of incident vertices. +Returns the degree of `v`, that is, the number of incident vertices. \pre `v` \f$ \neq\f$ `Vertex_handle()`, `tds.is_vertex(v)`. */ size_type degree(Vertex_handle v) const; diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h index b4a4c8e672c..32a38695566 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h @@ -1669,7 +1669,7 @@ OutputIterator finite_adjacent_vertices(Vertex_handle v, OutputIterator vertices) const; /*! -Returns the degree of a `v`, that is, the number of incident vertices. +Returns the degree of `v`, that is, the number of incident vertices. The infinite vertex is counted. \pre `v != Vertex_handle()`, `t.is_vertex(v)`. */ From 84763072763cfcfe55f23abbbfe505df781f40f2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 15 Jul 2025 11:14:26 +0100 Subject: [PATCH 081/145] Add call of T2::is_vertex() in the testsuite --- .../Triangulation_2/include/CGAL/_test_cls_triangulation_2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index 0aee5fb2e42..27815a98f9f 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -182,6 +182,7 @@ _test_cls_triangulation_2( const Triangul & ) Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); assert( v0_2_0 != nullptr ); + assert( T0_2.is_vertex(v0_2_0) ); assert( T0_2.dimension() == 0 ); assert( T0_2.number_of_vertices() == 1 ); assert( T0_2.number_of_faces() == 0); From 02883a41969f649bb28d633667d177313dda63c3 Mon Sep 17 00:00:00 2001 From: lvalque Date: Tue, 15 Jul 2025 18:35:10 +0200 Subject: [PATCH 082/145] rename CrossProduct.h to robust_cross_product.h and move it in the appropriate directory --- .../include/CGAL/Cartesian/CrossProduct.h | 61 -------- .../include/CGAL/Cartesian/MatrixC33.h | 20 +-- .../internal/Lindstrom_Turk_core.h | 70 +--------- .../CGAL/internal/robust_cross_product.h | 131 ++++++++++++++++++ 4 files changed, 144 insertions(+), 138 deletions(-) delete mode 100644 Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h create mode 100644 Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h b/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h deleted file mode 100644 index a0882d63b61..00000000000 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/CrossProduct.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2025 GeometryFactory (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Mael Rouxel-Labbé -// -#ifndef CGAL_CARTESIAN_CROSSPRODUCT_H -#define CGAL_CARTESIAN_CROSSPRODUCT_H - -#include - -#include - -namespace CGAL { - -// a*b - c*d - // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products - inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) - { - double w = d * c; - double e = std::fma(c, -d, w); - double f = std::fma(a, b, -w); - return f + e; - } - - inline double diff_of_products_cht(const double a, const double b, const double c, const double d) - { - double p1 = a * b; - double p2 = c * d; - double e1 = std::fma (a, b, -p1); - double e2 = std::fma (c, -d, p2); - double r = p1 - p2; - double e = e1 + e2; - return r + e; - } - - inline double diff_of_products(const double a, const double b, const double c, const double d) - { - // return a*b - c*d; - // the next two are equivalent in results and speed - return diff_of_products_kahan(a, b, c, d); - // return diff_of_products_cht(a, b, c, d); - } - - template - inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) - { - return a*b - c*d; - } - - -} // namespace CGAL - -#endif // CGAL_CARTESIAN_CROSSPRODUCT_H // -// EOF // - - diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index b2b3d59f51b..096ad525c9b 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include @@ -221,17 +221,17 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) if(! CGAL_NTS is_zero(det)) { #if 1 - RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; - RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; - RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; + RT c00 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; + RT c01 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; + RT c02 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; - RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; - RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; - RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; + RT c10 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; + RT c11 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; + RT c12 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; - RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; - RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; - RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; + RT c20 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; + RT c21 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; + RT c22 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; #else RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det; RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index e45d198b1ed..83589a60d51 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -152,73 +152,10 @@ private : } #endif - // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates - static Vector robust_cross_product(const Vector& a, const Vector& b) - { - const FT& ax=a.x(); - const FT& ay=a.y(); - const FT& az=a.z(); - const FT& bx=b.x(); - const FT& by=b.y(); - const FT& bz=b.z(); - - auto minor = [](const FT& ai, const FT& bi, const FT& aj, const FT& bj) - { - // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude - // since this function is used to compute the cross product of two vectors that are defined - // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. - // - // We can abuse this fact to trade 2 extra subtractions to lower the error. - return ai * (bj - aj) + aj * (ai - bi); - }; - - // ay* - FT x = minor(ay, by, az, bz); - FT y = minor(az, bz, ax, bx); - FT z = minor(ax, bx, ay, by); - - return Vector(x, y, z); - } - -#if 0 - static Vector exact_cross_product(const Vector& a, const Vector& b) - { - CGAL::Cartesian_converter to_exact; - CGAL::Cartesian_converter to_approx; - auto exv = cross_product(to_exact(a), to_exact(b)); - exv.exact(); - return to_approx(exv); - } - - - - static Vector experimental_cross_product(const Vector& u, const Vector& v) - { -#if 0 - // this can create large errors and spiky meshes for kernels with inexact constructions - return CGAL::cross_product(u,v); -#elif 0 - // improves the problem mentioned above a bit, but not enough - return { std::fma(u.y(), v.z(), -u.z()*v.y()), - std::fma(u.z(), v.x(), -u.x()*v.z()), - std::fma(u.x(), v.y(), -u.y()*v.x()) }; -#elif 0 - // this is the best without resorting to exact, but it inflicts a 20% slowdown - return { diff_of_products(u.y(), v.z(), u.z(), v.y()), - diff_of_products(u.z(), v.x(), u.x(), v.z()), - diff_of_products(u.x(), v.y(), u.y(), v.x()) }; -#elif 0 - // obviously too slow - return exact_cross_product(u, v); -#endif - } - -#endif - static Vector point_cross_product(const Point& a, const Point& b) { - return robust_cross_product(a-ORIGIN, b-ORIGIN); + return robust_cross_product(a-ORIGIN, b-ORIGIN); } // This is the (uX)(Xu) product described in the Lindstrom-Turk paper @@ -332,7 +269,6 @@ extract_triangle_data() const Point_reference p1 = get_point(tri.v1); const Point_reference p2 = get_point(tri.v2); - //TODO for obscur reason, computing this maxBb increase running time by 10% maxBb=(std::max)({maxBb,CGAL::abs(p0.x()),CGAL::abs(p0.y()),CGAL::abs(p0.z()), CGAL::abs(p1.x()),CGAL::abs(p1.y()),CGAL::abs(p1.z()), CGAL::abs(p2.x()),CGAL::abs(p2.y()),CGAL::abs(p2.z())}); @@ -340,7 +276,7 @@ extract_triangle_data() Vector v01 = p1 - p0; Vector v02 = p2 - p0; - Vector lNormalV = robust_cross_product(v01,v02); + Vector lNormalV = robust_cross_product(v01,v02); FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN); CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2 diff --git a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h new file mode 100644 index 00000000000..b4f9c0e7b37 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h @@ -0,0 +1,131 @@ +// Copyright (c) 2025 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Mael Rouxel-Labbé +// +#ifndef CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H +#define CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H + +#include + +#include +#include + +namespace CGAL::Surface_mesh_simplification::internal{ + +// a*b - c*d + // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products + inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) + { + double w = d * c; + double e = std::fma(c, -d, w); + double f = std::fma(a, b, -w); + return f + e; + } + + inline double diff_of_products_cht(const double a, const double b, const double c, const double d) + { + double p1 = a * b; + double p2 = c * d; + double e1 = std::fma (a, b, -p1); + double e2 = std::fma (c, -d, p2); + double r = p1 - p2; + double e = e1 + e2; + return r + e; + } + + inline double diff_of_products(const double a, const double b, const double c, const double d) + { + // return a*b - c*d; + // the next two are equivalent in results and speed + return diff_of_products_kahan(a, b, c, d); + // return diff_of_products_cht(a, b, c, d); + } + + template + inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) + { + return a*b - c*d; + } + + // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates + template + typename Geom_traits::Vector_3 robust_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) + { + using FT = typename Geom_traits::FT; + using Vector = typename Geom_traits::Vector_3; + + const FT& ax=a.x(); + const FT& ay=a.y(); + const FT& az=a.z(); + const FT& bx=b.x(); + const FT& by=b.y(); + const FT& bz=b.z(); + + auto minor = [](const FT& ai, const FT& bi, const FT& aj, const FT& bj) + { + // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude + // since this function is used to compute the cross product of two vectors that are defined + // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. + // + // We can abuse this fact to trade 2 extra subtractions to lower the error. + return ai * (bj - aj) + aj * (ai - bi); + }; + + // ay* + FT x = minor(ay, by, az, bz); + FT y = minor(az, bz, ax, bx); + FT z = minor(ax, bx, ay, by); + + return Vector(x, y, z); + } + +#if 0 + Vector exact_cross_product(const Vector& a, const Vector& b) + { + CGAL::Cartesian_converter to_exact; + CGAL::Cartesian_converter to_approx; + auto exv = cross_product(to_exact(a), to_exact(b)); + exv.exact(); + return to_approx(exv); + } + + + + Vector experimental_cross_product(const Vector& u, const Vector& v) + { +#if 0 + // this can create large errors and spiky meshes for kernels with inexact constructions + return CGAL::cross_product(u,v); +#elif 0 + // improves the problem mentioned above a bit, but not enough + return { std::fma(u.y(), v.z(), -u.z()*v.y()), + std::fma(u.z(), v.x(), -u.x()*v.z()), + std::fma(u.x(), v.y(), -u.y()*v.x()) }; +#elif 0 + // this is the best without resorting to exact, but it inflicts a 20% slowdown + return { diff_of_products(u.y(), v.z(), u.z(), v.y()), + diff_of_products(u.z(), v.x(), u.x(), v.z()), + diff_of_products(u.x(), v.y(), u.y(), v.x()) }; +#elif 0 + // obviously too slow + return exact_cross_product(u, v); +#elif 1 + // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates + return robust_cross_product(u, v); +#endif + } + +#endif + + +} // namespace CGAL + +#endif // CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H + + From f51867ac3674e0b7970d31cf1b5d181da2cef0d4 Mon Sep 17 00:00:00 2001 From: lvalque Date: Wed, 16 Jul 2025 12:09:09 +0200 Subject: [PATCH 083/145] delete Boundinx_box_filter.h --- .../Edge_collapse/Bounding_box_filter.h | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h deleted file mode 100644 index c8b534f0ee1..00000000000 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounding_box_filter.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2024 GeometryFactory (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// Author(s) : Andreas Fabri -// -#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H -#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H - -#include -#include -#include - -#include - -namespace CGAL { -namespace Surface_mesh_simplification { - - -template -class Bounding_box_filter -{ -public: - Bounding_box_filter(const BaseFilter& base_filter = BaseFilter()) - : m_base_filter(base_filter) - {} - - - template - std::optional - operator()(const Profile& profile, std::optional op) const - { - typedef typename Profile::VertexPointMap Vertex_point_map; - - typedef typename Profile::Geom_traits Geom_traits; - typedef typename Geom_traits::Vector_3 Vector; - - typedef typename boost::property_traits::value_type Point; - typedef typename boost::property_traits::reference Point_reference; - - const Geom_traits& gt = profile.geom_traits(); - const Vertex_point_map& vpm = profile.vertex_point_map(); - - op = m_base_filter(profile, op); - if(op) - { - const Point& placement = *op; - Bbox_3 bb; - for(auto vd : profile.link()){ - Point_reference p = get(vpm, vd); - bb += p.bbox(); - } - double wx = bb.xmax() - bb.xmin(); - double wy = bb.ymax() - bb.ymin(); - double wz = bb.zmax() - bb.zmin(); - bb = Bbox_3(bb.xmin()- wx/10.0, bb.ymin() - wy/10.0, bb.zmin()- wz/10.0, bb.xmax() + wx/10.0, bb.ymax() + wy/10.0, bb.zmax()+ wz/10.0); - if(!do_overlap(bb, placement.bbox())){ - return std::optional(); - } - } - return op; - } - - - -private: - const BaseFilter m_base_filter; -}; - -} // namespace Surface_mesh_simplification -} // namespace CGAL - -#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_BOUNDING_BOX_FILTER_H From 40180827842f8802da9ed3a940d94658f9d58da6 Mon Sep 17 00:00:00 2001 From: lvalque Date: Wed, 16 Jul 2025 12:10:08 +0200 Subject: [PATCH 084/145] Variants as if maccro instead of comment lines --- .../include/CGAL/internal/robust_cross_product.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h index b4f9c0e7b37..9dbb4f460ef 100644 --- a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h +++ b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h @@ -41,10 +41,15 @@ namespace CGAL::Surface_mesh_simplification::internal{ inline double diff_of_products(const double a, const double b, const double c, const double d) { - // return a*b - c*d; + #if 0 + // this can create large errors with inexact constructions + return a*b - c*d; // the next two are equivalent in results and speed + #elif 1 return diff_of_products_kahan(a, b, c, d); - // return diff_of_products_cht(a, b, c, d); + #elif 0 + return diff_of_products_cht(a, b, c, d); + #endif } template @@ -86,7 +91,8 @@ namespace CGAL::Surface_mesh_simplification::internal{ } #if 0 - Vector exact_cross_product(const Vector& a, const Vector& b) + template + typename Geom_traits::Vector_3 exact_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) { CGAL::Cartesian_converter to_exact; CGAL::Cartesian_converter to_approx; @@ -97,7 +103,8 @@ namespace CGAL::Surface_mesh_simplification::internal{ - Vector experimental_cross_product(const Vector& u, const Vector& v) + template + typename Geom_traits::Vector_3 experimental_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) { #if 0 // this can create large errors and spiky meshes for kernels with inexact constructions From 66de6cba3db1960d99fce31eac40f527d0d52569 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Wed, 16 Jul 2025 13:56:17 +0200 Subject: [PATCH 085/145] [Small Feature] Use CGAL_DEPRECATED and protect deprecated functions --- .../CGAL/Linear_cell_complex_constructors.h | 26 +++++++++++++++---- .../test/Linear_cell_complex/CMakeLists.txt | 20 +++++++++++++- .../test_plane_graph_alias.cpp | 3 ++- .../test_polyhedron_3_alias.cpp | 3 ++- .../test_triangulation_alias.cpp | 3 ++- Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 10 ++++++- .../include/CGAL/Triangulation_3_to_lcc.h | 18 ++++++++----- 7 files changed, 67 insertions(+), 16 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 91fb21c262f..ad2eca30e8f 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace CGAL { @@ -130,8 +131,12 @@ namespace CGAL { return first; } +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ template< class LCC > -[[deprecated("Use read_plane_graph_in_lcc instead")]] +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const std::vector& vertices, @@ -139,6 +144,7 @@ import_from_plane_graph(LCC& alcc, { return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } +#endif /** * Imports a plane-embedded graph from a file into a LinearCellComplex. @@ -198,13 +204,18 @@ import_from_plane_graph(LCC& alcc, return read_plane_graph_in_lcc(alcc, vertices, edge_indices); } -template -[[deprecated("Use read_plane_graph_in_lcc instead")]] +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, std::istream& ais) { return read_plane_graph_in_lcc(alcc, ais); } +#endif template < class LCC > typename LCC::Dart_descriptor @@ -215,13 +226,18 @@ import_from_plane_graph(LCC& alcc, std::istream& ais) return read_plane_graph_in_lcc(alcc, input); } -template -[[deprecated("Use read_plane_graph_in_lcc instead")]] +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. +*/ +template< class LCC > +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const char* filename) { return read_plane_graph_in_lcc(alcc, filename); } +#endif template < class LCC > bool load_off(LCC& alcc, std::istream& in) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 249c1f9c8be..613e7058057 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -38,4 +38,22 @@ cgal_add_compilation_test(Linear_cell_complex_4_test_index) add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test.cpp ${hfiles}) target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX) target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(Linear_cell_complex_copy_test_index) \ No newline at end of file +cgal_add_compilation_test(Linear_cell_complex_copy_test_index) + +# Test sans warning de dépréciation pour test_plane_graph_alias +add_executable(test_plane_graph_alias_nowarn test_plane_graph_alias.cpp ${hfiles}) +target_compile_definitions(test_plane_graph_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_plane_graph_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_plane_graph_alias_nowarn) + +# Test sans warning de dépréciation pour test_polyhedron_3_alias +add_executable(test_polyhedron_3_alias_nowarn test_polyhedron_3_alias.cpp ${hfiles}) +target_compile_definitions(test_polyhedron_3_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_polyhedron_3_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_polyhedron_3_alias_nowarn) + +# Test sans warning de dépréciation pour test_triangulation_alias +add_executable(test_triangulation_alias_nowarn test_triangulation_alias.cpp ${hfiles}) +target_compile_definitions(test_triangulation_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) +target_link_libraries(test_triangulation_alias_nowarn PRIVATE CGAL CGAL::Data) +cgal_add_compilation_test(test_triangulation_alias_nowarn) \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index 72c51642c0e..e1aa4732a80 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -22,7 +23,7 @@ int main() input.clear(); input.seekg(0, std::ios::beg); - #if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) + #ifndef CGAL_NO_DEPRECATED_CODE // Test deprecated function auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 9b471aa4822..210a751ac88 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -20,7 +21,7 @@ int main() auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); assert(d1 == LCC::null_descriptor); -#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) +#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); #endif diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index 0cc22dd6727..427e772eb0b 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -17,7 +18,7 @@ int main() auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); assert(d1 == LCC_3::null_descriptor); -#if !defined(CGAL_NO_DEPRECATED_CODE) && !defined(CGAL_NO_DEPRECATION_WARNINGS) +#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); #endif diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index cdcf6317ea1..aaf1dfeeb33 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -21,6 +21,7 @@ #include #include #include +#include namespace CGAL { @@ -94,14 +95,21 @@ namespace CGAL { return firstAll; } +#ifndef CGAL_NO_DEPRECATED_CODE + +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `polyhedron_3_to_lcc()` instead. +*/ template< class LCC, class Polyhedron > -[[deprecated("Use polyhedron_3_to_lcc instead")]] +CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly) { return polyhedron_3_to_lcc(alcc, apoly); } +#endif // CGAL_NO_DEPRECATED_CODE + /** Convert a Polyhedron_3 read into a flux into 3D linear cell complex. * @param alcc the linear cell complex where Polyhedron_3 will be converted. * @param ais the istream where read the Polyhedron_3. diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index abd6caf2c51..42b686a6f54 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace CGAL { @@ -149,15 +150,20 @@ namespace CGAL { return dart; } - template < class LCC, class Triangulation > -[[deprecated("Use triangulation_3_to_lcc instead")]] -typename LCC::Dart_descriptor import_from_triangulation_3 -(LCC& alcc, const Triangulation &atr, - std::map* avol_to_dart=nullptr) +#ifndef CGAL_NO_DEPRECATED_CODE +/*! + \deprecated This function is deprecated since CGAL 5.6. Use `triangulation_3_to_lcc()` instead. +*/ +template +CGAL_DEPRECATED +typename LCC::Dart_descriptor +import_from_triangulation_3(LCC& alcc, const Triangulation& atr, + std::map* avol_to_dart = nullptr) { return triangulation_3_to_lcc(alcc, atr, avol_to_dart); } +#endif } // namespace CGAL From 48e23872534cb6a029fbf5847ef4e23acd5e6912 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Wed, 16 Jul 2025 14:43:17 +0200 Subject: [PATCH 086/145] [Small Feature] Use CGAL_DEPRECATED and protect deprecated functions --- .../include/CGAL/Linear_cell_complex_constructors.h | 6 +++--- Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 2 +- Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index ad2eca30e8f..547870729cf 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -133,7 +133,7 @@ namespace CGAL { #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. */ template< class LCC > CGAL_DEPRECATED @@ -206,7 +206,7 @@ import_from_plane_graph(LCC& alcc, #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. */ template< class LCC > CGAL_DEPRECATED @@ -228,7 +228,7 @@ import_from_plane_graph(LCC& alcc, std::istream& ais) #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated This function is deprecated since CGAL 5.6. Use `read_plane_graph_in_lcc()` instead. + \deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead. */ template< class LCC > CGAL_DEPRECATED diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index aaf1dfeeb33..45aabbbf1bc 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -98,7 +98,7 @@ namespace CGAL { #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated This function is deprecated since CGAL 5.6. Use `polyhedron_3_to_lcc()` instead. + \deprecated This function is deprecated since CGAL 6.2. Use `polyhedron_3_to_lcc()` instead. */ template< class LCC, class Polyhedron > CGAL_DEPRECATED diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 42b686a6f54..eaeb1345a0e 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -152,7 +152,7 @@ namespace CGAL { #ifndef CGAL_NO_DEPRECATED_CODE /*! - \deprecated This function is deprecated since CGAL 5.6. Use `triangulation_3_to_lcc()` instead. + \deprecated This function is deprecated since CGAL 6.2. Use `triangulation_3_to_lcc()` instead. */ template CGAL_DEPRECATED From 60782f879f92b6737d259fc99d1ff6e9efdeaccf Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Wed, 16 Jul 2025 16:42:55 +0200 Subject: [PATCH 087/145] [Small Feature] Clean up test targets with CGAL_NO_DEPRECATION_WARNINGS --- Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 613e7058057..f9adefa9d7d 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -15,9 +15,6 @@ create_single_source_cgal_program(Linear_cell_complex_3_test.cpp ${hfiles}) create_single_source_cgal_program(Linear_cell_complex_4_test.cpp ${hfiles}) create_single_source_cgal_program(Linear_cell_complex_copy_test.cpp ${hfiles}) create_single_source_cgal_program(LCC_3_incremental_builder_test.cpp ${hfiles}) -create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles}) -create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles}) -create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles}) # Same targets, defining USE_COMPACT_CONTAINER_WITH_INDEX to test index version add_executable(Linear_cell_complex_2_test_index Linear_cell_complex_2_test.cpp ${hfiles}) From 13f5968eaac711649a5151662860dc1f4661a11d Mon Sep 17 00:00:00 2001 From: Mael Date: Thu, 17 Jul 2025 11:37:58 +0200 Subject: [PATCH 088/145] Clean up --- .../CGAL/internal/robust_cross_product.h | 2 +- .../data/issue_8213.off | 21 ++++++++----------- .../issue_8213.cpp | 16 ++++---------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h index 9dbb4f460ef..ea3b05fbcd2 100644 --- a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h +++ b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h @@ -18,7 +18,7 @@ namespace CGAL::Surface_mesh_simplification::internal{ -// a*b - c*d + // a*b - c*d // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) { diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off index 4669828bf08..14e2cf1fbe3 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/issue_8213.off @@ -1,16 +1,13 @@ OFF 5 4 0 - 0.60153250345565623 3.2925554343503594 -0.93390733763467004 - 0.50125687092531912 3.266008536541555 -0.80580753798383942 - 0.57499779785916183 3.2558452065056969 -0.97860403852322797 - 0.56586410588624558 3.2541065339825863 -0.99341202997519495 - 0.56756366821062887 3.2478315549358072 -0.99100621040927039 - - 3 0 1 2 - 3 1 3 2 - 3 1 0 3 - 3 0 4 3 - - +0.60153250345565623 3.2925554343503594 -0.93390733763467004 +0.50125687092531912 3.266008536541555 -0.80580753798383942 +0.57499779785916183 3.2558452065056969 -0.97860403852322797 +0.56586410588624558 3.2541065339825863 -0.99341202997519495 +0.56756366821062887 3.2478315549358072 -0.99100621040927039 +3 0 1 2 +3 1 3 2 +3 1 0 3 +3 0 4 3 diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp index d8bd43e4a74..24f89279cf8 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -3,8 +3,6 @@ #include -CGAL::Bbox_3 bbox_g; -double max_bbox_g; #define CGAL_CHECK_EXPENSIVE #define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5 @@ -17,7 +15,6 @@ void Surface_simplification_external_trace(const std::string& s) #include #include -// #include #include #include #include @@ -50,20 +47,15 @@ int main(int argc, char** argv) return EXIT_FAILURE; } - auto bb=PMP::bbox(sm); + CGAL::Bbox_3 bb = PMP::bbox(sm); std::cout << "Bbox:" << bb << std::endl; std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl; std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; - SMS::Face_count_stop_predicate stop(1); - SMS::edge_collapse( - sm, - stop, - CGAL::parameters:: - // filter(SMS::Bounded_normal_change_filter<>()) //>(SMS::Bounding_box_filter<>())) - get_cost(SMS::LindstromTurk_cost()) - .get_placement(SMS::LindstromTurk_placement()) + SMS::edge_collapse(sm, stop, + CGAL::parameters::get_cost(SMS::LindstromTurk_cost()) + .get_placement(SMS::LindstromTurk_placement()) ); CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); From 263dc8b49bd94aa2cb260df2c400975e6f3666f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 17 Jul 2025 12:16:18 +0200 Subject: [PATCH 089/145] Misc fixes --- .../include/CGAL/Cartesian/MatrixC33.h | 59 ++--- .../CGAL/internal/robust_cross_product.h | 215 +++++++++--------- .../issue_8213.cpp | 7 +- 3 files changed, 139 insertions(+), 142 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 096ad525c9b..a41c8e768ca 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -13,11 +13,12 @@ #include +#include + #include #include #include #include -#include #include @@ -184,17 +185,19 @@ MatrixC33 cofactors_matrix(const MatrixC33& m) { typedef typename R::RT RT; - RT c00 = determinant(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z()); - RT c01 = -determinant(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z()); - RT c02 = determinant(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y()); + using ::CGAL::Surface_mesh_simplification::internal::diff_of_products; - RT c10 = -determinant(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z()); - RT c11 = determinant(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z()); - RT c12 = -determinant(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y()); + RT c00 = diff_of_products(m.r1().y(), m.r2().z(), m.r2().y(), m.r1().z()); + RT c01 = -diff_of_products(m.r1().x(), m.r2().z(), m.r2().x(), m.r1().z()); + RT c02 = diff_of_products(m.r1().x(), m.r2().y(), m.r2().x(), m.r1().y()); - RT c20 = determinant(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z()); - RT c21 = -determinant(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z()); - RT c22 = determinant(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y()); + RT c10 = -diff_of_products(m.r0().y(), m.r2().z(), m.r2().y(), m.r0().z()); + RT c11 = diff_of_products(m.r0().x(), m.r2().z(), m.r2().x(), m.r0().z()); + RT c12 = -diff_of_products(m.r0().x(), m.r2().y(), m.r2().x(), m.r0().y()); + + RT c20 = diff_of_products(m.r0().y(), m.r1().z(), m.r1().y(), m.r0().z()); + RT c21 = -diff_of_products(m.r0().x(), m.r1().z(), m.r1().x(), m.r0().z()); + RT c22 = diff_of_products(m.r0().x(), m.r1().y(), m.r1().x(), m.r0().y()); return MatrixC33(c00,c01,c02, c10,c11,c12, @@ -212,7 +215,9 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) { typedef typename R::RT RT; typedef MatrixC33 Matrix; - typedef std::optional result_type; + typedef std::optional result_type; + + using ::CGAL::Surface_mesh_simplification::internal::diff_of_products; result_type rInverse; @@ -220,31 +225,17 @@ std::optional< MatrixC33 > inverse_matrix(const MatrixC33& m) if(! CGAL_NTS is_zero(det)) { -#if 1 - RT c00 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; - RT c01 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; - RT c02 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; + RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det; + RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det; + RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det; - RT c10 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; - RT c11 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; - RT c12 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; + RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det; + RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det; + RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det; - RT c20 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; - RT c21 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; - RT c22 = ::CGAL::Surface_mesh_simplification::internal::diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; -#else - RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det; - RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det; - RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det; - - RT c10 = (m.r1().z()*m.r2().x() - m.r1().x()*m.r2().z()) / det; - RT c11 = (m.r0().x()*m.r2().z() - m.r2().x()*m.r0().z()) / det; - RT c12 = (m.r1().x()*m.r0().z() - m.r0().x()*m.r1().z()) / det; - - RT c20 = (m.r1().x()*m.r2().y() - m.r2().x()*m.r1().y()) / det; - RT c21 = (m.r2().x()*m.r0().y() - m.r0().x()*m.r2().y()) / det; - RT c22 = (m.r0().x()*m.r1().y() - m.r0().y()*m.r1().x()) / det; -#endif + RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det; + RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det; + RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det; rInverse = result_type(Matrix(c00,c01,c02, c10,c11,c12, diff --git a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h index ea3b05fbcd2..e8e2caf095f 100644 --- a/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h +++ b/Surface_mesh_simplification/include/CGAL/internal/robust_cross_product.h @@ -14,124 +14,129 @@ #include #include + #include -namespace CGAL::Surface_mesh_simplification::internal{ +namespace CGAL { +namespace Surface_mesh_simplification { +namespace internal { - // a*b - c*d - // The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products - inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) - { - double w = d * c; - double e = std::fma(c, -d, w); - double f = std::fma(a, b, -w); - return f + e; - } +// a*b - c*d +// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products +inline double diff_of_products_kahan(const double a, const double b, const double c, const double d) +{ + double w = d * c; + double e = std::fma(c, -d, w); + double f = std::fma(a, b, -w); + return f + e; +} - inline double diff_of_products_cht(const double a, const double b, const double c, const double d) - { - double p1 = a * b; - double p2 = c * d; - double e1 = std::fma (a, b, -p1); - double e2 = std::fma (c, -d, p2); - double r = p1 - p2; - double e = e1 + e2; - return r + e; - } - - inline double diff_of_products(const double a, const double b, const double c, const double d) - { - #if 0 - // this can create large errors with inexact constructions - return a*b - c*d; - // the next two are equivalent in results and speed - #elif 1 - return diff_of_products_kahan(a, b, c, d); - #elif 0 - return diff_of_products_cht(a, b, c, d); - #endif - } - - template - inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) - { - return a*b - c*d; - } - - // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates - template - typename Geom_traits::Vector_3 robust_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) - { - using FT = typename Geom_traits::FT; - using Vector = typename Geom_traits::Vector_3; - - const FT& ax=a.x(); - const FT& ay=a.y(); - const FT& az=a.z(); - const FT& bx=b.x(); - const FT& by=b.y(); - const FT& bz=b.z(); - - auto minor = [](const FT& ai, const FT& bi, const FT& aj, const FT& bj) - { - // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude - // since this function is used to compute the cross product of two vectors that are defined - // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. - // - // We can abuse this fact to trade 2 extra subtractions to lower the error. - return ai * (bj - aj) + aj * (ai - bi); - }; - - // ay* - FT x = minor(ay, by, az, bz); - FT y = minor(az, bz, ax, bx); - FT z = minor(ax, bx, ay, by); - - return Vector(x, y, z); - } +inline double diff_of_products_cht(const double a, const double b, const double c, const double d) +{ + double p1 = a * b; + double p2 = c * d; + double e1 = std::fma (a, b, -p1); + double e2 = std::fma (c, -d, p2); + double r = p1 - p2; + double e = e1 + e2; + return r + e; +} +inline double diff_of_products(const double a, const double b, const double c, const double d) +{ #if 0 - template - typename Geom_traits::Vector_3 exact_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) - { - CGAL::Cartesian_converter to_exact; - CGAL::Cartesian_converter to_approx; - auto exv = cross_product(to_exact(a), to_exact(b)); - exv.exact(); - return to_approx(exv); - } - - - - template - typename Geom_traits::Vector_3 experimental_cross_product(const typename Geom_traits::Vector_3& a, const typename Geom_traits::Vector_3& b) - { -#if 0 - // this can create large errors and spiky meshes for kernels with inexact constructions - return CGAL::cross_product(u,v); -#elif 0 - // improves the problem mentioned above a bit, but not enough - return { std::fma(u.y(), v.z(), -u.z()*v.y()), - std::fma(u.z(), v.x(), -u.x()*v.z()), - std::fma(u.x(), v.y(), -u.y()*v.x()) }; -#elif 0 - // this is the best without resorting to exact, but it inflicts a 20% slowdown - return { diff_of_products(u.y(), v.z(), u.z(), v.y()), - diff_of_products(u.z(), v.x(), u.x(), v.z()), - diff_of_products(u.x(), v.y(), u.y(), v.x()) }; -#elif 0 - // obviously too slow - return exact_cross_product(u, v); + // this can create large errors with inexact constructions + return a*b - c*d; + // the next two are equivalent in results and speed #elif 1 - // balanced solution based on abusing the fact that here we expect u and v to have similar coordinates - return robust_cross_product(u, v); + return diff_of_products_kahan(a, b, c, d); +#elif 0 + return diff_of_products_cht(a, b, c, d); #endif - } +} +template +inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d) +{ + return a*b - c*d; +} + +// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates +template +typename GeomTraits::Vector_3 similar_coordinates_cross_product(const typename GeomTraits::Vector_3& u, + const typename GeomTraits::Vector_3& v) +{ + using FT = typename GeomTraits::FT; + using Vector = typename GeomTraits::Vector_3; + + const FT& ux = u.x(); + const FT& uy = u.y(); + const FT& uz = u.z(); + const FT& vx = v.x(); + const FT& vy = v.y(); + const FT& vz = v.z(); + + auto minor = [](const FT& ui, const FT& vi, const FT& uj, const FT& vj) + { + // The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude + // since this function is used to compute the cross product of two vectors that are defined + // as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle. + // + // We can abuse this fact to trade 2 extra subtractions to lower the error. + return ui * (vj - uj) + uj * (ui - vi); + }; + + // ay* + FT x = minor(uy, vy, uz, vz); + FT y = minor(uz, vz, ux, vx); + FT z = minor(ux, vx, uy, vy); + + return Vector(x, y, z); +} + +#if 0 +template +typename GeomTraits::Vector_3 exact_cross_product(const typename GeomTraits::Vector_3& a, + const typename GeomTraits::Vector_3& b) +{ + CGAL::Cartesian_converter to_exact; + CGAL::Cartesian_converter to_approx; + auto exv = cross_product(to_exact(a), to_exact(b)); + exv.exact(); + return to_approx(exv); +} #endif +template +typename GeomTraits::Vector_3 robust_cross_product(const typename GeomTraits::Vector_3& u, + const typename GeomTraits::Vector_3& v) +{ +#if 0 + // this can create large errors and spiky meshes for kernels with inexact constructions + return CGAL::cross_product(u,v); +#elif 0 + // improves the problem mentioned above a bit, but not enough + return { std::fma(u.y(), v.z(), -u.z()*v.y()), + std::fma(u.z(), v.x(), -u.x()*v.z()), + std::fma(u.x(), v.y(), -u.y()*v.x()) }; +#elif 0 + // this is the best without resorting to exact, but it inflicts a 20% slowdown + return { diff_of_products(u.y(), v.z(), u.z(), v.y()), + diff_of_products(u.z(), v.x(), u.x(), v.z()), + diff_of_products(u.x(), v.y(), u.y(), v.x()) }; +#elif 0 + // obviously too slow + return exact_cross_product(u, v); +#elif 1 + // balanced solution based on abusing the fact that in this package, we usually have that + // u and v to have similar coordinates + return similar_coordinates_cross_product(u, v); +#endif +} } // namespace CGAL +} // namespace Surface_mesh_simplification +} // namespace internal #endif // CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp index 24f89279cf8..2e9811ca6ee 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/issue_8213.cpp @@ -30,6 +30,7 @@ namespace PMP = CGAL::Polygon_mesh_processing; using Kernel = CGAL::Simple_cartesian; // using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; + using Surface_mesh = CGAL::Surface_mesh; int main(int argc, char** argv) @@ -53,10 +54,10 @@ int main(int argc, char** argv) std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl; SMS::Face_count_stop_predicate stop(1); - SMS::edge_collapse(sm, stop, + SMS::edge_collapse(sm, stop, CGAL::parameters::get_cost(SMS::LindstromTurk_cost()) - .get_placement(SMS::LindstromTurk_placement()) - ); + .get_placement(SMS::LindstromTurk_placement())); + CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17)); for(auto v : vertices(sm)) From b9c05d8e3a1b409fd8e3c83fea6a4804bd65f6ca Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Thu, 17 Jul 2025 16:43:01 +0200 Subject: [PATCH 090/145] [Small Feature] Cleanup deprecated warnings --- .../test/Linear_cell_complex/CMakeLists.txt | 22 ++++++------------- .../test_plane_graph_alias.cpp | 8 ++++--- .../test_polyhedron_3_alias.cpp | 8 ++++--- .../test_triangulation_alias.cpp | 8 ++++--- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index f9adefa9d7d..b7bc367cf27 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -37,20 +37,12 @@ target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPA target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data) cgal_add_compilation_test(Linear_cell_complex_copy_test_index) -# Test sans warning de dépréciation pour test_plane_graph_alias -add_executable(test_plane_graph_alias_nowarn test_plane_graph_alias.cpp ${hfiles}) -target_compile_definitions(test_plane_graph_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) -target_link_libraries(test_plane_graph_alias_nowarn PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(test_plane_graph_alias_nowarn) +# Alias tests (test old function names, with deprecated warnings disabled) +create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles}) +target_compile_definitions(test_triangulation_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) -# Test sans warning de dépréciation pour test_polyhedron_3_alias -add_executable(test_polyhedron_3_alias_nowarn test_polyhedron_3_alias.cpp ${hfiles}) -target_compile_definitions(test_polyhedron_3_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) -target_link_libraries(test_polyhedron_3_alias_nowarn PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(test_polyhedron_3_alias_nowarn) +create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles}) +target_compile_definitions(test_polyhedron_3_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) -# Test sans warning de dépréciation pour test_triangulation_alias -add_executable(test_triangulation_alias_nowarn test_triangulation_alias.cpp ${hfiles}) -target_compile_definitions(test_triangulation_alias_nowarn PRIVATE CGAL_NO_DEPRECATION_WARNINGS) -target_link_libraries(test_triangulation_alias_nowarn PRIVATE CGAL CGAL::Data) -cgal_add_compilation_test(test_triangulation_alias_nowarn) \ No newline at end of file +create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles}) +target_compile_definitions(test_plane_graph_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS) diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index e1aa4732a80..2bd3be2a5ff 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -7,6 +7,8 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC; +#ifndef CGAL_NO_DEPRECATED_CODE + int main() { LCC lcc1, lcc2; @@ -23,11 +25,11 @@ int main() input.clear(); input.seekg(0, std::ios::beg); - #ifndef CGAL_NO_DEPRECATED_CODE // Test deprecated function auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); - #endif return EXIT_SUCCESS; -} \ No newline at end of file +} + +#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 210a751ac88..4df2c2eaa78 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -9,6 +9,8 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; typedef CGAL::Polyhedron_3 Polyhedron; +#ifndef CGAL_NO_DEPRECATED_CODE + int main() { std::stringstream ss("OFF\n0 0 0\n"); @@ -21,10 +23,10 @@ int main() auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); assert(d1 == LCC::null_descriptor); -#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); -#endif return EXIT_SUCCESS; -} \ No newline at end of file +} + +#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index 427e772eb0b..c5d630e996d 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -8,6 +8,8 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3; typedef CGAL::Delaunay_triangulation_3 Triangulation; +#ifndef CGAL_NO_DEPRECATED_CODE + int main() { LCC_3 lcc1, lcc2; @@ -18,10 +20,10 @@ int main() auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T); assert(d1 == LCC_3::null_descriptor); -#ifndef CGAL_NO_DEPRECATED_CODE auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); -#endif return EXIT_SUCCESS; -} \ No newline at end of file +} + +#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file From 5a28105560dc93c7ac667934309bbac49b0bc1a7 Mon Sep 17 00:00:00 2001 From: Yliess Bellargui Date: Thu, 17 Jul 2025 17:04:36 +0200 Subject: [PATCH 091/145] [Small Feature] Fix alias tests: move CGAL_NO_DEPRECATED_CODE guard inside main() --- .../test/Linear_cell_complex/test_plane_graph_alias.cpp | 6 +++--- .../test/Linear_cell_complex/test_polyhedron_3_alias.cpp | 5 ++--- .../test/Linear_cell_complex/test_triangulation_alias.cpp | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp index 2bd3be2a5ff..cafb22ad4b4 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_plane_graph_alias.cpp @@ -7,10 +7,11 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC; -#ifndef CGAL_NO_DEPRECATED_CODE + int main() { +#ifndef CGAL_NO_DEPRECATED_CODE LCC lcc1, lcc2; // Planar graph with 3 vertices and 3 edges (triangle) @@ -28,8 +29,7 @@ int main() // Test deprecated function auto d2 = CGAL::import_from_plane_graph(lcc2, input); assert(d2 != LCC::null_descriptor); - +#endif // CGAL_NO_DEPRECATED_CODE return EXIT_SUCCESS; } -#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 4df2c2eaa78..506fcedfdf0 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -9,10 +9,10 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC; typedef CGAL::Polyhedron_3 Polyhedron; -#ifndef CGAL_NO_DEPRECATED_CODE int main() { +#ifndef CGAL_NO_DEPRECATED_CODE std::stringstream ss("OFF\n0 0 0\n"); Polyhedron P; @@ -25,8 +25,7 @@ int main() auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); - +#endif // CGAL_NO_DEPRECATED_CODE return EXIT_SUCCESS; } -#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp index c5d630e996d..43b9e0ebf82 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_triangulation_alias.cpp @@ -8,10 +8,11 @@ typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3; typedef CGAL::Delaunay_triangulation_3 Triangulation; -#ifndef CGAL_NO_DEPRECATED_CODE + int main() { +#ifndef CGAL_NO_DEPRECATED_CODE LCC_3 lcc1, lcc2; Triangulation T; @@ -22,8 +23,7 @@ int main() auto d2 = CGAL::import_from_triangulation_3(lcc2, T); assert(d2 == LCC_3::null_descriptor); - +#endif // CGAL_NO_DEPRECATED_CODE return EXIT_SUCCESS; } -#endif // CGAL_NO_DEPRECATED_CODE \ No newline at end of file From 17586da7a4fefbedbd9dcaecdfe559c199c56fec Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 Jul 2025 19:34:06 +0100 Subject: [PATCH 092/145] No need to spatial_sort() --- Triangulation/include/CGAL/Triangulation.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index 8271cdb27c5..488bf796412 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -699,8 +699,6 @@ public: using Search_traits_d = CGAL::Spatial_sort_traits_adapter_d; CGAL::spatial_sort(indices.begin(), indices.end(), Search_traits_d(start)); - std::vector points(start, end); - spatial_sort(points.begin(), points.end(), geom_traits()); Full_cell_handle hint = Full_cell_handle(); for (auto index : indices) { From 1d27b1ae4439dc3e40ff34bf1efc4420b448dc4c Mon Sep 17 00:00:00 2001 From: lvalque Date: Fri, 18 Jul 2025 16:47:48 +0200 Subject: [PATCH 093/145] Factorization and cleanup of compute_vertex_normal_most_visible_min_circle() --- .../Polygon_mesh_processing/compute_normal.h | 118 +++++++++--------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index c1b0dc61f8f..c494875ca7a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -527,10 +527,13 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits incident_faces; incident_faces.reserve(8); for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) { + // Remove degenerate and redundant faces if((f == boost::graph_traits::null_face()) || (get(face_normals, f)==NULL_VECTOR) ) continue; @@ -548,7 +551,8 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits circum_points; circum_points.push_back(incident_faces[0]); circum_points.push_back(incident_faces[1]); - //Get the farthest point to circum_points[0] + + // Get the farthest point from circum_points[0] const Vector_ref n0 = get(face_normals, circum_points[0]); const Vector_ref n1 = get(face_normals, circum_points[1]); FT sp_min = sp_3(n0, n1); @@ -561,52 +565,49 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits(-1,-2,-3,center, radius, f_out, incident_faces, face_normals, traits)) - return center; - circum_points.push_back(f_out); - - //Delete one vertex if include in circum circle of the two others - const Vector_ref nk = get(face_normals, circum_points[2]); - Vector_3 center_ni_nk = compute_normals_bisector(ni, nk, traits); - Vector_3 center_nj_nk = compute_normals_bisector(nj, nk, traits); - if(sp_3(center_ni_nk, nj) > sp_3(center_ni_nk, ni) ){ - std::swap(circum_points[1],circum_points[2]); - circum_points.pop_back(); - } else if(sp_3(center_nj_nk, ni) > sp_3(center_nj_nk, nj) ){ - std::swap(circum_points[0],circum_points[2]); - circum_points.pop_back(); - } - } else { - const Vector_ref ni = get(face_normals, circum_points[0]); - const Vector_ref nj = get(face_normals, circum_points[1]); + CGAL_assertion(circum_points.size()==3); const Vector_ref nk = get(face_normals, circum_points[2]); center = compute_normals_bisector(ni, nj, nk, traits); - radius = sp_3(ni, center); - if(is_negative(radius)) - return NULL_VECTOR; // Not normal visible by all - face_descriptor f_out; - if(does_enclose_other_normals(-1,-2,-3,center, radius, f_out, incident_faces, face_normals, traits)){ - return center; - } + } - const Vector_ref no= get(face_normals, f_out); + if(center==NULL_VECTOR) + return NULL_VECTOR; + + radius = -sp_3(ni, center); + + if(is_positive(radius)) + return NULL_VECTOR; // The circle is larger than a hemisphere, so no normal is visible to all + + face_descriptor f_out; + if(does_enclose_other_normals(-1,-2,-3, center, -radius, f_out, incident_faces, face_normals, traits)) + return center; + const Vector_ref no = get(face_normals, f_out); + + if(circum_points.size()==2){ + circum_points.push_back(f_out); + } else { if(is_negative(sp_3(center, no))) - return NULL_VECTOR; // Not normal visible by all - // move the farthest point to f at the beginning of circum_points + return NULL_VECTOR; // The circle will become bigger than an hemisphere, no normal visible by all + + const Vector_ref nk = get(face_normals, circum_points[2]); + + // We need to remove one of the previous points + // We keep the farthest point from the new one + // Then we divide the sphere in two along the equator that passes through the first point and the center + // We remove the previous point that lies in the same hemisphere as the new one + + // move the farthest point to f_out at the beginning of circum_points FT sp_ni_no = sp_3(ni, no); FT sp_nj_no = sp_3(nj, no); FT sp_nk_no = sp_3(nk, no); @@ -621,41 +622,44 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits sp_3(center_ni_nj, ni2) ){ - circum_points.pop_back(); - } else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2) ){ - std::swap(circum_points[1],circum_points[2]); - circum_points.pop_back(); - } else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2) ){ - std::swap(circum_points[0],circum_points[2]); - circum_points.pop_back(); - } + // Delete one vertex if it is included in the circumcircle of the other two + const Vector_ref ni2 = get(face_normals, circum_points[0]); + const Vector_ref nj2 = get(face_normals, circum_points[1]); + const Vector_ref nk2 = get(face_normals, circum_points[2]); + Vector_3 center_ni_nj = compute_normals_bisector(ni2, nj2, traits); + Vector_3 center_ni_nk = compute_normals_bisector(ni2, nk2, traits); + Vector_3 center_nj_nk = compute_normals_bisector(nj2, nk2, traits); + if(sp_3(center_ni_nj, nk2) > sp_3(center_ni_nj, ni2)){ + circum_points.pop_back(); + } else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2)){ + std::swap(circum_points[1],circum_points[2]); + circum_points.pop_back(); + } else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2)){ + std::swap(circum_points[0],circum_points[2]); + circum_points.pop_back(); } } } From 7840dc850639ebe05ee8e60f36dc123e748926f4 Mon Sep 17 00:00:00 2001 From: lvalque Date: Fri, 18 Jul 2025 16:50:12 +0200 Subject: [PATCH 094/145] Remove the old algorithm in n^4 --- .../Polygon_mesh_processing/compute_normal.h | 182 ------------------ 1 file changed, 182 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index c494875ca7a..86a56b5be9a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -394,122 +394,6 @@ typename GT::Vector_3 compute_normals_bisector(const typename GT::Vector_3& ni, return nb; } -template -typename GT::Vector_3 -compute_most_visible_normal_2_points(std::vector::face_descriptor>& incident_faces, - const FaceNormalVector& face_normals, - const GT& traits) -{ - typedef typename GT::FT FT; - typedef typename GT::Vector_3 Vector_3; - typedef typename boost::property_traits::reference Vector_ref; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - - typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); - typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object(); - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Trying to find enclosing normal with 2 normals" << std::endl; -#endif - - FT min_sp = -1; - Vector_3 n = cv_3(CGAL::NULL_VECTOR); - - const std::size_t nif = incident_faces.size(); - for(std::size_t i=0; i(i, j, -1 /*NA*/, nb, sp_bi, dummy, incident_faces, face_normals, traits)) - continue; - - min_sp = sp_bi; - n = nb; - } - } - - return n; -} - -template -typename GT::Vector_3 -compute_most_visible_normal_3_points(const std::vector::face_descriptor>& incident_faces, - const FaceNormalVector& face_normals, - const GT& traits) -{ - typedef typename GT::FT FT; - typedef typename GT::Vector_3 Vector_3; - typedef typename boost::property_traits::reference Vector_ref; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Trying to find enclosing normal with 3 normals" << std::endl; -#endif - - FT min_sp = -1; - - Vector_3 n = traits.construct_vector_3_object()(CGAL::NULL_VECTOR); - - const std::size_t nif = incident_faces.size(); - for(std::size_t i=0; i(i, j, k, nb, sp_bi, dummy, incident_faces, face_normals, traits)) - continue; - - min_sp = sp_bi; - n = nb; - } - } - } - -#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP - std::cout << "Best normal from 3-normals-approach: " << n << std::endl; -#endif - - return n; -} - // Inspired by Aubry et al. On the most 'normal' normal template typename GT::Vector_3 @@ -664,57 +548,6 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits -typename GT::Vector_3 -compute_vertex_normal_most_visible_min_circle_old(typename boost::graph_traits::vertex_descriptor v, - const FaceNormalVector& face_normals, - const PolygonMesh& pmesh, - const GT& traits) -{ - typedef typename boost::graph_traits::face_descriptor face_descriptor; - - typedef typename GT::Vector_3 Vector_3; - - typename GT::FT bound(0.001); - - std::vector incident_faces; - incident_faces.reserve(8); - for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) - { - if((f == boost::graph_traits::null_face()) || (get(face_normals, f)==NULL_VECTOR) ) - continue; - - if(! incident_faces.empty()){ - if(get(face_normals, incident_faces.back()) == get(face_normals, f) ) - continue; - - // auto aa = approximate_angle(get(face_normals, incident_faces.back()) ,get(face_normals, f)); - // if(aa < bound) - // continue; - } - incident_faces.push_back(f); - } - - if(incident_faces.size() == 0) - return NULL_VECTOR; - if(incident_faces.size() == 1) - return get(face_normals, incident_faces.front()); - - Vector_3 res = compute_most_visible_normal_2_points(incident_faces, face_normals, traits); - if(res != CGAL::NULL_VECTOR) // found a valid normal through 2 point min circle - return res; - - // The vertex has only two incident faces with opposite normals (fold)... - // @todo devise something based on the directions of the 2/3/4 incident edges? - if(incident_faces.size() == 2 && res == CGAL::NULL_VECTOR) - return res; - - CGAL_assertion(incident_faces.size() >= 2); - - return compute_most_visible_normal_3_points(incident_faces, face_normals, traits); -} - template typename GT::Vector_3 compute_vertex_normal_as_sum_of_weighted_normals(typename boost::graph_traits::vertex_descriptor v, @@ -906,21 +739,6 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript } #endif Vector_3 normal = internal::compute_vertex_normal_most_visible_min_circle(v, face_normals, pmesh, traits); - Vector_3 normal_old = internal::compute_vertex_normal_most_visible_min_circle_old(v, face_normals, pmesh, traits); - if(!traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) - internal::normalize(normal, traits); - if(!traits.equal_3_object()(normal_old, CGAL::NULL_VECTOR)) - internal::normalize(normal_old, traits); - if( ((normal-normal_old).squared_length()>=0.01) ){ - std::cout << "Different normals found by the two methods" << std::endl; - std::cout << "brute force: " << normal_old << std::endl; - std::cout << "n^2 methods: " << normal << std::endl; - std::cout << "incident faces:" << std::endl; - for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) - std::cout << f << ": " << get(face_normals, f) << std::endl; - std::cout << std::endl; - } - // CGAL_assertion(((normal==normal_old) || ((normal-normal_old).squared_length()<0.0001) || (normal==NULL_VECTOR))); if(traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) // can't always find a most visible normal { #ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP From 20d1c99950aa93cc9fd67f72234989caa4d33c7c Mon Sep 17 00:00:00 2001 From: lvalque Date: Fri, 18 Jul 2025 17:07:42 +0200 Subject: [PATCH 095/145] adjust the error_bound to be consistant with the one in does_enclose_other_normal --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index 86a56b5be9a..fef7060e1d9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -411,8 +411,6 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits incident_faces; incident_faces.reserve(8); for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh)) @@ -517,6 +515,9 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits Date: Mon, 21 Jul 2025 12:16:48 +0200 Subject: [PATCH 096/145] fix build of tests/examples/demos for a release it will not work in branch build mode but I'm not sure this is something we want to support. --- Installation/cmake/modules/CGALHelpers.cmake | 2 +- Installation/demo/CMakeLists.txt | 19 ++++++++++++++----- Installation/examples/CMakeLists.txt | 20 +++++++++++++++----- Installation/test/CMakeLists.txt | 18 +++++++++++++----- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/Installation/cmake/modules/CGALHelpers.cmake b/Installation/cmake/modules/CGALHelpers.cmake index de42f8cf269..f29fd11111b 100644 --- a/Installation/cmake/modules/CGALHelpers.cmake +++ b/Installation/cmake/modules/CGALHelpers.cmake @@ -9,7 +9,7 @@ function(process_CGAL_subdirectory entry subdir type_name) make_directory("${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") endif() - message("\n-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") + message("-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") set(source_dir "") if(EXISTS ${entry}/CMakeLists.txt) diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 92606a5b9d2..011b436cc53 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,7 +1,16 @@ +project(CGAL_Demos) + cmake_minimum_required(VERSION 3.12...3.31) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(demo demos) +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) + +message("== Generating build files for demos ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index e0034b4727f..9fc6ac0858b 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,6 +1,16 @@ +project(CGAL_Examples) + cmake_minimum_required(VERSION 3.12...3.31) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(examples examples) + +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) + +message("== Generating build files for examples ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index 64d616edd57..e8e81f0c032 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,8 +1,16 @@ +project(CGAL_Tests) + cmake_minimum_required(VERSION 3.12...3.31) +file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") +list(SORT pkgs) -if(NOT CGAL_MODULES_DIR) - find_package(CGAL REQUIRED) -endif() -include(${CGAL_MODULES_DIR}/CGALHelpers.cmake) -CGAL_handle_subdirectories(test tests) +message("== Generating build files for tests ==") +foreach(pkg ${pkgs}) + set(pkg_dir ${CMAKE_SOURCE_DIR}/${pkg}) + if(IS_DIRECTORY "${pkg_dir}" AND EXISTS "${pkg_dir}/CMakeLists.txt") + message("\n-- Configuring ${pkg}") + add_subdirectory(${pkg_dir} "${CMAKE_BINARY_DIR}/${pkg}") + endif() +endforeach() +message("== Generating build files for done (DONE) ==") From 5b547309e7be0da2fca48a4eeb9bc15c471effb0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 Jul 2025 07:20:17 +0100 Subject: [PATCH 097/145] Read the right input file in test_triangulation_static_filters_6 --- .../test/Triangulation/test_triangulation_static_filters_6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp index 8a450ad5e84..624ff5c7cdf 100644 --- a/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp +++ b/Triangulation/test/Triangulation/test_triangulation_static_filters_6.cpp @@ -23,7 +23,7 @@ int main() const int D = 6; // we work in Euclidean 6-space std::vector points; - std::ifstream in("data/points.txt"); + std::ifstream in("data/points_6.txt"); Triangulation::Point p; int d; in >> d; From 89c0551c8269efb15a6658459697a54d4dda077c Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 23 Jul 2025 14:29:21 +0200 Subject: [PATCH 098/145] Vector_d == Vector_d implement it document it (also for Point_d) disable < <= > >= --- Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h | 38 +++++++++++++++++ Kernel_d/doc/Kernel_d/CGAL/Epick_d.h | 42 +++++++++++++++++++ .../CGAL/NewKernel_d/Wrapper/Point_d.h | 6 +++ .../CGAL/NewKernel_d/Wrapper/Vector_d.h | 13 ++++++ .../NewKernel_d/function_objects_cartesian.h | 30 +++++++++++++ .../include/CGAL/NewKernel_d/functor_tags.h | 1 + NewKernel_d/test/NewKernel_d/Epick_d.cpp | 2 + 7 files changed, 132 insertions(+) diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h index b59b2f8560d..af63a8781c6 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epeck_d.h @@ -89,6 +89,44 @@ double operator[](int i)const; Cartesian_const_iterator_d cartesian_begin()const; /*! returns an iterator pointing beyond the last %Cartesian coordinate. */ Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the points coincide. */ +friend bool operator==(Point_d,Point_d); +/*! returns whether the points are distinct. */ +friend bool operator!=(Point_d,Point_d); +}; + +/*! +represents a vector in the Euclidean space +\cgalModels{DefaultConstructible,Assignable} +*/ +class Vector_d { +public: +/*! introduces a vector with coordinates (x0, x1, ...) where the number of + coordinates matches the dimension. + \pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */ +Vector_d(double x0, double x1, ...); + +/*! introduces a vector with coordinate set `[first,end)`. + \pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`. + \tparam ForwardIterator has its value type that is convertible to `double`. + */ +template +Vector_d(ForwardIterator first, ForwardIterator end); + +/*! returns the i-th coordinate of a vector. + \pre `i` is non-negative and less than the dimension. */ +double operator[](int i)const; + +/*! returns an iterator pointing to the zeroth %Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_begin()const; +/*! returns an iterator pointing beyond the last %Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the vectors coincide. */ +friend bool operator==(Vector_d,Vector_d); +/*! returns whether the vectors are distinct. */ +friend bool operator!=(Vector_d,Vector_d); }; /*! diff --git a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h index deb7043c4fc..61cd6153cdf 100644 --- a/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h +++ b/Kernel_d/doc/Kernel_d/CGAL/Epick_d.h @@ -77,6 +77,48 @@ double operator[](int i)const; Cartesian_const_iterator_d cartesian_begin()const; /*! returns an iterator pointing beyond the last Cartesian coordinate. */ Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the points coincide. This may not be safe + if the points are the result of inexact constructions. */ +friend bool operator==(Point_d,Point_d); +/*! returns whether the points are distinct. This may not be safe + if the points are the result of inexact constructions. */ +friend bool operator!=(Point_d,Point_d); +}; + +/*! +represents a vector in the Euclidean space +\cgalModels{DefaultConstructible,Assignable} +*/ +class Vector_d { +public: +/*! introduces a vector with coordinates (x0, x1, ...) where the number of + coordinates matches the dimension. + \pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */ +Vector_d(double x0, double x1, ...); + +/*! introduces a vector with coordinate set `[first,end)`. + \pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`. + \tparam InputIterator has its value type that is convertible to `double`. + */ +template +Vector_d(InputIterator first, InputIterator end); + +/*! returns the i-th coordinate of a vector. + \pre `i` is non-negative and less than the dimension. */ +double operator[](int i)const; + +/*! returns an iterator pointing to the zeroth Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_begin()const; +/*! returns an iterator pointing beyond the last Cartesian coordinate. */ +Cartesian_const_iterator_d cartesian_end()const; + +/*! returns whether the vectors coincide. This may not be safe + if the vectors are the result of inexact constructions. */ +friend bool operator==(Vector_d,Vector_d); +/*! returns whether the vectors are distinct. This may not be safe + if the vectors are the result of inexact constructions. */ +friend bool operator!=(Vector_d,Vector_d); }; /*! diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index af2d970f3f2..33287420f01 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -137,6 +137,12 @@ public: friend auto operator!=(Point_d const&p, Point_d const&q) { return !(p==q); } + // May be accidentally inherited from the base class otherwise + friend auto operator< (Point_d const&p, Point_d const&q) = delete; + friend auto operator> (Point_d const&p, Point_d const&q) = delete; + friend auto operator<=(Point_d const&p, Point_d const&q) = delete; + friend auto operator>=(Point_d const&p, Point_d const&q) = delete; + friend std::ostream& operator <<(std::ostream& os, const Point_d& p) { auto b = p.cartesian_begin(); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h index 1b150be0aae..1a1aa56896e 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h @@ -130,6 +130,19 @@ public: return SLBase()(rep()); } + friend auto operator==(Vector_d const&p, Vector_d const&q) { + typedef typename Get_functor::type EPBase; + return EPBase()(p.rep(), q.rep()); + } + + friend auto operator!=(Vector_d const&p, Vector_d const&q) { return !(p==q); } + + // May be accidentally inherited from the base class otherwise + friend auto operator< (Vector_d const&p, Vector_d const&q) = delete; + friend auto operator> (Vector_d const&p, Vector_d const&q) = delete; + friend auto operator<=(Vector_d const&p, Vector_d const&q) = delete; + friend auto operator>=(Vector_d const&p, Vector_d const&q) = delete; + friend std::ostream& operator <<(std::ostream& os, const Vector_d& v) { auto b = v.cartesian_begin(); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h index 4fbf2441276..74252ce22a1 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h @@ -1279,6 +1279,36 @@ template struct Equal_points : private Store_kernel { CGAL_KD_DEFAULT_FUNCTOR(Equal_points_tag,(CartesianDKernelFunctors::Equal_points),(),(Construct_ttag)); +namespace CartesianDKernelFunctors { +template struct Equal_vectors : private Store_kernel { + CGAL_FUNCTOR_INIT_STORE(Equal_vectors) + typedef R_ R; + typedef typename Get_type::type result_type; + typedef typename Get_functor >::type CI; + // TODO: This is_exact thing should be reengineered. + // the goal is to have a way to tell: don't filter this + typedef typename CGAL::Uses_no_arithmetic Uses_no_arithmetic; + + template + result_type operator()(V const&a, W const&b)const{ + CI c(this->kernel()); + + + auto a_begin=c(a,Begin_tag()); + auto b_begin=c(b,Begin_tag()); + auto a_end=c(a,End_tag()); + + result_type res = true; + // Is using CGAL::possibly for Uncertain really an optimization? + do res = res & (*a_begin++ == *b_begin++); + while(a_begin!=a_end && possibly(res)); + return res; + } +}; +} + +CGAL_KD_DEFAULT_FUNCTOR(Equal_vectors_tag,(CartesianDKernelFunctors::Equal_vectors),(),(Construct_ttag)); + namespace CartesianDKernelFunctors { template struct Oriented_side : private Store_kernel { CGAL_FUNCTOR_INIT_STORE(Oriented_side) diff --git a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h index 927b51fcb35..934d6102a61 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/functor_tags.h @@ -282,6 +282,7 @@ namespace CGAL { CGAL_DECL_PREDICATE(Less_lexicographically); CGAL_DECL_PREDICATE(Less_or_equal_lexicographically); CGAL_DECL_PREDICATE(Equal_points); + CGAL_DECL_PREDICATE(Equal_vectors); CGAL_DECL_PREDICATE(Has_on_positive_side); CGAL_DECL_PREDICATE_(Orientation); // duplicate with the type CGAL_DECL_PREDICATE_(Oriented_side); // duplicate with the type diff --git a/NewKernel_d/test/NewKernel_d/Epick_d.cpp b/NewKernel_d/test/NewKernel_d/Epick_d.cpp index 7daa52459e5..a0344fb75bd 100644 --- a/NewKernel_d/test/NewKernel_d/Epick_d.cpp +++ b/NewKernel_d/test/NewKernel_d/Epick_d.cpp @@ -277,6 +277,7 @@ void test2(){ P x4=cp(0,0); P x5=cp(0,-1); P tab2[]={x1,x2,x3,x4}; + assert(x1==x1 && x1!=x2); assert(dp(x1,x2)[1]==2); assert(po(tab2+0,tab2+3)==CGAL::COUNTERCLOCKWISE); assert(sos(tab2+0,tab2+3,x4)==CGAL::ON_POSITIVE_SIDE); @@ -285,6 +286,7 @@ void test2(){ assert(y1.squared_length()==2); assert(sl(y1)==2); V y2=cv(3,-3); + assert(y1==y1 && y1!=y2); assert(spr(y1,y2)==6); assert(dv(y2,y1)[0]==2); V tab3[]={y1,y2}; 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 099/145] 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 37262f5f7ed8cc8ff40561340df5ad3f045db8ff Mon Sep 17 00:00:00 2001 From: lvalque Date: Mon, 28 Jul 2025 15:08:14 +0200 Subject: [PATCH 100/145] include of small_vector.hpp was missing --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index fef7060e1d9..38b4314e95c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -25,6 +25,7 @@ #include #include +#include #include #include From 1b830ee23c6d1754f59d3dd1e95d802e43b9833e Mon Sep 17 00:00:00 2001 From: lvalque <131978677+LeoValque@users.noreply.github.com> Date: Mon, 28 Jul 2025 16:44:29 +0200 Subject: [PATCH 101/145] Apply suggestions from code review Co-authored-by: Andreas Fabri --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index fef7060e1d9..9e84545e5af 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -447,7 +447,7 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits Date: Mon, 28 Jul 2025 17:51:16 +0200 Subject: [PATCH 102/145] Update Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp Co-authored-by: Andreas Fabri --- .../test/Polygon_mesh_processing/slow_compute_normal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp index 3b14b3f72d1..70d9e73fc39 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/slow_compute_normal.cpp @@ -18,7 +18,7 @@ typedef boost::graph_traits::face_descriptor face_descriptor; namespace PMP = CGAL::Polygon_mesh_processing; -int main(int argc, char* argv[]) +int main() { const std::string filename = "./data/slow_compute_normal.off"; From d0a7b6748b8501b78dcf6b41516f4e449dd06a43 Mon Sep 17 00:00:00 2001 From: lvalque Date: Tue, 29 Jul 2025 17:00:39 +0200 Subject: [PATCH 103/145] remove unused functor --- .../include/CGAL/Polygon_mesh_processing/compute_normal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index d75da2f6f41..22c77a23e70 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -409,7 +409,6 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits::reference Vector_ref; typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object(); - typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object(); typename GT::Construct_cross_product_vector_3 cp_3 = traits.construct_cross_product_vector_3_object(); std::vector incident_faces; From 748fa237da99b937d5e21724ecd724147d93652b Mon Sep 17 00:00:00 2001 From: lvalque Date: Wed, 30 Jul 2025 11:37:43 +0200 Subject: [PATCH 104/145] replace boost::small_vector by std::array --- .../Polygon_mesh_processing/compute_normal.h | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index 22c77a23e70..7492c34eeef 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -430,9 +429,10 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits circum_points; - circum_points.push_back(incident_faces[0]); - circum_points.push_back(incident_faces[1]); + std::array circum_points; + short int circum_points_size=2; + circum_points[0]=incident_faces[0]; + circum_points[1]=incident_faces[1]; // Get the farthest point from circum_points[0] const Vector_ref n0 = get(face_normals, circum_points[0]); @@ -455,10 +455,10 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits sp_3(center_ni_nj, ni2)){ - circum_points.pop_back(); + circum_points_size=2; } else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2)){ std::swap(circum_points[1],circum_points[2]); - circum_points.pop_back(); + circum_points_size=2; } else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2)){ std::swap(circum_points[0],circum_points[2]); - circum_points.pop_back(); + circum_points_size=2; } } } From 4b9ca293c7bc2bca240915fac385ec7527b3215d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 4 Aug 2025 10:20:25 +0200 Subject: [PATCH 105/145] main will now target 6.2 --- Installation/include/CGAL/version.h | 6 +++--- Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h index 1ec57af9015..02e637c7fad 100644 --- a/Installation/include/CGAL/version.h +++ b/Installation/include/CGAL/version.h @@ -17,12 +17,12 @@ #define CGAL_VERSION_H #ifndef SWIG -#define CGAL_VERSION 6.1-beta2 +#define CGAL_VERSION 6.2-dev #define CGAL_GIT_HASH abcdef #endif -#define CGAL_VERSION_NR 1060100920 +#define CGAL_VERSION_NR 1060200900 #define CGAL_SVN_REVISION 99999 -#define CGAL_RELEASE_DATE 20250701 +#define CGAL_RELEASE_DATE 20260401 #include diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index a5a71ac0458..bcc4c96fb78 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -1,8 +1,8 @@ set(CGAL_MAJOR_VERSION 6) -set(CGAL_MINOR_VERSION 1) +set(CGAL_MINOR_VERSION 2) set(CGAL_BUGFIX_VERSION 0) include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake) -set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1-beta2") +set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.2-dev") set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}") if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) From 2ec7520d9677cd312dbfafd07d4afc1b7962e38e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Aug 2025 15:36:01 +0100 Subject: [PATCH 106/145] BGL: Add Face_around_face_circulator --- BGL/include/CGAL/boost/graph/iterator.h | 49 ++++++++++++++++++++++++- BGL/test/BGL/test_circulator.cpp | 10 +++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index cef4a913cad..e26d7892cbd 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -871,7 +871,54 @@ private: */ template class Face_around_face_circulator -{}; +#ifndef DOXYGEN_RUNNING + : public boost::iterator_adaptor< + Face_around_face_circulator // Derived + , Halfedge_around_face_circulator // Base + , typename boost::graph_traits::face_descriptor // Value + , Bidirectional_circulator_tag // CategoryOrTraversal + , typename boost::graph_traits::face_descriptor // Reference + > +#endif +{ + internal::Opposite_face fct; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + +public: +#ifndef DOXYGEN_RUNNING + typedef std::size_t size_type; +#endif + + Face_around_face_circulator() + {} + + Face_around_face_circulator(halfedge_descriptor h, const Graph& g) + : Face_around_face_circulator::iterator_adaptor_(Halfedge_around_face_circulator(h,g)), fct(g) + {} + +#ifndef DOXYGEN_RUNNING + + explicit operator bool() const + { + return (! (this->base_reference() == nullptr)); + } + + bool operator== (void*) const + { + return this->base_reference()== nullptr; + } + + bool operator!= (void*) const + { + return this->base_reference()!= nullptr; + } + +private: + friend class boost::iterator_core_access; + typename boost::graph_traits::face_descriptor dereference() const { return fct(*this->base_reference()); } +#endif + +}; /** * \ingroup PkgBGLIterators diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index cd0a18cbbe4..58c56bbd6df 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -18,6 +18,7 @@ typedef GraphTraits::edge_descriptor edge_descriptor; typedef GraphTraits::out_edge_iterator out_edge_iterator; typedef GraphTraits::in_edge_iterator in_edge_iterator; +typedef CGAL::Face_around_face_circulator face_around_face_circulator; typedef CGAL::Halfedge_around_face_circulator halfedge_around_face_circulator; typedef CGAL::Halfedge_around_target_circulator halfedge_around_target_circulator; typedef CGAL::Vertex_around_target_circulator vertex_around_target_circulator; @@ -32,6 +33,7 @@ typedef CGAL::Vertex_around_target_iterator vertex_around_target_ite int main(int argc, char* argv[]) { + BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); @@ -62,6 +64,14 @@ int main(int argc, char* argv[]) }while(hafc != done); } + { + face_around_face_circulator fafc(hd,P), done(fafc); + + do { + ++fafc; + }while(fafc != done); + } + { halfedge_around_target_circulator havc(hd,P), done(havc); vertex_descriptor vd = target(hd,P); From edd1868f50a4dcd698780c6b23e4a35139833844 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 5 Aug 2025 16:13:44 +0100 Subject: [PATCH 107/145] CGAL: Remove some deprecated functions --- BGL/doc/BGL/PackageDescription.txt | 3 +- BGL/include/CGAL/boost/graph/IO/OFF.h | 54 --------------------------- BGL/include/CGAL/boost/graph/IO/VTK.h | 13 ------- BGL/include/CGAL/boost/graph/IO/WRL.h | 13 ------- 4 files changed, 1 insertion(+), 82 deletions(-) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 68a57a60d14..395584b1b30 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -509,8 +509,7 @@ the requirement for traversal of all faces in a graph. /// I/O Functions for the \ref IOStream3MF /// \ingroup PkgBGLIOFct -/// \defgroup PkgBGLIOFctDeprecated I/O Functions (Deprecated) -/// \ingroup PkgBGLIOFct + /*! \addtogroup PkgBGLPropertiesDynamic diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h index 25f76b2b1d6..441b088597a 100644 --- a/BGL/include/CGAL/boost/graph/IO/OFF.h +++ b/BGL/include/CGAL/boost/graph/IO/OFF.h @@ -247,36 +247,7 @@ bool read_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, g, np); -} - -/*! -\ingroup PkgBGLIOFctDeprecated - -\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(fname, g, np); -} -template -CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g) -{ - return read_off(fname.c_str(), g, parameters::default_values()); -} - -#endif // CGAL_NO_DEPRECATED_CODE //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -453,31 +424,6 @@ bool write_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, g, np); -} - -/*! -\ingroup PkgBGLIOFctDeprecated - -\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(fname, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/IO/VTK.h b/BGL/include/CGAL/boost/graph/IO/VTK.h index 931c744765e..cfc33c2b867 100644 --- a/BGL/include/CGAL/boost/graph/IO/VTK.h +++ b/BGL/include/CGAL/boost/graph/IO/VTK.h @@ -529,20 +529,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_VTP(os, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/BGL/include/CGAL/boost/graph/IO/WRL.h b/BGL/include/CGAL/boost/graph/IO/WRL.h index b92429a193b..b2179a8907c 100644 --- a/BGL/include/CGAL/boost/graph/IO/WRL.h +++ b/BGL/include/CGAL/boost/graph/IO/WRL.h @@ -111,20 +111,7 @@ bool write_WRL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgBGLIOFctDeprecated - - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_WRL(os, g, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL From 91193bf866fd0f2d9c56fba347ffab7cf0568448 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Aug 2025 07:41:11 +0100 Subject: [PATCH 108/145] In Point_set_processing --- .../include/CGAL/IO/read_las_points.h | 85 --------- .../include/CGAL/IO/read_off_points.h | 168 ------------------ .../include/CGAL/IO/read_ply_points.h | 108 ----------- .../include/CGAL/IO/read_xyz_points.h | 167 ----------------- .../include/CGAL/IO/write_las_points.h | 53 ------ .../include/CGAL/IO/write_off_points.h | 101 ----------- .../include/CGAL/IO/write_ply_points.h | 74 -------- .../include/CGAL/IO/write_xyz_points.h | 100 ----------- 8 files changed, 856 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index c1dc8453fc9..258a580160c 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -547,91 +547,6 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -using IO::make_las_point_reader; -namespace LAS_property = IO::LAS_property; - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code") -bool read_las_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_las_points(is, output, CGAL::parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code") -bool read_las_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_las_points::type>(is, output, - CGAL::parameters::point_map(point_map)); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, - OutputIterator output, - PropertyHandler&& ... properties) -{ - return IO::read_LAS_with_properties(is, output, std::forward(properties)...); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, - OutputIterator output, - PropertyHandler&& ... properties) -{ - return IO::read_LAS_with_properties::type>(is, output, std::forward(properties)...); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_las_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - using parameters::choose_parameter; - using parameters::get_parameter; - - typename CGAL::GetPointMap, CGAL_NP_CLASS>::type point_map = - choose_parameter, CGAL_NP_CLASS>::type>(get_parameter(np, internal_np::point_map)); - - return IO::read_LAS(is, output, make_las_point_reader(point_map)); -} - -/// \cond SKIP_IN_MANUAL - - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_LAS::type>(is, output, np); -} - -/// \endcond - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index e193661dffd..cd752f463c7 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -271,174 +271,6 @@ bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - return IO::read_OFF(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code") -bool read_off_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_OFF::type>(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return read_off_points(is, output, parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return read_off_points::type>(is, output, - parameters::point_map(point_map) - .geom_traits (kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_off_points(is, output, parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code") -bool read_off_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return read_off_points::type>(is, output, parameters::point_map(point_map)); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, output, np); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output) -{ - return IO::read_OFF(is, output); -} - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, output, np); -} - -/// \endcond - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index f49e6ba1f2c..69775af74d0 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -358,114 +358,6 @@ bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY::type>(is, output, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code") -bool read_ply_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_PLY::type>(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code") -bool read_ply_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_PLY(is, output, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code") -bool read_ply_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_PLY::type>(is, output, parameters::point_map(point_map)); -} - -/// \endcond - -template -CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) -{ - return IO::read_PLY_with_properties(is, output, std::forward(properties)...); -} - - -template -CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_PLY(is, output, np); -} - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) -{ - return IO::read_PLY_with_properties::type>(is, output, std::forward(properties)...); -} - -// variant with default output iterator value type -template -CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_PLY::type>(is, output, np); -} - -/// \endcond - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #undef TRY_TO_GENERATE_POINT_PROPERTY diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 5dd9fa8678f..ddf772be51b 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -251,173 +251,6 @@ bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLA -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ(is, output, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code") -bool read_xyz_points_and_normals(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) ///< geometric traits. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_XYZ(is, output, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code") -bool read_xyz_points(std::istream& is, ///< input stream. - OutputIterator output, ///< output iterator over points. - PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - return IO::read_XYZ::type>(is, output, - parameters::point_map(point_map)); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool read_xyz_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_XYZ(is, output, np); -} - -/// \cond SKIP_IN_MANUAL -template -CGAL_DEPRECATED bool read_xyz_points(std::istream& is, - OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_XYZ::type>(is, output, np); -} -/// \endcond - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index f3a96c919fd..94ff12182ff 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -379,59 +379,6 @@ bool write_LAS(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -using IO::make_las_point_writer; - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code") -bool write_las_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_LAS(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code") -bool write_las_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_LAS(os, points); -} - -/// \endcond - -template -CGAL_DEPRECATED bool write_las_points_with_properties(std::ostream& os, - const PointRange& points, - std::tuple point_property, - PropertyHandler&& ... properties) -{ - return IO::write_LAS_with_properties(os, points, point_property, std::forward(properties)...); -} - - -template -bool write_las_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_LAS(os, points, np); -} - -#endif //CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index e99a2c90bce..0ef9d0bbcc7 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -198,107 +198,6 @@ bool write_OFF(const std::string& filename, } // IO namespace -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - CGAL::parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code") -bool write_off_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, parameters::normal_map (normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - const Kernel&) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, - parameters::point_map(point_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points, parameters::point_map (point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code") -bool write_off_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points(first, beyond); - return write_off_points(os, points); -} - -/// \endcond - -template -CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 0ddbb70d613..bdc9c8077e0 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -298,80 +298,6 @@ bool write_PLY(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code") -bool write_ply_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_PLY(os, points, parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code") -bool write_ply_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_PLY(os, points, parameters::normal_map (normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code") -bool write_ply_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_PLY(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code") -bool write_ply_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_PLY(os, points); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool write_ply_points_with_properties(std::ostream& os, ///< output stream. - const PointRange& points, ///< input point range. - PropertyHandler&& ... properties) ///< parameter pack of property handlers -{ - return IO::write_PLY_with_properties(os, points, std::forward(properties)...); -} - - -template -CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_PLY(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h index 036e060367b..da1c2a402ed 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h @@ -189,106 +189,6 @@ bool write_XYZ(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/// \cond SKIP_IN_MANUAL - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code") -bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - NormalMap normal_map) ///< property map: value_type of ForwardIterator -> Vector_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, parameters::normal_map(normal_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. - const Kernel& kernel) -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points, parameters::point_map(point_map) - .geom_traits (kernel)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond, ///< past-the-end input point. - PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. -{ - CGAL::Iterator_range points(first, beyond); - return IO::write_XYZ(os, points, parameters::point_map(point_map)); -} - -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code") -bool write_xyz_points(std::ostream& os, ///< output stream. - ForwardIterator first, ///< first input point. - ForwardIterator beyond) ///< past-the-end input point. -{ - CGAL::Iterator_range points (first, beyond); - return IO::write_XYZ(os, points); -} - -/// \endcond - - -template -CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_XYZ(os, points, np); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H From 79f93a46dfaf1b1c753aeae8a88059b0f734a73b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Aug 2025 07:51:26 +0100 Subject: [PATCH 109/145] Surface_mesh --- .../include/CGAL/Surface_mesh/IO/3MF.h | 14 ---- .../include/CGAL/Surface_mesh/IO/OFF.h | 48 ------------- .../include/CGAL/Surface_mesh/IO/PLY.h | 39 +---------- Surface_mesh/test/Surface_mesh/CMakeLists.txt | 12 ---- .../Surface_mesh/test_deprecated_io_sm.cpp | 70 ------------------- 5 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h index 227d0c9ec06..dd39a118297 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h @@ -137,20 +137,6 @@ bool read_3MF(const std::string& filename, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_3MF()` should be used instead. -*/ -template -CGAL_DEPRECATED int read_3mf(const std::string& filename, std::vector >& output) -{ - return IO::read_3MF(filename, output); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h index a186d98115a..d28361f08b3 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h @@ -347,30 +347,6 @@ bool read_OFF(const std::string& fname, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::read_OFF(is, sm, np); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(Surface_mesh& sm, const std::string& filename) -{ - return IO::read_OFF(filename, sm, parameters::default_values()); -} -#endif // CGAL_NO_DEPRECATED_CODE - -//////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -549,30 +525,6 @@ bool write_OFF(std::ostream& os, } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh& sm, const CGAL_NP_CLASS& np = parameters::default_values()) -{ - return IO::write_OFF(os, sm, np); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_off(const Surface_mesh& sm, const std::string& filename) -{ - return IO::write_OFF(filename, sm, parameters::default_values()); -} - -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_OFF_H diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 4c91236aada..0f0056a486a 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -169,10 +169,7 @@ public: const std::string& name = property->name(); if(name == "vertex1" || name == "vertex2") return true; -#ifndef CGAL_NO_DEPRECATED_CODE - if(name == "v0" || name == "v1") - return true; -#endif + return false; } @@ -888,21 +885,7 @@ bool read_PLY(std::istream& is, Surface_mesh

    & sm) } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_PLY(std::ostream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh

    & sm, std::string& comments) -{ - return IO::read_PLY(is, sm, comments); -} - -#endif // CGAL_NO_DEPRECATED_CODE - -//////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -1155,26 +1138,6 @@ bool write_PLY(std::ostream& os, const Surface_mesh

    & sm, const CGAL_NP_CLASS& } // namespace IO -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_PLY(std::ostream&, const Surface_mesh&)` should be used instead. -*/ - -template -CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

    & sm, const std::string& comments) -{ - return IO::write_PLY(os, sm, comments); -} - -template -CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

    & sm) -{ - return write_PLY(os, sm, ""); -} -#endif // CGAL_NO_DEPRECATED_CODE - } // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_PLY_H diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 3b516fc15d0..eaf09a942f5 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -15,15 +15,3 @@ foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() -find_path(3MF_INCLUDE_DIR - NAMES Model/COM/NMR_DLLInterfaces.h - DOC "Path to lib3MF headers" - ) -find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library") -if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") - include_directories(${3MF_INCLUDE_DIR}) - target_link_libraries(test_deprecated_io_sm PRIVATE ${3MF_LIBRARIES}) - target_compile_definitions(test_deprecated_io_sm PRIVATE -DCGAL_LINKED_WITH_3MF) -else() - message(STATUS "NOTICE: read_3mf requires the lib3MF library, and will not be tested.") -endif() diff --git a/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp b/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp deleted file mode 100644 index 32930445895..00000000000 --- a/Surface_mesh/test/Surface_mesh/test_deprecated_io_sm.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef CGAL::Surface_mesh SM; - -int main() -{ - // OFF - SM sm_in, sm_out; - Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0); - CGAL::make_triangle(p0, p1, p2, sm_out); - bool ok = CGAL::write_off(sm_out, "tmp.off"); - assert(ok); - ok = CGAL::read_off(sm_in, "tmp.off"); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - - std::ofstream os("tmp.off"); - ok = CGAL::write_off(os, sm_out); - assert(ok); - os.close(); - std::ifstream is("tmp.off"); - ok = CGAL::read_off(is, sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); - - //PLY - os.open("tmp.ply"); - std::string comments; - ok = CGAL::write_ply(os, sm_out, comments); - assert(ok); - os.close(); - is.open("tmp.ply"); - ok = CGAL::read_ply(is, sm_in, comments); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); - -#ifdef CGAL_LINKED_WITH_3MF - // 3mf - std::vector output_3mf; - ok = CGAL::read_3mf("test.3mf", output_3mf); - assert(ok); - assert(output_3mf.size() == 2); - sm_in.clear(); -#endif - - //others - ok = CGAL::write_mesh(sm_out, "tmp.off"); - assert(ok); - ok = CGAL::read_mesh(sm_in, "tmp.ply"); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - return EXIT_SUCCESS; -} From c225dd0c34e6b13787fb15f84b5a45d226b4a61e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Aug 2025 08:22:31 +0100 Subject: [PATCH 110/145] Surface_mesh --- Surface_mesh/include/CGAL/Surface_mesh/IO.h | 29 --------------------- 1 file changed, 29 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO.h b/Surface_mesh/include/CGAL/Surface_mesh/IO.h index 55d6bbd8be8..8e68678dbea 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO.h @@ -22,34 +22,5 @@ #include -#include - -namespace CGAL { - -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_polygon_mesh()` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_mesh(Surface_mesh& sm, const std::string& filename) -{ - return IO::read_polygon_mesh(filename, sm); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_polygon_mesh()` should be used instead. -*/ -template -CGAL_DEPRECATED bool write_mesh(const Surface_mesh& mesh, const std::string& filename) -{ - return IO::write_polygon_mesh(filename, mesh); -} - -#endif // CGAL_NO_DEPRECATED_CODE - -} // namespace CGAL #endif // CGAL_SURFACE_MESH_IO_H From ab99c7de81f065e05ed1d4ed2f9c23a5cabb9501 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 6 Aug 2025 08:27:12 +0100 Subject: [PATCH 111/145] remove deprecated test --- .../Point_set_processing_3/CMakeLists.txt | 1 - .../test_deprecated_io_point_set.cpp | 241 ------------------ 2 files changed, 242 deletions(-) delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index a1582cc1f7e..eac51a4626f 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -22,7 +22,6 @@ endif() # Executables that do *not* require Eigen create_single_source_cgal_program( "read_test.cpp" ) create_single_source_cgal_program( "test_read_write_point_set.cpp" ) -create_single_source_cgal_program( "test_deprecated_io_point_set.cpp" ) create_single_source_cgal_program( "test_poisson_eliminate.cpp" ) create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" ) create_single_source_cgal_program( "analysis_test.cpp" ) diff --git a/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp b/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp deleted file mode 100644 index 35c6e5b0e6f..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/test_deprecated_io_point_set.cpp +++ /dev/null @@ -1,241 +0,0 @@ -#include - -#include - -#include -#include -#include - -// Just to try and create ambiguities -#include -#include - -#include - -#include -#include -#include -#include - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Vector_3 Vector_3; -typedef std::array Color; -typedef std::pair PointWithColor; -typedef CGAL::Nth_of_tuple_property_map<1, PointWithColor> Color_map; - -struct GetRedMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetRedMap&, const PointWithColor& p) -{ - return p.second[0]; -} - -struct GetGreenMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetGreenMap&, const PointWithColor& p) -{ - return p.second[1]; -} - -struct GetBlueMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; -unsigned short get(const GetBlueMap&, const PointWithColor& p) -{ - return p.second[2]; -} - -struct GetAlphaMap -{ - typedef PointWithColor key_type; - typedef unsigned short value_type; - typedef const value_type& reference; - typedef boost::lvalue_property_map_tag category; -}; - -unsigned short get(const GetAlphaMap&, const PointWithColor& p) -{ - return p.second[3]; -} - -int main() -{ - std::vector points(3); - points[0] = std::make_pair(Point_3(1,0,0), Color{255,0,0,255}); - points[1] = std::make_pair(Point_3(0,1,0), Color{0,255,0,255}); - points[2] = std::make_pair(Point_3(0,0,1), Color{0,0,255,255}); - - bool ok; - std::vector ps; - ps.push_back(Point_3(1,0,0)); - ps.push_back(Point_3(0,1,0)); - ps.push_back(Point_3(0,0,1)); - - std::string input; - - //LAS -#ifdef CGAL_LINKED_WITH_LASLIB - - { - std::ostringstream os(std::ios::binary); - ok = CGAL::write_las_points_with_properties(os, points, - CGAL::make_las_point_writer(CGAL::First_of_pair_property_map()), - std::make_pair(GetRedMap(),CGAL::LAS_property::R()), - std::make_pair(GetGreenMap(), CGAL::LAS_property::G()), - std::make_pair(GetBlueMap(), CGAL::LAS_property::B()), - std::make_pair(GetAlphaMap(), CGAL::LAS_property::I()) - ); - assert(ok); - os.flush(); - input = os.str(); - - } - - { - points.clear(); - std::istringstream is(input, std::ios::binary); - ok = CGAL::read_las_points_with_properties(is, std::back_inserter (points), - CGAL::make_las_point_reader(CGAL::First_of_pair_property_map()), - std::make_tuple(CGAL::Second_of_pair_property_map(), - CGAL::Construct_array(), - CGAL::LAS_property::R(), - CGAL::LAS_property::G(), - CGAL::LAS_property::B(), - CGAL::LAS_property::I())); - assert(ok); - assert(points.size() == 3); - assert(points[1].second[1] == 255); - } - - { - std::ostringstream os(std::ios_base::binary); - CGAL::write_las_points(os, ps); - assert(ok); - os.flush(); - input = os.str(); - } - - { - ps.clear(); - std::istringstream is(input, std::ios::binary); - ok = CGAL::read_las_points(is, std::back_inserter (ps)); - assert(ok); - assert(ps.size() == 3); - } -#endif - - //PLY - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_ply_points_with_properties(os, points, - CGAL::make_ply_point_writer (CGAL::First_of_pair_property_map()), - std::make_pair(GetRedMap(),CGAL::PLY_property("red")), - std::make_pair(GetGreenMap(), CGAL::PLY_property("green")), - std::make_pair(GetBlueMap(), CGAL::PLY_property("blue")), - std::make_pair(GetAlphaMap(), CGAL::PLY_property("alpha")) - ); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - points.clear(); - ok = CGAL::read_ply_points_with_properties(is, std::back_inserter (points), - CGAL::make_ply_point_reader(CGAL::First_of_pair_property_map()), - std::make_tuple(CGAL::Second_of_pair_property_map(), - CGAL::Construct_array(), - CGAL::PLY_property("red"), - CGAL::PLY_property("green"), - CGAL::PLY_property("blue"), - CGAL::PLY_property("alpha"))); - assert(! is.fail()); - assert(ok); - assert(points.size() == 3); - assert(points[1].second[1] == 255); - } - - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_ply_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_ply_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - //OFF - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_off_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_off_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - //XYZ - { - std::ostringstream os; - assert(os.good()); - ok = CGAL::write_xyz_points(os, ps); - assert(! os.fail()); - assert(ok); - os.flush(); - input = os.str(); - } - - { - std::istringstream is(input); - assert(is.good()); - ps.clear(); - ok = CGAL::read_xyz_points(is, std::back_inserter (ps)); - assert(! is.fail()); - assert(ok); - assert(ps.size() == 3); - } - - std::cout << "Done" << std::endl; - return EXIT_SUCCESS; -} From d5ed4e0eae553f706996e98c4aefc1ee35b12c63 Mon Sep 17 00:00:00 2001 From: ybellargui Date: Wed, 6 Aug 2025 23:15:41 +0200 Subject: [PATCH 112/145] Update CHANGES.md for function renaming --- Installation/CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index ed6e884697b..5d6b16aa2ed 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -3,6 +3,12 @@ ## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +- **API Changes**: The following import functions have been deprecated and renamed for better naming clarity and consistency: + - `import_from_plane_graph()` → `read_plane_graph_in_lcc()` + - `import_from_polyhedron_3()` → `polyhedron_3_to_lcc()` + - `import_from_triangulation_3()` → `triangulation_3_to_lcc()` +- The old function names are still available but marked as deprecated for backward compatibility. + ### General Changes - The minimal supported version of Boost is now 1.74.0. From 4ef2b0a350ed9c0bb8829dad5a2ee0764a96b251 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Aug 2025 07:05:22 +0100 Subject: [PATCH 113/145] Remove BGL/test/BGL/test_deprecated_io.cpp --- BGL/test/BGL/test_deprecated_io.cpp | 59 ----------------------------- 1 file changed, 59 deletions(-) delete mode 100644 BGL/test/BGL/test_deprecated_io.cpp diff --git a/BGL/test/BGL/test_deprecated_io.cpp b/BGL/test/BGL/test_deprecated_io.cpp deleted file mode 100644 index 8c22b9f17df..00000000000 --- a/BGL/test/BGL/test_deprecated_io.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef CGAL::Surface_mesh SM; - -int main() -{ - // OFF - SM sm_in, sm_out; - Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0); - CGAL::make_triangle(p0, p1, p2, sm_out); - bool ok = CGAL::write_off("tmp_deprecated.off", sm_out); - assert(ok); - ok = CGAL::read_off("tmp_deprecated.off", sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); - - std::ofstream os("tmp_deprecated.off"); - ok = CGAL::write_off(os, sm_out); - assert(ok); - os.close(); - std::ifstream is("tmp_deprecated.off"); - ok = CGAL::read_off(is, sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - is.close(); - sm_in.clear(); -#ifdef CGAL_USE_VTK - //vtk - os.open("tmp_deprecated.vtp"); - ok = CGAL::write_vtp(os, sm_out); - assert(ok); - os.close(); - - ok = CGAL::IO::read_VTP("tmp_deprecated.vtp", sm_in); - assert(ok); - assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); - sm_in.clear(); -#endif - //wrl - os.open("tmp_deprecated.wrl"); - ok = CGAL::write_wrl(os, sm_out); - assert(ok); - os.close(); - return EXIT_SUCCESS; -} From c87a0d8b2946d76ab99ccd2ca4b644e1b7cf858e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Aug 2025 11:03:08 +0100 Subject: [PATCH 114/145] remove deprecated test from CMakeLists.txt --- BGL/test/BGL/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 016e0009d4f..0836b9be77f 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -38,7 +38,6 @@ create_single_source_cgal_program("test_graph_traits.cpp") create_single_source_cgal_program("test_Properties.cpp") create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_faces.cpp") create_single_source_cgal_program("graph_traits_inheritance.cpp" ) -create_single_source_cgal_program("test_deprecated_io.cpp") find_package(OpenMesh QUIET) if(OpenMesh_FOUND) From 5a77ef7ab6b2b4d52456c0383431ec0926c18341 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 7 Aug 2025 11:17:07 +0100 Subject: [PATCH 115/145] remove deprecated test from CMakeLists.txt --- BGL/test/BGL/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 0836b9be77f..6affc9511d8 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -68,8 +68,6 @@ if (VTK_FOUND AND VTK_LIBRARIES) message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES}) target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX) - target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES}) - target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX) else() message(STATUS "Tests that use VTK will not be compiled.") endif() #VTK_FOUND From d8b2a56fe31326df2cc2dabe0a291bcf0576ff16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Aug 2025 14:47:48 +0200 Subject: [PATCH 116/145] fix CHANGES.md --- Installation/CHANGES.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 79fc31f3d65..1a326488c25 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -1,15 +1,21 @@ # Release History -Release date: July 2025 +## [Release 6.2](https://github.com/CGAL/cgal/releases/tag/v6.2) -## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) +Release date: July 2026 + +### [Linear Cell Complex](https://doc.cgal.org/6.2/Manual/packages.html#PkgLinearCellComplex) - **API Changes**: The following import functions have been deprecated and renamed for better naming clarity and consistency: - - `import_from_plane_graph()` → `read_plane_graph_in_lcc()` + - `import_from_plane_graph()` → `read_plane_graph_in_lcc()` - `import_from_polyhedron_3()` → `polyhedron_3_to_lcc()` - `import_from_triangulation_3()` → `triangulation_3_to_lcc()` - The old function names are still available but marked as deprecated for backward compatibility. +## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) + +Release date: July 2025 + ### General Changes - The new list of supported compilers is: From a827db20dba13f1f5c3070af0f7fdce0ac4bc91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Aug 2025 14:54:56 +0200 Subject: [PATCH 117/145] trailing whitespaces --- .../CGAL/Linear_cell_complex_constructors.h | 2 +- .../doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h | 2 +- .../doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h | 4 ++-- .../include/CGAL/Linear_cell_complex_constructors.h | 2 +- .../test/Linear_cell_complex/test_polyhedron_3_alias.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h index 41b6e029142..0fefb1240b1 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Linear_cell_complex_constructors.h @@ -24,7 +24,7 @@ Here a small example: Middle: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure. Right: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure. -\sa `CGAL::triangulation_3_to_lcc` +\sa `CGAL::triangulation_3_to_lcc` \sa `CGAL::polyhedron_3_to_lcc` */ template diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h index 88660898143..5983ebfc73e 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Polyhedron_3_to_lcc.h @@ -5,7 +5,7 @@ namespace CGAL{ Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import. \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::read_plane_graph_in_lcc` +\sa `CGAL::read_plane_graph_in_lcc` \sa `CGAL::triangulation_3_to_lcc` */ template diff --git a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h index 4234cc98cab..c1ab3172a09 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h +++ b/Linear_cell_complex/doc/Linear_cell_complex/CGAL/Triangulation_3_to_lcc.h @@ -8,8 +8,8 @@ Objects are added in `lcc`, existing darts are not modified. Returns a dart crea \pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3. -\sa `CGAL::read_plane_graph_in_lcc` -\sa `CGAL::polyhedron_3_to_lcc` +\sa `CGAL::read_plane_graph_in_lcc` +\sa `CGAL::polyhedron_3_to_lcc` */ template diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 547870729cf..20e83a6ce05 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -235,7 +235,7 @@ CGAL_DEPRECATED typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc, const char* filename) { - return read_plane_graph_in_lcc(alcc, filename); + return read_plane_graph_in_lcc(alcc, filename); } #endif diff --git a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp index 506fcedfdf0..183aac6e0be 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp +++ b/Linear_cell_complex/test/Linear_cell_complex/test_polyhedron_3_alias.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,10 +20,10 @@ int main() LCC lcc1, lcc2; - auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); + auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P); assert(d1 == LCC::null_descriptor); - auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); + auto d2 = CGAL::import_from_polyhedron_3(lcc2, P); assert(d2 == LCC::null_descriptor); #endif // CGAL_NO_DEPRECATED_CODE return EXIT_SUCCESS; From 84ece78f82f8a1787738bd46552dd4b55de61cd9 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 8 Aug 2025 11:41:36 +0200 Subject: [PATCH 118/145] Lab plugin to open .spheres.txt files with a list of spheres --- Lab/demo/Lab/Plugins/IO/CMakeLists.txt | 3 + Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp | 162 ++++++++++++++++++ Lab/demo/Lab/Scene_spheres_item.cpp | 43 ++++- Lab/demo/Lab/Scene_spheres_item.h | 8 +- Lab/demo/Lab/resources/shader_spheres.vert | 6 +- 5 files changed, 214 insertions(+), 8 deletions(-) create mode 100644 Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp diff --git a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt index dbdad76da22..1bb9cf3338b 100644 --- a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt @@ -35,6 +35,9 @@ target_link_libraries(off_to_nef_plugin PRIVATE scene_nef_polyhedron_item) cgal_lab_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS Viewer Mesh_3) target_link_libraries(polylines_io_plugin PRIVATE scene_polylines_item) +cgal_lab_plugin(spheres_io_plugin Spheres_io_plugin KEYWORDS Viewer Mesh_3) +target_link_libraries(spheres_io_plugin PRIVATE scene_basic_objects) + cgal_lab_plugin(wkt_plugin WKT_io_plugin KEYWORDS Viewer PointSetProcessing Mesh_3) target_link_libraries(wkt_plugin PRIVATE scene_polylines_item) diff --git a/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp new file mode 100644 index 00000000000..43a7cb0b5f8 --- /dev/null +++ b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp @@ -0,0 +1,162 @@ +#include "Scene_spheres_item.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace CGAL::Three; + +class CGAL_Lab_spheres_io_plugin : + public QObject, + public CGAL_Lab_io_plugin_interface, + public CGAL_Lab_plugin_helper +{ + Q_OBJECT + Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface CGAL::Three::CGAL_Lab_io_plugin_interface) + Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0" FILE "spheres_io_plugin.json") + Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.IOPluginInterface/1.90") + +public: + // To silent a warning -Woverloaded-virtual + // See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings + + using CGAL_Lab_io_plugin_interface::init; + //! Configures the widget + void init(QMainWindow* mainWindow, + CGAL::Three::Scene_interface* scene_interface, + Messages_interface*) override{ + //get the references + this->scene = scene_interface; + this->mw = mainWindow; + + } + QString name() const override{ return "spheres_io_plugin"; } + QString nameFilters() const override{ return "Spheres files (*.spheres.txt)"; } + bool canLoad(QFileInfo fileinfo) const override; + QList load(QFileInfo fileinfo, bool& ok, bool add_to_scene=true) override; + + bool canSave(const CGAL::Three::Scene_item*) override; + bool save(QFileInfo fileinfo,QList&) override; + bool applicable(QAction* a) const override { + return false; + } + QList actions() const override{ + + return QList(); + } + + bool isDefaultLoader(const Scene_item* item) const override{ + if(qobject_cast(item)) + return true; + return false; + } +}; + +bool CGAL_Lab_spheres_io_plugin::canLoad(QFileInfo fileinfo) const{ + if(!fileinfo.suffix().contains("cgal")) + return true; + std::ifstream in(fileinfo.filePath().toUtf8()); + if(!in) { + return false; + } + int first; + if(!(in >> first) + || first <= 0) + return false; + return true; +} + + +QList +CGAL_Lab_spheres_io_plugin:: +load(QFileInfo fileinfo, bool& ok, bool add_to_scene){ + + // Open file + std::ifstream ifs(fileinfo.filePath().toUtf8()); + if(!ifs) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + ok = false; + return QList(); + } + + if(fileinfo.size() == 0) + { + CGAL::Three::Three::warning( tr("The file you are trying to load is empty.")); + Scene_spheres_item* item = new Scene_spheres_item(nullptr, 0, false, false); + item->setName(fileinfo.completeBaseName()); + ok = true; + if(add_to_scene) + CGAL::Three::Three::scene()->addItem(item); + return QList()< > spheres; + while (ifs >> x && ifs >> y && ifs >> z && ifs >> r) + spheres.push_back({x, y, z, r}); + + std::vector colors; + if (true) { + colors.resize(spheres.size()); + for (QColor &c : colors) + c = generate_random_color(); + } + else { + colors.reserve(spheres.size()); + compute_deterministic_color_map(QColor(180, 120, 130, 255), spheres.size(), std::back_inserter(colors)); + } + + Scene_spheres_item* item = new Scene_spheres_item(nullptr, spheres.size(), false, true); + item->setName(fileinfo.completeBaseName()); + + for (std::size_t i = 0;i& s = spheres[i]; + item->add_sphere(CGAL::Epick::Sphere_3(CGAL::Epick::Point_3(s[0], s[1], s[2]), s[3] * s[3]), i, CGAL::IO::Color(colors[i].red(), colors[i].green(), colors[i].blue())); + } + + std::cerr << "Number of spheres loaded: " << spheres.size() << std::endl; + + item->invalidateOpenGLBuffers(); + + item->setRenderingMode(Gouraud); + CGAL::Three::Three::scene()->addItem(item); + item->computeElements(); + + return QList()<(item) != 0; +} + +bool CGAL_Lab_spheres_io_plugin:: +save(QFileInfo fileinfo,QList& items) +{ + Scene_item* item = items.front(); + const Scene_spheres_item* sphere_item = + qobject_cast(item); + + if(!sphere_item) + return false; + + std::ofstream out(fileinfo.filePath().toUtf8()); + + out.precision (std::numeric_limits::digits10 + 2); + + if(!out) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + return false; + } + + return false; +} + +#include "Spheres_io_plugin.moc" diff --git a/Lab/demo/Lab/Scene_spheres_item.cpp b/Lab/demo/Lab/Scene_spheres_item.cpp index fac56fbda9b..6afc47a14e6 100644 --- a/Lab/demo/Lab/Scene_spheres_item.cpp +++ b/Lab/demo/Lab/Scene_spheres_item.cpp @@ -2,7 +2,9 @@ #include #include #include +#include #include +#include using namespace CGAL::Three; @@ -43,9 +45,7 @@ struct Scene_spheres_item_priv model_sphere_is_up = false; } - ~Scene_spheres_item_priv() - { - } + ~Scene_spheres_item_priv() {} void pick(int &id)const; @@ -85,6 +85,15 @@ void Scene_spheres_item_priv::pick(int& id) const id = -1; } + if (id != -1 && spheres[id].size() == 1) { + const Sphere& sphere = spheres[id][0].first; + Three::information(QString("Selected sphere: center (%1, %2, %3) radius %4"). + arg(sphere.center().x(), 0, 'g', 10). + arg(sphere.center().y(), 0, 'g', 10). + arg(sphere.center().z(), 0, 'g', 10). + arg(CGAL::approximate_sqrt(sphere.squared_radius()), 0, 'g', 10)); + } + int offset = 0; float color[4]; for(std::size_t i=0; isetAlpha(alpha()); getTriangleContainer(0)->draw(viewer, false); } if(d->pickable && (d->spheres.size() > 1 && viewer->inDrawWithNames())) @@ -218,6 +233,9 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const void Scene_spheres_item::drawEdges(Viewer_interface *viewer) const { + if (renderingMode() != Wireframe || !visible()) + return; + if(!isInit(viewer)) initGL(viewer); if ( getBuffersFilled() && @@ -295,6 +313,23 @@ void Scene_spheres_item::invalidateOpenGLBuffers() getTriangleContainer(1)->reset_vbos(COLORS); } getEdgeContainer(0)->reset_vbos(NOT_INSTANCED); + compute_bbox(); +} + +QMenu* Scene_spheres_item::contextMenu() { + QMenu* menu = Scene_item_rendering_helper::contextMenu(); + + if (!connected_alpha_slider && alphaSlider() != nullptr) { + connect(alphaSlider(), &QSlider::valueChanged, [this]() {redraw(); }); + connected_alpha_slider = true; + } + + return menu; +} + +float Scene_spheres_item::alpha() const +{ + return Scene_item_rendering_helper::alpha(); } QString diff --git a/Lab/demo/Lab/Scene_spheres_item.h b/Lab/demo/Lab/Scene_spheres_item.h index dd365a16ac2..2944a7f5d5f 100644 --- a/Lab/demo/Lab/Scene_spheres_item.h +++ b/Lab/demo/Lab/Scene_spheres_item.h @@ -2,6 +2,7 @@ #define SCENE_SPHERES_ITEM_H #include "Scene_basic_objects_config.h" #include "create_sphere.h" +#include "Color_map.h" #include #include @@ -24,7 +25,7 @@ struct Scene_spheres_item_priv; * have a Scene_spheres_item child). */ class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item - : public CGAL::Three::Scene_item_rendering_helper + : public CGAL::Three::Scene_group_item { Q_OBJECT public: @@ -37,6 +38,7 @@ public: ~Scene_spheres_item(); + Bbox bbox() const override { return _bbox; } bool isFinite() const override{ return true; } bool isEmpty() const override{ return false; } Scene_item* clone() const override{return nullptr;} @@ -57,10 +59,13 @@ public: void setColor(QColor c) override; bool save(const std::string &file_name) const; + QMenu *contextMenu() override; + float alpha() const override; void initializeBuffers(Viewer_interface *) const override; void computeElements() const override; bool eventFilter(QObject *watched, QEvent *event)override; + Q_SIGNALS: void on_color_changed(); void picked(std::size_t id) const; @@ -68,6 +73,7 @@ Q_SIGNALS: protected: friend struct Scene_spheres_item_priv; Scene_spheres_item_priv* d; + bool connected_alpha_slider; }; #endif // SCENE_SPHERES_ITEM_H diff --git a/Lab/demo/Lab/resources/shader_spheres.vert b/Lab/demo/Lab/resources/shader_spheres.vert index 68b0babf8a0..c6778a1288b 100644 --- a/Lab/demo/Lab/resources/shader_spheres.vert +++ b/Lab/demo/Lab/resources/shader_spheres.vert @@ -1,7 +1,7 @@ #version 150 in vec4 vertex; in vec3 normals; -in vec3 colors; +in vec4 colors; in vec3 center; in float radius; uniform mat4 mvp_matrix; @@ -19,7 +19,7 @@ void main(void) gl_PointSize = point_size; for(int i=0; i<6; ++i) dist[i] = 1.0; - color = vec4(colors, 1.0); + color = colors; vec4 transformed_vertex = vec4(radius*vertex.x + center.x, radius* vertex.y + center.y, radius*vertex.z + center.z, 1.0); fP = mv_matrix * transformed_vertex; @@ -27,6 +27,6 @@ void main(void) norm_matrix_3[0] = norm_matrix[0].xyz; norm_matrix_3[1] = norm_matrix[1].xyz; norm_matrix_3[2] = norm_matrix[2].xyz; - fN = norm_matrix_3* normals; + fN = norm_matrix_3 * normals; gl_Position = mvp_matrix * f_matrix * transformed_vertex; } From 90f6b74bf4799bcdbf27c46a19de2db08be00f73 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 8 Aug 2025 12:01:12 +0200 Subject: [PATCH 119/145] revert changes to shader_spheres.vert removing unused function --- Lab/demo/Lab/Scene_spheres_item.cpp | 5 ----- Lab/demo/Lab/Scene_spheres_item.h | 1 - Lab/demo/Lab/resources/shader_spheres.vert | 6 +++--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Lab/demo/Lab/Scene_spheres_item.cpp b/Lab/demo/Lab/Scene_spheres_item.cpp index 6afc47a14e6..d65da606030 100644 --- a/Lab/demo/Lab/Scene_spheres_item.cpp +++ b/Lab/demo/Lab/Scene_spheres_item.cpp @@ -327,11 +327,6 @@ QMenu* Scene_spheres_item::contextMenu() { return menu; } -float Scene_spheres_item::alpha() const -{ - return Scene_item_rendering_helper::alpha(); -} - QString Scene_spheres_item::toolTip() const { return d->tooltip; diff --git a/Lab/demo/Lab/Scene_spheres_item.h b/Lab/demo/Lab/Scene_spheres_item.h index 2944a7f5d5f..23ae7fe541f 100644 --- a/Lab/demo/Lab/Scene_spheres_item.h +++ b/Lab/demo/Lab/Scene_spheres_item.h @@ -60,7 +60,6 @@ public: bool save(const std::string &file_name) const; QMenu *contextMenu() override; - float alpha() const override; void initializeBuffers(Viewer_interface *) const override; void computeElements() const override; diff --git a/Lab/demo/Lab/resources/shader_spheres.vert b/Lab/demo/Lab/resources/shader_spheres.vert index c6778a1288b..68b0babf8a0 100644 --- a/Lab/demo/Lab/resources/shader_spheres.vert +++ b/Lab/demo/Lab/resources/shader_spheres.vert @@ -1,7 +1,7 @@ #version 150 in vec4 vertex; in vec3 normals; -in vec4 colors; +in vec3 colors; in vec3 center; in float radius; uniform mat4 mvp_matrix; @@ -19,7 +19,7 @@ void main(void) gl_PointSize = point_size; for(int i=0; i<6; ++i) dist[i] = 1.0; - color = colors; + color = vec4(colors, 1.0); vec4 transformed_vertex = vec4(radius*vertex.x + center.x, radius* vertex.y + center.y, radius*vertex.z + center.z, 1.0); fP = mv_matrix * transformed_vertex; @@ -27,6 +27,6 @@ void main(void) norm_matrix_3[0] = norm_matrix[0].xyz; norm_matrix_3[1] = norm_matrix[1].xyz; norm_matrix_3[2] = norm_matrix[2].xyz; - fN = norm_matrix_3 * normals; + fN = norm_matrix_3* normals; gl_Position = mvp_matrix * f_matrix * transformed_vertex; } From add575c35815b4b3b32a80409c034a860fc92daf Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 11 Aug 2025 10:17:15 +0100 Subject: [PATCH 120/145] cleanup of CMakeLists.txt --- .../test/Point_set_processing_3/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index eac51a4626f..f05160e32fc 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -38,7 +38,6 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910 include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_read_write_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support) - target_link_libraries(test_deprecated_io_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support) else() message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.") endif() From 589c5d59a539abb8ea6c865ed7938f41debabea4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 12 Aug 2025 07:24:20 +0100 Subject: [PATCH 121/145] cleanup in Polyhedron_3 --- .../doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h index 671dd6f49f8..45f33b220b5 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h @@ -34,13 +34,6 @@ polyhedral surface. template bool read_OFF( std::istream& in, CGAL::Polyhedron_3& P); -/*! -\deprecated This function is deprecated since \cgal 5.3, - \ref read_OFF(std::istream&, Polyhedron_3&) should be used instead. -*/ -template -bool read_off( std::istream& in, CGAL::Polyhedron_3& P); - } // namespace IO /*! @@ -79,12 +72,6 @@ This function overloads the generic function \link PkgBGLIoFuncsOFF `write_OFF(s template bool write_OFF( std::ostream& out, const CGAL::Polyhedron_3& P); -/*! -\deprecated This function is deprecated since \cgal 5.3, - \ref CGAL::IO::write_OFF(std::ostream&, const Polyhedron_3&) should be used instead. -*/ -template -bool write_off( std::ostream& out, const CGAL::Polyhedron_3& P); } // namespace IO From ae6ffd5e0978dfd36b690493fb393e00c3a5e652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 20 Aug 2025 15:51:33 +0200 Subject: [PATCH 122/145] use EPICK and Side_of_triangle_mesh --- Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp b/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp index e3df0223e50..936d4fcd3f7 100644 --- a/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp +++ b/Lab/demo/Lab/Plugins/AABB_tree/Cut_plugin.cpp @@ -22,8 +22,8 @@ #include #include #include -//#include -#include +#include +#include #include @@ -60,7 +60,7 @@ typedef Edge_container Ec; typedef Triangle_container Tc; typedef Viewer_interface Vi; -typedef CGAL::Simple_cartesian Simple_kernel; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Simple_kernel; typedef Simple_kernel::FT FT; typedef Simple_kernel::Point_3 Point; typedef std::pair Point_distance; @@ -81,24 +81,25 @@ Simple_kernel::Vector_3 random_vector() return Simple_kernel::Vector_3(x,y,z); } +template< typename Mesh> +struct PPMAP; //functor for tbb parallelization -template +template class FillGridSize { std::size_t grid_size; Point_distance (&distance_function)[100][100]; FT diag; FT& max_distance_function; std::vector&sm_trees; - bool is_signed; CGAL::qglviewer::ManipulatedFrame* frame; public: FillGridSize(std::size_t grid_size, FT diag, Point_distance (&distance_function)[100][100], FT& max_distance_function, std::vector& sm_trees, - bool is_signed, CGAL::qglviewer::ManipulatedFrame* frame) + CGAL::qglviewer::ManipulatedFrame* frame) : grid_size(grid_size), distance_function (distance_function), diag(diag), max_distance_function(max_distance_function), - sm_trees(sm_trees), is_signed(is_signed), frame(frame) + sm_trees(sm_trees), frame(frame) { } template @@ -137,7 +138,7 @@ public: max_distance_function = (std::max)(min, max_distance_function); - if(is_signed) + if constexpr (is_signed) { if(!min_sm_tree) { @@ -145,17 +146,12 @@ public: max_distance_function = DBL_MAX;//(std::max)(min, max_distance_function); continue; } - typedef typename SM_Tree::size_type size_type; - Simple_kernel::Vector_3 random_vec = random_vector(); + CGAL::Side_of_triangle_mesh, SM_Tree> side_of(*min_sm_tree); const Simple_kernel::Point_3& p = distance_function[i][j].first; const FT unsigned_distance = distance_function[i][j].second; - // get sign through ray casting (random vector) - Simple_kernel::Ray_3 ray(p, random_vec); - size_type nbi = min_sm_tree->number_of_intersected_primitives(ray); - - FT sign ( (nbi&1) == 0 ? 1 : -1); + FT sign ( side_of(p)==CGAL::ON_UNBOUNDED_SIDE ? 1 : -1); distance_function[i][j].second = sign * unsigned_distance; } } @@ -191,9 +187,7 @@ public: GLubyte* getData(){return data; } }; -typedef CGAL::Simple_cartesian Simple_kernel; -//typedef CGAL::Exact_predicates_inexact_constructions_kernel Simple_kernel; template< typename Mesh> struct PPMAP { @@ -390,8 +384,8 @@ private: mutable Simple_kernel::FT m_max_distance_function; mutable std::vector tex_map; mutable Cut_planes_types m_cut_plane; - template - void compute_distance_function(QMap *sm_trees, bool is_signed = false)const + template + void compute_distance_function(QMap *sm_trees)const { m_max_distance_function = FT(0); @@ -402,11 +396,11 @@ private: if(!(is_signed && !CGAL::is_closed(*qobject_cast(sm_trees->key(sm_tree))->polyhedron()))) closed_sm_trees.push_back(sm_tree); #ifndef CGAL_LINKED_WITH_TBB - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, frame); HackRange range(0, static_cast(m_grid_size*m_grid_size)); f(range); #else - FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, is_signed, frame); + FillGridSize f(m_grid_size, diag, m_distance_function, m_max_distance_function, closed_sm_trees, frame); tbb::parallel_for(tbb::blocked_range(0, m_grid_size*m_grid_size), f); #endif } @@ -459,7 +453,7 @@ private: break; case SIGNED_FACETS: if (!facet_sm_trees || facet_sm_trees->empty() ) { return; } - compute_distance_function( facet_sm_trees, true); + compute_distance_function( facet_sm_trees); break; case UNSIGNED_EDGES: From 74cf183ba2b49cd749a3522b9a362efc30f410e7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 21 Aug 2025 06:06:38 +0100 Subject: [PATCH 123/145] Adress warning --- Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp index 43a7cb0b5f8..976e436d38e 100644 --- a/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp +++ b/Lab/demo/Lab/Plugins/IO/Spheres_io_plugin.cpp @@ -44,7 +44,7 @@ public: bool canSave(const CGAL::Three::Scene_item*) override; bool save(QFileInfo fileinfo,QList&) override; - bool applicable(QAction* a) const override { + bool applicable(QAction* ) const override { return false; } QList actions() const override{ From 8efdbff89959bb343082eefcdfbedad1bd308d09 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 24 Aug 2025 13:31:04 +0200 Subject: [PATCH 124/145] Overnight documentation build missing links The overnight doxygen build gave warnings like: ``` .../Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt:108: warning: unable to resolve link to '::import_from_triangulation_3' for \link command .../Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt:109: warning: unable to resolve link to '::import_from_polyhedron_3' for \link command .../Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt:112: warning: unable to resolve link to '::import_from_plane_graph' for \link command ``` when building against the doxygen master due to the fact that doxygen was a bit more stringent Added the namespace to the links (also tested against doxygen 1.9.6 after the changes). --- .../doc/Linear_cell_complex/Linear_cell_complex.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt index d58e0f6e2e5..96f2ee051b5 100644 --- a/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt +++ b/Linear_cell_complex/doc/Linear_cell_complex/Linear_cell_complex.txt @@ -105,11 +105,11 @@ There are several member functions allowing to insert specific configurations of There are two functions allowing to build a linear cell complex from two other \cgal data types:

      -
    • \link ::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; -
    • \link ::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`. +
    • \link CGAL::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink; +
    • \link CGAL::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
    -Lastly, the function \link ::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::import_from_plane_graph `reference manual`\endlink for the file format). +Lastly, the function \link CGAL::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::import_from_plane_graph `reference manual`\endlink for the file format). \subsection Linear_cell_complexModificationOperations Modification Operations \anchor ssecmodifop From a027377f093d27f16da31f5d618e82d7fa810eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 5 Aug 2025 21:15:51 +0200 Subject: [PATCH 125/145] fix the handling of non-simply connected faces in the output for now we always triangulate such faces --- .../CGAL/Polygon_mesh_processing/clip.h | 256 ++++++++++++++++-- 1 file changed, 226 insertions(+), 30 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 36c5d029fce..9dbaed1f4d8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -45,10 +45,227 @@ #include +#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION +#include +#include +#include +#include +#include +#include +#include +#endif + namespace CGAL { namespace Polygon_mesh_processing { namespace internal { +#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION +template +void close_and_triangulate(TriangleMesh& tm, VertexPointMap vpm, typename Traits::Vector_3 plane_normal, Visitor& visitor) +{ + using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + using face_descriptor = typename boost::graph_traits::face_descriptor; + using P_traits = Projection_traits_3; + using Vb = Triangulation_vertex_base_with_info_2; + using Fb = CGAL::Delaunay_mesh_face_base_2; + using TDS = Triangulation_data_structure_2; + using Itag = No_constraint_intersection_tag; + using CDT = Constrained_Delaunay_triangulation_2; + + P_traits p_traits(plane_normal); + + std::vector> points; + std::vector> csts; + + halfedge_descriptor href = boost::graph_traits::null_halfedge (); + bool first=true; + + for (halfedge_descriptor h : halfedges(tm)) + { + if (is_border(h, tm)) + { + if (first) + { + href=h; + first=false; + } + vertex_descriptor src = source(h, tm), tgt = target(h, tm); + points.emplace_back(get(vpm, tgt), tgt); + csts.emplace_back(src, tgt); + } + } + + if (points.empty()) return; + + CDT cdt(p_traits); + cdt.insert(points.begin(), points.end()); + + // TODO: in case of degenerate edges, we don't triangulate but it's kind of an issue on our side + if (cdt.number_of_vertices()!=points.size()) return; + + + typedef CGAL::dynamic_vertex_property_t V_tag; + typename boost::property_map::type v2v = get(V_tag(), tm); + for (auto vh : cdt.finite_vertex_handles()) + put(v2v, vh->info(), vh); + + for (auto vv : csts) + cdt.insert_constraint(get(v2v, vv.first), get(v2v, vv.second)); + + mark_domain_in_triangulation(cdt); + + typename CDT::Edge edge_ref; + CGAL_assertion_code(bool OK =) + cdt.is_edge(get(v2v, csts[0].first), get(v2v, csts[0].second), edge_ref.first, edge_ref.second); + CGAL_assertion(OK); + + if (!edge_ref.first->is_in_domain()) edge_ref = cdt.mirror_edge(edge_ref); + CGAL_assertion(edge_ref.first->is_in_domain()); + + bool flip_ori = ( edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() != source(href, tm) ); + + CGAL_assertion( + ( !flip_ori && + edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() == source(href, tm) && + edge_ref.first->vertex( (edge_ref.second+2)%3 )->info() == target(href, tm) ) + || + ( flip_ori && + edge_ref.first->vertex( (edge_ref.second+2)%3 )->info() == source(href, tm) && + edge_ref.first->vertex( (edge_ref.second+1)%3 )->info() == target(href, tm) ) + ); + + for (auto fh : cdt.finite_face_handles()) + { + if (!fh->is_in_domain()) continue; + + std::array vrts = make_array(fh->vertex(0)->info(), + fh->vertex(1)->info(), + fh->vertex(2)->info()); + if (flip_ori) std::swap(vrts[0], vrts[1]); + + CGAL_assertion(Euler::can_add_face(vrts, tm)); + visitor.before_face_copy(boost::graph_traits::null_face(), tm, tm); + face_descriptor f = Euler::add_face(vrts, tm); + visitor.after_face_copy(boost::graph_traits::null_face(), tm, f, tm); + } +} + +template +bool close(PolygonMesh& pm, VertexPointMap vpm, typename Traits::Vector_3 plane_normal, Visitor& visitor) +{ + //using vertex_descriptor = typename boost::graph_traits::vertex_descriptor; + using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; + // using face_descriptor = typename boost::graph_traits::face_descriptor; + using Point_3 = typename Traits::Point_3; + using P_traits = Projection_traits_3; + + std::vector< std::vector > polygons; + std::vector< halfedge_descriptor > border_cycles; + std::vector< Bbox_3 > bboxes; + + typedef CGAL::dynamic_halfedge_property_t H_tag; + typename boost::property_map::type + is_hedge_selected = get(H_tag(), pm, false); + + for (halfedge_descriptor h : halfedges(pm)) + { + if (is_border(h, pm) && get(is_hedge_selected, h)==false) + { + border_cycles.push_back(h); + polygons.emplace_back(); + bboxes.emplace_back(); + for (halfedge_descriptor he : CGAL::halfedges_around_face(h, pm)) + { + put(is_hedge_selected, he, true); + polygons.back().push_back(get(vpm, target(he, pm))); + bboxes.back()+=polygons.back().back().bbox(); + } + } + } + + if (bboxes.empty()) return true; + + Bbox_3 gbox; + for (const Bbox_3& bb : bboxes) + gbox+=bb; + + // arrange polygons + int axis = 0; + if ((gbox.ymax()-gbox.ymin()) > (gbox.xmax()-gbox.xmin())) axis=1; + if ((gbox.zmax()-gbox.zmin()) > (gbox.max(axis)-gbox.min(axis))) axis=2; + + std::vector poly_ids(polygons.size()); + std::iota(poly_ids.begin(), poly_ids.end(), 0); + + std::sort(poly_ids.begin(), poly_ids.end(), + [&bboxes, axis](std::size_t i, std::size_t j) + { + return bboxes[i].min(axis) < bboxes[j].min(axis); + }); + + + std::vector simply_connected_faces; + std::vector handled(poly_ids.size(), false); + + P_traits ptraits(plane_normal); + + + for (std::size_t pid=0; pid nested; + for (std::size_t npid=pid+1; npid::null_face(), pm, pm); + Euler::fill_hole(h, pm); + visitor.after_face_copy(boost::graph_traits::null_face(), pm, face(h, pm), pm); + } + + return simply_connected_faces.size()==poly_ids.size(); +} + +#endif + + template @@ -791,7 +1008,7 @@ bool clip(PolygonMesh& pm, Default_visitor default_visitor; using Visitor_ref = typename internal_np::Lookup_named_param_def::reference; Visitor_ref visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor); - constexpr bool has_visitor = !std::is_same_v>>; + // constexpr bool has_visitor = !std::is_same_v>>; typedef typename internal_np::Lookup_named_param_def < internal_np::concurrency_tag_t, @@ -834,6 +1051,8 @@ bool clip(PolygonMesh& pm, if (clip_volume && !is_closed(pm)) clip_volume=false; if (clip_volume && !use_compact_clipper) use_compact_clipper=true; + CGAL_precondition(!clip_volume || !triangulate || does_bound_a_volume(pm)); + auto fcc = get(dynamic_face_property_t(), pm); std::size_t nbcc = connected_components(pm, fcc, CGAL::parameters::edge_is_constrained_map(ecm)); @@ -865,35 +1084,12 @@ bool clip(PolygonMesh& pm, if (clip_volume) { - std::vector borders; - extract_boundary_cycles(pm, std::back_inserter(borders)); - - for (halfedge_descriptor h : borders) - { -#ifndef CGAL_PLANE_CLIP_DO_NOT_USE_TRIANGULATION - if (triangulate) - { - Euler::fill_hole(h, pm); // visitor call done in the triangulation visitor - if constexpr (!has_visitor) - { - triangulate_face(face(h,pm), pm, parameters::vertex_point_map(vpm).geom_traits(traits)); - } - else - { - using Base_visitor = std::remove_cv_t>; - internal::Visitor_wrapper_for_triangulate_face visitor_wrapper(pm, visitor); - triangulate_face(face(h,pm), pm, parameters::vertex_point_map(vpm).geom_traits(traits).visitor(visitor_wrapper)); - } - } - else -#endif - { - visitor.before_face_copy(boost::graph_traits::null_face(), pm, pm); - Euler::fill_hole(h, pm); - visitor.after_face_copy(boost::graph_traits::null_face(), pm, face(h, pm), pm); - } - - } + //TODO: add in the traits construct_orthogonal_vector + if (triangulate) + internal::close_and_triangulate(pm, vpm, plane.orthogonal_vector(), visitor); + else + if (!internal::close(pm, vpm, plane.orthogonal_vector(), visitor)) + internal::close_and_triangulate(pm, vpm, plane.orthogonal_vector(), visitor); } return true; From 96e67f304850b08f0056a1e4de3b09665bce031d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 27 Aug 2025 20:49:34 +0200 Subject: [PATCH 126/145] change to Triangulation_2 license --- Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h | 2 +- Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h index 5601684ed22..8912e372171 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h @@ -13,7 +13,7 @@ #ifndef CGAL_DELAUNAY_FACE_BASE_2_H #define CGAL_DELAUNAY_FACE_BASE_2_H -#include +#include #include diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h index 0c62a20fb5c..b463ad2c154 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h @@ -13,7 +13,7 @@ #ifndef CGAL_DELAUNAY_VERTEX_BASE_2_H #define CGAL_DELAUNAY_VERTEX_BASE_2_H -#include +#include #include From c2f14177e54ab43807221dfe362f6a22d2fd8309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Aug 2025 09:17:57 +0200 Subject: [PATCH 127/145] add new tests --- .../Polygon_mesh_processing/test_pmp_clip.cpp | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp index 5ffe16c9108..bf9f752144c 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_clip.cpp @@ -555,6 +555,49 @@ void test() PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); assert(vertices(tm1).size()==176); } + + // non-simply connected output faces + { + TriangleMesh tm1; + + CGAL::make_hexahedron(CGAL::Bbox_3(-3.5,-0.5,-0.5, -2.5,0.5,0.5), tm1); + PMP::reverse_face_orientations(tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-4,-1,-1, -2,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,-1,-1, 1,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,-1,-1, 4,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,-1,-1, 7,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,2,-1, 1,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,2,-1, 4,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,2,-1, 7,4,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-1,5,-1, 1,7,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(2,5,-1, 4,7,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(5,5,-1, 7,7,1), tm1); + + PMP::clip(tm1, K::Plane_3(0,0,1,0), CGAL::parameters::do_not_triangulate_faces(true).clip_volume(true)); + + assert(vertices(tm1).size()==88); + assert(faces(tm1).size()==72); + } + { + TriangleMesh tm1; + + CGAL::make_hexahedron(CGAL::Bbox_3(-1,-1,-1, 1,1,1), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-3,-3,-3, 3,3,3), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-5,-5,-5, 5,5,5), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-7,-7,-7, 7,7,7), tm1); + PMP::reverse_face_orientations(tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-0.5,-0.5,-0.5, 0.5,0.5,0.5), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-2,-2,-2, 2,2,2), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-4,-4,-4, 4,4,4), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-6,-6,-6, 6,6,6), tm1); + CGAL::make_hexahedron(CGAL::Bbox_3(-8,-8,-8, 8,8,8), tm1); + + PMP::clip(tm1, K::Plane_3(0,0,1,0), CGAL::parameters::do_not_triangulate_faces(true).clip_volume(true)); + assert(vertices(tm1).size()==72); + assert(faces(tm1).size()==79); + } + + } template From f6bfc3bf960eed953f4f5de6c15c6f0924d9964e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Aug 2025 10:50:09 +0200 Subject: [PATCH 128/145] update license --- .../CGAL/Constrained_Delaunay_triangulation_face_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h index fe4d4fd9869..77b0fac6238 100644 --- a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h +++ b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h @@ -14,7 +14,7 @@ #ifndef CGAL_CONSTRAINED_DELAUNAY_TRIANGULATION_FACE_BASE_2_H #define CGAL_CONSTRAINED_DELAUNAY_TRIANGULATION_FACE_BASE_2_H -#include +#include #include From 478dab85c1ed2b200a2856b17da9c41c6d3272d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Aug 2025 09:55:15 +0200 Subject: [PATCH 129/145] macro protection --- .../include/CGAL/Polygon_mesh_processing/clip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 9dbaed1f4d8..43b2cc24fb9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -199,7 +199,7 @@ bool close(PolygonMesh& pm, VertexPointMap vpm, typename Traits::Vector_3 plane_ // arrange polygons int axis = 0; if ((gbox.ymax()-gbox.ymin()) > (gbox.xmax()-gbox.xmin())) axis=1; - if ((gbox.zmax()-gbox.zmin()) > (gbox.max(axis)-gbox.min(axis))) axis=2; + if ((gbox.zmax()-gbox.zmin()) > ((gbox.max)(axis)-(gbox.min)(axis))) axis=2; std::vector poly_ids(polygons.size()); std::iota(poly_ids.begin(), poly_ids.end(), 0); From c0de2cf4a2f4863d433e3dd78b404ab73e04b0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Aug 2025 09:55:55 +0200 Subject: [PATCH 130/145] move to T2 try fixing CI --- .../include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h | 0 .../include/CGAL/Delaunay_mesh_face_base_2.h | 0 .../include/CGAL/Delaunay_mesh_vertex_base_2.h | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {Mesh_2 => Triangulation_2}/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h (100%) rename {Mesh_2 => Triangulation_2}/include/CGAL/Delaunay_mesh_face_base_2.h (100%) rename {Mesh_2 => Triangulation_2}/include/CGAL/Delaunay_mesh_vertex_base_2.h (100%) diff --git a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h similarity index 100% rename from Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h rename to Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h b/Triangulation_2/include/CGAL/Delaunay_mesh_face_base_2.h similarity index 100% rename from Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h rename to Triangulation_2/include/CGAL/Delaunay_mesh_face_base_2.h diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h b/Triangulation_2/include/CGAL/Delaunay_mesh_vertex_base_2.h similarity index 100% rename from Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h rename to Triangulation_2/include/CGAL/Delaunay_mesh_vertex_base_2.h From 46294c0b7a85ed91561cb2f9543e1f47582419a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Aug 2025 10:28:48 +0200 Subject: [PATCH 131/145] CI... --- Mesh_2/package_info/Mesh_2/dependencies | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_2/package_info/Mesh_2/dependencies b/Mesh_2/package_info/Mesh_2/dependencies index 8e839394994..debbfb4bc39 100644 --- a/Mesh_2/package_info/Mesh_2/dependencies +++ b/Mesh_2/package_info/Mesh_2/dependencies @@ -12,5 +12,4 @@ Number_types Profiling_tools STL_Extension Stream_support -TDS_2 Triangulation_2 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 132/145] 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 ca869de99380c28311eecc9fc4a3bffe6aac8330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 2 Sep 2025 14:17:59 +0200 Subject: [PATCH 133/145] more macro protections for MSVC --- .../include/CGAL/Polygon_mesh_processing/clip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 43b2cc24fb9..79e449530ee 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -207,7 +207,7 @@ bool close(PolygonMesh& pm, VertexPointMap vpm, typename Traits::Vector_3 plane_ std::sort(poly_ids.begin(), poly_ids.end(), [&bboxes, axis](std::size_t i, std::size_t j) { - return bboxes[i].min(axis) < bboxes[j].min(axis); + return (bboxes[i].min)(axis) < (bboxes[j].min)(axis); }); From 80fd398478c3066a202ae184b4fff1d8302338a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Sep 2025 16:03:11 +0200 Subject: [PATCH 134/145] hide warning messages that are too verbose --- CGAL_Core/include/CGAL/CORE/Config.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CGAL_Core/include/CGAL/CORE/Config.h b/CGAL_Core/include/CGAL/CORE/Config.h index 9f49a7f5986..36a342a5f73 100644 --- a/CGAL_Core/include/CGAL/CORE/Config.h +++ b/CGAL_Core/include/CGAL/CORE/Config.h @@ -29,12 +29,10 @@ #include -#ifdef CGAL_TEST_SUITE -// disabled for the testsuite to avoid `w` -#define CGAL_CORE_warning_msg(X ,Y) -// if (!(X)) CGAL_error_msg(Y) -#else +#ifdef CGAL_CORE_DEBUG #define CGAL_CORE_warning_msg(X ,Y) CGAL_warning_msg(X ,Y) +#else +#define CGAL_CORE_warning_msg(X ,Y) #endif From 37f90189970e9803ddafab00fbf14875bd8fcbba Mon Sep 17 00:00:00 2001 From: lvalque Date: Thu, 21 Aug 2025 19:01:39 +0200 Subject: [PATCH 135/145] 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 136/145] 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; } From a816c119bbfc3c7be192df084055f3dfb484cdb6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 4 Sep 2025 12:06:19 +0200 Subject: [PATCH 137/145] Spelling correction Spelling correction --- .../test/Surface_mesh_approximation/vsa_metric_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp index 74e63634183..94f8dfcfd3f 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp @@ -102,7 +102,7 @@ int main() } // create compact metric approximation algorithm instance - std::cout << "create compact vas instance" << std::endl; + std::cout << "create compact vsa instance" << std::endl; Compact_metric_point_proxy error_metric(center_pmap, area_pmap); Compact_approx approx(mesh, vpmap, error_metric); From 9d24e4d446b8be054c355003a87d3f2a0a3ce121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 8 Sep 2025 09:40:47 +0200 Subject: [PATCH 138/145] left over from RS removal --- Installation/CMakeLists.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 2aba88233d3..5eb6bc64231 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -970,19 +970,6 @@ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt6_3RD_PARTY_DEFINITIONS} \ ${CGAL_DEFINITIONS}" -std=c++17) message("COMPILATION OPTIONS ARE : ${compile_options}") - if(NOT RS_FOUND AND NOT RS3_FOUND) - set(compile_options - "${compile_options} \ --DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \ --DCGAL_ALGEBRAIC_KERNEL_RS_GMPQ_D_1=1") - message(STATUS "Skip RS headers \"CGAL/Algebraic_kernel_rs_gmpq_d_1.h\" \ -and \"CGAL/Algebraic_kernel_rs_gmpz_d_1.h\" because RS_FOUND is false.") - else() - set(compile_options - "${compile_options} \ --DCGAL_USE_MPFI=1 \ --DCGAL_USE_RS=1") - endif() if(NOT OpenMesh_FOUND) set(compile_options "${compile_options} \ @@ -1163,16 +1150,12 @@ LEDA_FOUND is false.") CMD UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} -H \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" - # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it - # depends on RS. ) # CMD2 is CMD without the -H option separate_arguments( CMD2 UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" - # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it - # depends on RS. ) set(chk_header_name ${CGAL_BINARY_DIR}/package_info/${package}/check_headers/check_${header2} From 5cb75b0aa5684bd23bb631bc11e324e888179fc7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 5 Sep 2025 20:51:16 +0200 Subject: [PATCH 139/145] fix a CMake warning --- Installation/demo/CMakeLists.txt | 3 +-- Installation/examples/CMakeLists.txt | 3 +-- Installation/test/CMakeLists.txt | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 011b436cc53..9bf4e2e9e0e 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,6 +1,5 @@ -project(CGAL_Demos) - cmake_minimum_required(VERSION 3.12...3.31) +project(CGAL_Demos) file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") list(SORT pkgs) diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index 9fc6ac0858b..f96a030628d 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,6 +1,5 @@ -project(CGAL_Examples) - cmake_minimum_required(VERSION 3.12...3.31) +project(CGAL_Examples) file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") list(SORT pkgs) diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index e8e81f0c032..183796527e1 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,6 +1,5 @@ -project(CGAL_Tests) - cmake_minimum_required(VERSION 3.12...3.31) +project(CGAL_Tests) file(GLOB pkgs RELATIVE ${CMAKE_SOURCE_DIR} "*") list(SORT pkgs) From 766be48f1be41874a8944d7c8d96a66af59434e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 9 Sep 2025 20:11:25 +0200 Subject: [PATCH 140/145] add missing protection --- Number_types/include/CGAL/FPU.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Number_types/include/CGAL/FPU.h b/Number_types/include/CGAL/FPU.h index 927c2d4e29e..d8fab44501b 100644 --- a/Number_types/include/CGAL/FPU.h +++ b/Number_types/include/CGAL/FPU.h @@ -628,7 +628,9 @@ inline double IA_sqrt_toward_zero(double d) { } //namespace CGAL #ifdef CGAL_HEADER_ONLY +#ifndef CGAL_DISABLE_ROUNDING_MATH_CHECK #include +#endif #endif // CGAL_HEADER_ONLY #endif // CGAL_FPU_H From fdbbb776bc5b84e8ed8055e7995a51a79fc9d672 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 10 Sep 2025 16:08:52 +0200 Subject: [PATCH 141/145] disable Check_FPU_rounding_mode_is_restored on demand --- Number_types/include/CGAL/test_FPU_rounding_mode_impl.h | 2 ++ Number_types/test/Number_types/Interval_nt_new.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h index 0107cc32b1a..60efe1be2c6 100644 --- a/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h +++ b/Number_types/include/CGAL/test_FPU_rounding_mode_impl.h @@ -51,11 +51,13 @@ get_static_check_fpu_rounding_mode_is_restored() return check_fpu_rounding_mode_is_restored; } +#ifndef CGAL_DISABLE_ROUNDING_MATH_CHECK namespace { CGAL_UNUSED const Check_FPU_rounding_mode_is_restored & check_fpu_rounding_mode_is_restored = get_static_check_fpu_rounding_mode_is_restored(); } +#endif #else diff --git a/Number_types/test/Number_types/Interval_nt_new.cpp b/Number_types/test/Number_types/Interval_nt_new.cpp index 0b4e7b06495..8bb553a4076 100644 --- a/Number_types/test/Number_types/Interval_nt_new.cpp +++ b/Number_types/test/Number_types/Interval_nt_new.cpp @@ -1,3 +1,4 @@ +#define CGAL_DISABLE_ROUNDING_MATH_CHECK 1 #include #include #include From 78cca37c62e3c31a29d710842eacc0b0e07d235b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 17 Sep 2025 07:10:17 +0200 Subject: [PATCH 142/145] update menu for new releases --- Documentation/doc/resources/1.14.0/menu_version.js | 6 +++--- Documentation/doc/resources/1.8.13/menu_version.js | 6 +++--- Documentation/doc/resources/1.9.6/menu_version.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/doc/resources/1.14.0/menu_version.js b/Documentation/doc/resources/1.14.0/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.14.0/menu_version.js +++ b/Documentation/doc/resources/1.14.0/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', diff --git a/Documentation/doc/resources/1.8.13/menu_version.js b/Documentation/doc/resources/1.8.13/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.8.13/menu_version.js +++ b/Documentation/doc/resources/1.8.13/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', diff --git a/Documentation/doc/resources/1.9.6/menu_version.js b/Documentation/doc/resources/1.9.6/menu_version.js index 0c2ca745205..5a33e8c8f23 100644 --- a/Documentation/doc/resources/1.9.6/menu_version.js +++ b/Documentation/doc/resources/1.9.6/menu_version.js @@ -6,10 +6,10 @@ var current_version_local = 'master' var all_versions = [ 'master', - '6.1-beta1', - '6.0.1', + '6.1-beta2', + '6.0.2', 'latest', - '5.6.2', + '5.6.3', '5.5.5', '5.4.5', '5.3.2', From 50050e34c41518acc7e4c9400cfce8b375fef535 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 17 Sep 2025 15:43:31 +0200 Subject: [PATCH 143/145] add option --clobber to re-upload assets --- Maintenance/public_release/scripts/github-release-upload | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Maintenance/public_release/scripts/github-release-upload b/Maintenance/public_release/scripts/github-release-upload index 8a253f112bd..02d0311ee5e 100755 --- a/Maintenance/public_release/scripts/github-release-upload +++ b/Maintenance/public_release/scripts/github-release-upload @@ -6,5 +6,5 @@ release=${${PWD:t}/CGAL-/} tag=v${release} -gh release upload "$tag" *.(zip|xz|txt|exe) -R CGAL/cgal -gh release upload "$tag" CGAL-${release}-win64-auxiliary-libraries-gmp-mpfr.zip'#GMP and MPFR libraries, for Windows 64bits' -R CGAL/cgal --clobber +gh release upload --clobber "$tag" *.(zip|xz|txt|exe) -R CGAL/cgal +gh release upload --clobber "$tag" CGAL-${release}-win64-auxiliary-libraries-gmp-mpfr.zip'#GMP and MPFR libraries, for Windows 64bits' -R CGAL/cgal --clobber From dd51daea5e460ad4a1d38699b8cc4c31c1df5380 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 18 Sep 2025 10:53:49 +0200 Subject: [PATCH 144/145] next version on this branch will be 6.0.3 --- Installation/include/CGAL/version.h | 4 ++-- Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h index ec6776d9cf6..58b711cd6e0 100644 --- a/Installation/include/CGAL/version.h +++ b/Installation/include/CGAL/version.h @@ -17,10 +17,10 @@ #define CGAL_VERSION_H #ifndef SWIG -#define CGAL_VERSION 6.0.2 +#define CGAL_VERSION 6.0.3 #define CGAL_GIT_HASH abcdef #endif -#define CGAL_VERSION_NR 1060021000 +#define CGAL_VERSION_NR 1060031000 #define CGAL_SVN_REVISION 99999 #define CGAL_RELEASE_DATE 20240925 diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index b53e55af179..7a7f6600986 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -1,8 +1,8 @@ set(CGAL_MAJOR_VERSION 6) set(CGAL_MINOR_VERSION 0) -set(CGAL_BUGFIX_VERSION 2) +set(CGAL_BUGFIX_VERSION 3) include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake) -set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.0.2") +set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.0.3") set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}") if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) From 269fd76b5ab4684aee734dec58d248b7a2721f76 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 18 Sep 2025 09:05:34 +0200 Subject: [PATCH 145/145] this branch now prepares 6.1 final version --- Installation/CHANGES.md | 2 +- Installation/include/CGAL/version.h | 6 +++--- Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 0e4c2098e5e..a76d2e106d2 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -2,7 +2,7 @@ ## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1) -Release date: July 2025 +Release date: Sept 2025 ### General Changes diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h index 1ec57af9015..499c8c1f74c 100644 --- a/Installation/include/CGAL/version.h +++ b/Installation/include/CGAL/version.h @@ -17,12 +17,12 @@ #define CGAL_VERSION_H #ifndef SWIG -#define CGAL_VERSION 6.1-beta2 +#define CGAL_VERSION 6.1 #define CGAL_GIT_HASH abcdef #endif -#define CGAL_VERSION_NR 1060100920 +#define CGAL_VERSION_NR 1060100930 #define CGAL_SVN_REVISION 99999 -#define CGAL_RELEASE_DATE 20250701 +#define CGAL_RELEASE_DATE 20250901 #include diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index a5a71ac0458..10098c9d43a 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -2,7 +2,7 @@ set(CGAL_MAJOR_VERSION 6) set(CGAL_MINOR_VERSION 1) set(CGAL_BUGFIX_VERSION 0) include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake) -set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1-beta2") +set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1") set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}") if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)