From d092d4b0e3a7669f980ef675375754154ab38653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Sep 2023 14:34:36 +0200 Subject: [PATCH 1/7] Reformulate a cross product to increase precision --- .../edge_collapse_surface_mesh.cpp | 10 +- .../include/CGAL/Cartesian/MatrixC33.h | 7 ++ .../internal/Lindstrom_Turk_core.h | 98 ++++++++++++++++++- .../internal/Common.h | 5 +- 4 files changed, 112 insertions(+), 8 deletions(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index d21417d98295..3e88f4b090df 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -16,10 +16,12 @@ namespace SMS = CGAL::Surface_mesh_simplification; int main(int argc, char** argv) { + std::cout.precision(17); + std::cerr.precision(17); + Surface_mesh surface_mesh; const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cube-meshed.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; @@ -33,6 +35,8 @@ int main(int argc, char** argv) std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now(); + std::cout << num_vertices(surface_mesh) << " vertices, " << num_edges(surface_mesh) << " edges (BEFORE)" << std::endl; + // In this example, the simplification stops when the number of undirected edges // drops below 10% of the initial count double stop_ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; @@ -45,7 +49,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; std::cout << "Time elapsed: " << std::chrono::duration_cast(end_time - start_time).count() << "ms" << std::endl; - CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out_SC.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h index 7cc2858020b3..3c24abbc3c24 100644 --- a/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h +++ b/Surface_mesh_simplification/include/CGAL/Cartesian/MatrixC33.h @@ -131,6 +131,13 @@ class MatrixC33 return Vector_3(v*m.r0(), v*m.r1(), v*m.r2()); } + friend std::ostream& operator<<(std::ostream & os, const MatrixC33& m) +{ + return os << m.r0() << std::endl + << m.r1() << std::endl + << m.r2() << std::endl; +} + RT determinant() const { return CGAL::determinant(r0().x(), r0().y(), r0().z(), 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 59002f636814..dd901c8d89ae 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 @@ -13,6 +13,8 @@ #include +#include + #include #include #include @@ -119,9 +121,103 @@ 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 + + static Vector SL_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(); + + auto minor = [](double ai, double bi, double aj, double 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); + } +#endif + + static Vector X_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 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 + } + static Vector point_cross_product(const Point& a, const Point& b) { - return cross_product(a-ORIGIN, b-ORIGIN); + return X_product(a-ORIGIN, b-ORIGIN); } // This is the (uX)(Xu) product described in the Lindstrom-Turk paper 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 4ed45a02d1e6..5255a0b53591 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 @@ -114,10 +114,7 @@ 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::cerr << m << std::endl; #define CGAL_SMS_DEBUG_CODE(code) code #else From 985c8a7825ed3d0d2289825c199274f37f36b795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Sep 2023 16:58:59 +0200 Subject: [PATCH 2/7] Add a test --- .../CMakeLists.txt | 1 + .../data/far_xy.off | 90 +++++++++++++++++++ .../test_edge_collapse_stability.cpp | 71 +++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 Surface_mesh_simplification/test/Surface_mesh_simplification/data/far_xy.off create mode 100644 Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 2f55474593af..9c1e010e5efb 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -12,6 +12,7 @@ create_single_source_cgal_program("test_edge_collapse_Envelope.cpp") create_single_source_cgal_program("test_edge_collapse_Polyhedron_3.cpp") create_single_source_cgal_program("test_edge_profile_link.cpp") create_single_source_cgal_program("test_edge_deprecated_stop_predicates.cpp") +create_single_source_cgal_program("test_edge_collapse_stability.cpp") find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/data/far_xy.off b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/far_xy.off new file mode 100644 index 000000000000..efa40d4b9a19 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/data/far_xy.off @@ -0,0 +1,90 @@ +OFF +36 50 0 + +104605.80000019073 1217329.6000003815 134.27659606933594 +104605.75 1217329.6000003815 134.27859497070312 +104605.55000019073 1217329.7999992371 134.29460144042969 +104605.80000019073 1217329.7999992371 134.28489685058594 +104605.75 1217329.7999992371 134.28680419921875 +104605.75 1217329.75 134.28469848632812 +104605.55000019073 1217329.75 134.2926025390625 +104605.55000019073 1217329.7000007629 134.29060363769531 +104605.80000019073 1217329.75 134.28280639648438 +104605.84999990463 1217329.7999992371 134.28300476074219 +104605.69999980927 1217329.7999992371 134.2886962890625 +104605.55000019073 1217329.6499996185 134.28860473632812 +104605.55000019073 1217329.6000003815 134.28660583496094 +104605.84999990463 1217329.6000003815 134.27470397949219 +104605.59999990463 1217329.7999992371 134.2926025390625 +104605.75 1217329.7000007629 134.2825927734375 +104605.65000009537 1217329.75 134.28860473632812 +104605.80000019073 1217329.7000007629 134.28070068359375 +104605.84999990463 1217329.75 134.28089904785156 +104605.69999980927 1217329.7000007629 134.28460693359375 +104605.90000009537 1217329.7999992371 134.28109741210938 +104605.90000009537 1217329.6499996185 134.27490234375 +104605.90000009537 1217329.7000007629 134.27690124511719 +104605.65000009537 1217329.5499992371 134.28059387207031 +104605.59999990463 1217329.5 134.28050231933594 +104605.90000009537 1217329.5499992371 134.27070617675781 +104605.69999980927 1217329.6000003815 134.28059387207031 +104605.65000009537 1217329.6499996185 134.28460693359375 +104605.59999990463 1217329.7000007629 134.28860473632812 +104605.65000009537 1217329.4500007629 134.27650451660156 +104605.59999990463 1217329.6000003815 134.28460693359375 +104605.55000019073 1217329.5 134.28250122070312 +104605.55000019073 1217329.5499992371 134.28450012207031 +104605.90000009537 1217329.75 134.27900695800781 +104605.84999990463 1217329.7000007629 134.27879333496094 +104605.84999990463 1217329.6499996185 134.27679443359375 +3 30 23 26 +3 3 4 5 +3 26 23 1 +3 22 33 34 +3 8 9 3 +3 17 0 35 +3 17 1 0 +3 4 10 5 +3 15 1 17 +3 8 3 5 +3 15 26 1 +3 6 14 2 +3 0 25 13 +3 35 0 13 +3 6 16 14 +3 28 16 6 +3 7 28 6 +3 8 5 15 +3 16 10 14 +3 8 15 17 +3 16 5 10 +3 18 8 17 +3 16 19 5 +3 19 15 5 +3 18 20 9 +3 18 9 8 +3 11 28 7 +3 11 27 28 +3 21 35 13 +3 21 22 35 +3 22 34 35 +3 31 24 32 +3 24 23 32 +3 24 29 23 +3 29 1 23 +3 19 26 15 +3 27 26 19 +3 28 27 19 +3 28 19 16 +3 29 0 1 +3 30 26 27 +3 29 25 0 +3 18 33 20 +3 34 33 18 +3 34 18 17 +3 34 17 35 +3 32 23 30 +3 32 30 12 +3 12 30 11 +3 30 27 11 + diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp new file mode 100644 index 000000000000..f2efb2182448 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp @@ -0,0 +1,71 @@ +#include +#include + +// Simplification function +#include +#include +#include +#include + +#include + +//bbox +#include + +#include +#include + +namespace SMS = CGAL::Surface_mesh_simplification; + +typedef CGAL::Simple_cartesian Kernel; + +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh Surface; + +typedef SMS::LindstromTurk_cost Cost; +typedef SMS::LindstromTurk_placement Placement; + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cerr.precision(17); + + std::string filename = (argc > 1) ? argv[1] : "data/far_xy.off"; + + Surface mesh; + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) + { + std::cerr << "Failed to read input mesh: " << filename << std::endl; + return EXIT_FAILURE; + } + + std::cout << "input has " << num_vertices(mesh) << " vertices." << std::endl; + + CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(mesh)); + + // scale a bit the bounding box bbox, because the kernel is SC + bbox = { bbox.min() - 0.01 * (bbox.max() - bbox.min()), + bbox.max() + 0.01 * (bbox.max() - bbox.min()) }; + + std::cout << "Bbox: " << bbox << std::endl; + + SMS::Edge_count_stop_predicate stop(num_halfedges(mesh)/10); + Placement placement_ref; + + SMS::edge_collapse(mesh, stop, + CGAL::parameters::get_cost(Cost()) + .get_placement(placement_ref)); + + CGAL::IO::write_polygon_mesh("out.off", mesh, CGAL::parameters::stream_precision(17)); + + for(auto v : vertices(mesh)) + { + if(bbox.has_on_unbounded_side(mesh.point(v))) + { + std::cerr << "Error: " << mesh.point(v) << " is outside" << std::endl; + } + } + + std::cout << "output has " << vertices(mesh).size() << " vertices." << std::endl; + return EXIT_SUCCESS; +} From 3316dc5c01b195e86f1d836587e368f7e8e3b458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Sep 2023 17:00:58 +0200 Subject: [PATCH 3/7] Restore some base code --- .../edge_collapse_surface_mesh.cpp | 2 +- .../CGAL/Surface_mesh_simplification/internal/Common.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index 3e88f4b090df..a37cb970c930 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -49,7 +49,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; std::cout << "Time elapsed: " << std::chrono::duration_cast(end_time - start_time).count() << "ms" << std::endl; - CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out_SC.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } 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 5255a0b53591..4ed45a02d1e6 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 @@ -114,7 +114,10 @@ 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) \ - std::cerr << m << std::endl; + 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; \ + } #define CGAL_SMS_DEBUG_CODE(code) code #else From 433881020e0271f39bab161a4493c95840e60077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 21 Sep 2023 10:18:30 +0200 Subject: [PATCH 4/7] Remove needless header include --- .../Policies/Edge_collapse/internal/Lindstrom_Turk_core.h | 2 -- 1 file changed, 2 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 dd901c8d89ae..31c12e18c54d 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 @@ -13,8 +13,6 @@ #include -#include - #include #include #include From fffea5c616d56b872eb8430e0dd286bdf4ce4658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 21 Sep 2023 15:29:31 +0200 Subject: [PATCH 5/7] add an avx version for archive, it is slower so not used in general, CGAL with avx is itself slower --- .../internal/Lindstrom_Turk_core.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) 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 31c12e18c54d..70750a95eca2 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,6 +155,36 @@ private : } #endif +#ifdef __AVX__ + static Vector SL_cross_product_avx(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(); + + __m256d a = _mm256_set_pd(ay, az, ax, 1.0); + __m256d b = _mm256_set_pd(bz, bx, by, 1.0); + __m256d c = _mm256_set_pd(az, ax, ay, 1.0); + __m256d d = _mm256_set_pd(by, bz, bx, 1.0); + + __m256d s1 = _mm256_sub_pd(b, c); + __m256d s2 = _mm256_sub_pd(a, d); + + b = _mm256_mul_pd(a, s1); + d = _mm256_mul_pd(c, s2); + a = _mm256_add_pd(b, d); + + double res[4]; + _mm256_storeu_pd(res, a); + +// a * (b - c ) + c * ( a - d); +// FT x = ay * (bz - az) + az * (ay - by); +// FT y = az * (bx - ax) + ax * (az - bz); +// FT z = ax * (by - ay) + ay * (ax - bx); + + return Vector(res[3], res[2], res[1]); + } +#end + static Vector SL_cross_product(const Vector& a, const Vector& b) { const FT ax=a.x(), ay=a.y(), az=a.z(); From d65cd2d298b12a4156423c6171d93bbb56b77d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 21 Sep 2023 16:12:35 +0200 Subject: [PATCH 6/7] fix macro --- .../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 70750a95eca2..d97688dde8bd 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 @@ -183,7 +183,7 @@ private : return Vector(res[3], res[2], res[1]); } -#end +#endif static Vector SL_cross_product(const Vector& a, const Vector& b) { From 3d71790cbcf9e94ea3184438f9256a6785ed6430 Mon Sep 17 00:00:00 2001 From: Mael Date: Thu, 5 Oct 2023 14:56:25 +0200 Subject: [PATCH 7/7] Protect min/max with parentheses Co-authored-by: Andreas Fabri --- .../test_edge_collapse_stability.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp index f2efb2182448..1a6a2786c6db 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_stability.cpp @@ -44,8 +44,8 @@ int main(int argc, char** argv) CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(mesh)); // scale a bit the bounding box bbox, because the kernel is SC - bbox = { bbox.min() - 0.01 * (bbox.max() - bbox.min()), - bbox.max() + 0.01 * (bbox.max() - bbox.min()) }; + bbox = { (bbox.min)() - 0.01 * ((bbox.max)() - (bbox.min)()), + (bbox.max)() + 0.01 * ((bbox.max)() - (bbox.min)()) }; std::cout << "Bbox: " << bbox << std::endl;