swept_volume.h 1.3 KB

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