From e8f7fcc0ae52c2499a7d57e156babd14d0d8ac1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 12 Feb 2025 01:16:54 +0100 Subject: [PATCH 1/7] foldover are not coplanar patches --- .../Polygon_mesh_processing/remesh_planar_patches.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h index 33514d6f2de..b3bb18bbd7a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh_planar_patches.h @@ -32,6 +32,10 @@ #include #include +#ifdef CGAL_DEBUG_DECIMATION +#include +#endif + #include #include @@ -243,7 +247,7 @@ bool is_edge_between_coplanar_faces(edge_descriptor e, Point_ref_3 s = get(vpm, target(next(opposite(h, tm), tm), tm) ); if (coplanar_cos_threshold==-1) - return coplanar(p, q, r, s); + return coplanar(p, q, r, s) && coplanar_orientation(p, q, r, s)!=CGAL::POSITIVE; else { typename Kernel::Compare_dihedral_angle_3 pred; @@ -848,6 +852,10 @@ bool decimate_impl(const TriangleMeshIn& tm_in, if (!is_polygon_soup_a_polygon_mesh(faces)) { +#ifdef CGAL_DEBUG_DECIMATION + CGAL::IO::write_polygon_soup("soup.off", corners, faces); + std::cout << "the output is not a valid polygon mesh!" << std::endl; +#endif return false; } From 29134b2eedf5dfb224988c3fe7371c2c68e61ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Sun, 13 Apr 2025 20:40:31 +0200 Subject: [PATCH 2/7] use CGAL_Eigen3_support instead of CGAL_Eigen_support --- .../Kinetic_space_partition/CMakeLists.txt | 7 ++-- .../Kinetic_space_partition/CMakeLists.txt | 34 ++++++------------- .../CMakeLists.txt | 7 ++-- .../CMakeLists.txt | 7 ++-- Orthtree/examples/Orthtree/CMakeLists.txt | 6 ++-- 5 files changed, 25 insertions(+), 36 deletions(-) diff --git a/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt b/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt index 344a8029ca7..671b9cdfb9d 100644 --- a/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt +++ b/Kinetic_space_partition/examples/Kinetic_space_partition/CMakeLists.txt @@ -9,15 +9,16 @@ find_package(CGAL REQUIRED) include(CGAL_CreateSingleSourceCGALProgram) find_package(Eigen3 3.1.0 REQUIRED) -if(Eigen3_FOUND) +include(CGAL_Eigen3_support) + +if(TARGET CGAL::Eigen3_support) message(STATUS "Found Eigen") - include(CGAL_Eigen_support) set(targets kinetic_partition) foreach(target ${targets}) create_single_source_cgal_program("${target}.cpp") - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() else() message(ERROR "This program requires the Eigen library, and will not be compiled.") diff --git a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt index 038b9fa4615..8a209b7a8a8 100644 --- a/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt +++ b/Kinetic_space_partition/test/Kinetic_space_partition/CMakeLists.txt @@ -5,35 +5,21 @@ cmake_minimum_required(VERSION 3.12...3.29) project(Kinetic_space_partition_Tests) -set(CMAKE_CXX_STANDARD 17) - -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL REQUIRED) include(CGAL_CreateSingleSourceCGALProgram) -find_package(Boost REQUIRED) -if(Boost_FOUND) - message(STATUS "Found Boost") +find_package(Eigen3 3.1.0 REQUIRED) +include(CGAL_Eigen3_support) - find_package(Eigen3 3.1.0 REQUIRED) - if(Eigen3_FOUND) - message(STATUS "Found Eigen") - include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen3_support) + message(STATUS "Found Eigen") set(targets kinetic_3d_test_all issue_8624) - set(project_linked_libraries) - set(project_compilation_definitions) - - foreach(target ${targets}) - create_single_source_cgal_program("${target}.cpp") - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC ${project_linked_libraries} CGAL::Eigen_support) - target_compile_definitions(${target} PUBLIC ${project_compilation_definitions}) - endif() - endforeach() - else() - message(ERROR "This program requires the Eigen library, and will not be compiled.") - endif() + foreach(target ${targets}) + create_single_source_cgal_program("${target}.cpp") + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) + endforeach() else() - message(ERROR "This program requires the Boost library, and will not be compiled.") + message(ERROR "This program requires the Eigen library, and will not be compiled.") endif() diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt index 90a1acd129e..8a721f464fb 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt @@ -9,15 +9,16 @@ find_package(CGAL REQUIRED) include(CGAL_CreateSingleSourceCGALProgram) find_package(Eigen3 3.1.0 REQUIRED) -if(Eigen3_FOUND) +include(CGAL_Eigen3_support) + +if(TARGET CGAL::Eigen3_support) message(STATUS "Found Eigen") - include(CGAL_Eigen_support) set(targets ksr_basic ksr_building ksr_parameters) foreach(target ${targets}) create_single_source_cgal_program("${target}.cpp") - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() else() message(ERROR "This program requires the Eigen library, and will not be compiled.") diff --git a/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt b/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt index ada01e60017..9bab32b6721 100644 --- a/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt +++ b/Kinetic_surface_reconstruction/test/Kinetic_surface_reconstruction/CMakeLists.txt @@ -9,15 +9,16 @@ find_package(CGAL REQUIRED) include(CGAL_CreateSingleSourceCGALProgram) find_package(Eigen3 3.1.0 REQUIRED) -if(Eigen3_FOUND) +include(CGAL_Eigen3_support) + +if(TARGET CGAL::Eigen3_support) message(STATUS "Found Eigen") - include(CGAL_Eigen_support) set(targets ksr_test ksr_reorientation ksr_regularization) foreach(target ${targets}) create_single_source_cgal_program("${target}.cpp") - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() else() message(ERROR "This program requires the Eigen library, and will not be compiled.") diff --git a/Orthtree/examples/Orthtree/CMakeLists.txt b/Orthtree/examples/Orthtree/CMakeLists.txt index 476dfbfb5fc..30a3f4c397f 100644 --- a/Orthtree/examples/Orthtree/CMakeLists.txt +++ b/Orthtree/examples/Orthtree/CMakeLists.txt @@ -19,8 +19,8 @@ create_single_source_cgal_program("octree_surface_mesh.cpp") create_single_source_cgal_program("quadtree_build_manually.cpp") find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) -include(CGAL_Eigen_support) -if (TARGET CGAL::Eigen_support) +include(CGAL_Eigen3_support) +if (TARGET CGAL::Eigen3_support) create_single_source_cgal_program("orthtree_build.cpp") - target_link_libraries(orthtree_build PUBLIC CGAL::Eigen_support) + target_link_libraries(orthtree_build PUBLIC CGAL::Eigen3_support) endif() From c5d8089232308321e3044832b8a2f3649dba5ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:50:34 +0100 Subject: [PATCH 3/7] a test and an example requires Leda or Core --- .../examples/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- .../test/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt index 3d3d7367f53..65ed31daad1 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,9 +3,15 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Examples ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "triang_on_sphere.cpp" ) create_single_source_cgal_program( "triang_on_sphere_range.cpp" ) -create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) create_single_source_cgal_program( "triang_on_sphere_proj.cpp" ) create_single_source_cgal_program( "triang_on_sphere_geo.cpp" ) + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index be2360314ef..1d27f25b35b 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,15 +3,21 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Tests ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "test_dtos.cpp" ) create_single_source_cgal_program( "test_dtos2_remove.cpp" ) -create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) create_single_source_cgal_program( "test_dtos_traits.cpp" ) create_single_source_cgal_program( "issue_8200.cpp" ) +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() + find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) From 29fcec6b3a3a67ec6273d4061c4f336c40bfe440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:11:50 +0100 Subject: [PATCH 4/7] fix dependencies --- .../examples/Cone_spanners_2/CMakeLists.txt | 19 ++++-------------- .../test/Cone_spanners_2/CMakeLists.txt | 20 +++++++++++-------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index ded37dfad08..99442720fc1 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -5,21 +5,10 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(LEDA QUIET) if(CGAL_Core_FOUND OR LEDA_FOUND) - if(MSVC) - # Turn off a boost related warning that appears with VC2015 - # boost_1_65_1\boost\graph\named_function_params.hpp(240) : - # warning C4172: returning address of local variable or temporary - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4172") - endif() - - # create a target per cppfile - file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") - endforeach() + create_single_source_cgal_program("compute_cones.cpp") + create_single_source_cgal_program("theta_io.cpp") else() message("NOTICE: This program requires the CGAL_Core library (or LEDA), and will not be compiled.") endif() + +create_single_source_cgal_program("dijkstra_theta.cpp") diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index 462edfc7819..17c47060a82 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -5,12 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program("cones_inexact.cpp") +create_single_source_cgal_program("theta_inexact.cpp") +create_single_source_cgal_program("yao_inexact.cpp") + +if(CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("cones_exact.cpp") + create_single_source_cgal_program("theta_exact.cpp") + create_single_source_cgal_program("yao_exact.cpp") +else() + message("NOTICE: Some tests require the CGAL_Core library (or LEDA), and will not be compiled.") +endif() From 5b3356dbc65a3cfa44fa37b859e785f1808a8f7a Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 14 Apr 2025 11:14:49 +0200 Subject: [PATCH 5/7] fix halfedge status for opposite edges when removing border degenerate faces --- .../internal/Isotropic_remeshing/remesh_impl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index a40970ed97b..5ec16e98fa7 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -1699,6 +1699,10 @@ private: { set_status(hf, MESH_BORDER); //only 1 or 2 of the listed halfedges //will survive face removal, but status will be correct + + halfedge_descriptor hfo = opposite(hf, mesh_); + if(status(hfo) != MESH_BORDER) + set_status(hfo, PATCH_BORDER); } CGAL::Euler::remove_face(h, mesh_); } From a52afd88003de8424642eca8d3790bd97bb3376f Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 14 Apr 2025 11:30:44 +0200 Subject: [PATCH 6/7] setting status of edges that will disappear is cheaper than checking status --- .../internal/Isotropic_remeshing/remesh_impl.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 5ec16e98fa7..776f5654879 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -1699,10 +1699,9 @@ private: { set_status(hf, MESH_BORDER); //only 1 or 2 of the listed halfedges //will survive face removal, but status will be correct - - halfedge_descriptor hfo = opposite(hf, mesh_); - if(status(hfo) != MESH_BORDER) - set_status(hfo, PATCH_BORDER); + set_status(opposite(hf, mesh_), PATCH_BORDER); //idem + //some of them will not survive but setting status + //is cheaper then checking which should be set } CGAL::Euler::remove_face(h, mesh_); } From b0dcf8c3f508e9f21cbf82048e00140054d9500a Mon Sep 17 00:00:00 2001 From: lvalque <131978677+LeoValque@users.noreply.github.com> Date: Tue, 15 Apr 2025 09:57:05 +0200 Subject: [PATCH 7/7] Remove Documention bug in to_vector of Segment_3.h --- Kernel_23/doc/Kernel_23/CGAL/Segment_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Segment_3.h b/Kernel_23/doc/Kernel_23/CGAL/Segment_3.h index 36dcda52494..a38b193e798 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Segment_3.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Segment_3.h @@ -92,7 +92,7 @@ returns the squared length of `s`. Kernel::FT squared_length() const; /*! -returns the vector `s.target()` - `s`.`source()`. +returns the vector `s.target()` - `s.source()`. */ Vector_3 to_vector() const;