31 double grid_offset)
const {
32 boost::multi_array<int, 3> raster(grid_size);
33 for (
int i = 0; i < grid_size[0]; ++i) {
34 for (
int j = 0; j < grid_size[1]; ++j) {
35 for (
int k = 0; k < grid_size[2]; ++k) {
37 (j + grid_offset) * grid_spacing,
38 (k + grid_offset) * grid_spacing}};
43 return {raster.data(), raster.data() + raster.num_elements()};
std::vector< int > rasterize(Utils::Vector3i const &grid_size, double grid_spacing, double grid_offset) const
Rasterize a shape on a regular grid.