swept_volume_bounding_box.cpp 509 B

1234567891011121314151617181920
  1. #include "swept_volume_bounding_box.h"
  2. IGL_INLINE void igl::swept_volume_bounding_box(
  3. const size_t & n,
  4. const std::function<Eigen::RowVector3d(const size_t vi, const double t)> & V,
  5. const size_t & steps,
  6. Eigen::AlignedBox3d & box)
  7. {
  8. using namespace Eigen;
  9. box.setEmpty();
  10. const VectorXd t = VectorXd::LinSpaced(steps,0,1);
  11. // Find extent over all time steps
  12. for(int ti = 0;ti<t.size();ti++)
  13. {
  14. for(size_t vi = 0;vi<n;vi++)
  15. {
  16. box.extend(V(vi,t(ti)).transpose());
  17. }
  18. }
  19. }