voxel_grid.h 803 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_VOXEL_GRID_H
  2. #define IGL_VOXEL_GRID_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Geometry>
  6. namespace igl
  7. {
  8. // Construct the cell center positions of a regular voxel grid (lattice) made
  9. // of perfectly square voxels.
  10. //
  11. // Inputs:
  12. // box bounding box to enclose by grid
  13. // s number of cell centers on largest side (including 2*pad_count)
  14. // pad_count number of cells beyond box
  15. // Outputs:
  16. // GV res(0)*res(1)*res(2) by 3 list of cell center positions
  17. // res 3-long list of dimension of voxel grid
  18. IGL_INLINE void voxel_grid(
  19. const Eigen::AlignedBox3d & box,
  20. const int s,
  21. const int pad_count,
  22. Eigen::MatrixXd & GV,
  23. Eigen::RowVector3i & side);
  24. }
  25. #ifndef IGL_STATIC_LIBRARY
  26. # include "voxel_grid.cpp"
  27. #endif
  28. #endif