swept_volume_bounding_box.h 904 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef IGL_SWEPT_VOLUME_BOUNDING_BOX_H
  2. #define IGL_SWEPT_VOLUME_BOUNDING_BOX_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Geometry>
  6. #include <functional>
  7. namespace igl
  8. {
  9. // Construct an axis-aligned bounding box containing a shape undergoing a
  10. // motion sampled at `steps` discrete momements.
  11. //
  12. // Inputs:
  13. // n number of mesh vertices
  14. // V function handle so that V(i,t) returns the 3d position of vertex
  15. // i at time t, for t∈[0,1]
  16. // steps number of time steps: steps=3 --> t∈{0,0.5,1}
  17. // Outputs:
  18. // box box containing mesh under motion
  19. IGL_INLINE void swept_volume_bounding_box(
  20. const size_t & n,
  21. const std::function<
  22. Eigen::RowVector3d(const size_t vi, const double t)> & V,
  23. const size_t & steps,
  24. Eigen::AlignedBox3d & box);
  25. }
  26. #ifndef IGL_STATIC_LIBRARY
  27. # include "swept_volume_bounding_box.cpp"
  28. #endif
  29. #endif