#include <CGAL/Cartesian_grid_3.h>
#include <CGAL/Cartesian_grid_domain.h>
#include <CGAL/Marching_cubes_3.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/IO/OFF.h>
typedef std::vector<Point> Point_range;
typedef std::vector<std::vector<std::size_t>> Polygon_range;
int main() {
Grid grid(100, 100, 100, {-1, -1, -1, 1, 1, 1});
for (std::size_t x = 0; x < grid.xdim(); x++) {
for (std::size_t y = 0; y < grid.ydim(); y++) {
for (std::size_t z = 0; z < grid.zdim(); z++) {
const FT pos_x = x * grid.
get_spacing()[0] + grid.get_bbox().xmin();
const FT pos_y = y * grid.get_spacing()[1] + grid.get_bbox().ymin();
const FT pos_z = z * grid.get_spacing()[2] + grid.get_bbox().zmin();
grid.value(x, y, z) =
std::sqrt(pos_x * pos_x + pos_y * pos_y + pos_z * pos_z);
}
}
}
Point_range points;
Polygon_range polygons;
}