swept_volume.h 1.4 KB

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