swept_volume.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef IGL_SWEPT_VOLUME_H
  2. #define IGL_SWEPT_VOLUME_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Geometry>
  6. namespace igl
  7. {
  8. /// Compute the surface of the swept volume of a solid object with surface
  9. /// (V,F) mesh under going rigid motion.
  10. ///
  11. /// @param[in] V #V by 3 list of mesh positions in reference pose
  12. /// @param[in] F #F by 3 list of mesh indices into V
  13. /// @param[in] transform function handle so that transform(t) returns the rigid
  14. /// transformation at time t∈[0,1]
  15. /// @param[in] steps number of time steps: steps=3 --> t∈{0,0.5,1}
  16. /// @param[in] grid_res number of grid cells on the longest side containing the
  17. /// motion (isolevel+1 cells will also be added on each side as padding)
  18. /// @param[in] isolevel distance level to be contoured as swept volume
  19. /// @param[out] SV #SV by 3 list of mesh positions of the swept surface
  20. /// @param[out] SF #SF by 3 list of mesh faces into SV
  21. IGL_INLINE void swept_volume(
  22. const Eigen::MatrixXd & V,
  23. const Eigen::MatrixXi & F,
  24. const std::function<Eigen::Affine3d(const double t)> & transform,
  25. const size_t steps,
  26. const size_t grid_res,
  27. const size_t isolevel,
  28. Eigen::MatrixXd & SV,
  29. Eigen::MatrixXi & SF);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "swept_volume.cpp"
  33. #endif
  34. #endif