diff --git a/Isosurfacing_3/examples/Isosurfacing_3/contouring_discrete_data.cpp b/Isosurfacing_3/examples/Isosurfacing_3/contouring_discrete_data.cpp index 7b35dd37d2d..af61c6a44c8 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/contouring_discrete_data.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/contouring_discrete_data.cpp @@ -89,6 +89,11 @@ void run_dual_contouring(const Grid& grid, } } + // If the gradient was not known analytically, we could use: + // - Finite_difference_gradient_3 to use finite difference to compute it from values; + // - the function below to use finite difference _and_ store the values at the grid vertices + // gradients.compute_discrete_gradients(values); + Domain domain { grid, values, gradients }; Point_range points; diff --git a/Isosurfacing_3/include/CGAL/Isosurfacing_3/Interpolated_discrete_gradients_3.h b/Isosurfacing_3/include/CGAL/Isosurfacing_3/Interpolated_discrete_gradients_3.h index 62b9da44e0b..f4c5dd9f8e5 100644 --- a/Isosurfacing_3/include/CGAL/Isosurfacing_3/Interpolated_discrete_gradients_3.h +++ b/Isosurfacing_3/include/CGAL/Isosurfacing_3/Interpolated_discrete_gradients_3.h @@ -62,9 +62,9 @@ public: m_gradients.resize(nv); } - // computes and stores gradients at the vertices of the grid - // \tparam ValueField must be a model of `IsosurfacingValueField_3` - // \param values a field of values whose gradient are being computed + /// computes (using finite difference) and stores gradients at the vertices of the grid. + /// \tparam ValueField must be a model of `IsosurfacingValueField_3` + /// \param values a field of values whose gradient are being computed template void compute_discrete_gradients(const ValueField& values) {