removeUnreferenced.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // removeUnreferenced.h
  3. // Preview3D
  4. //
  5. // Created by Daniele Panozzo on 17/11/11.
  6. #ifndef IGL_REMOVEUNREFERENCED_H
  7. #define IGL_REMOVEUNREFERENCED_H
  8. #include "igl_inline.h"
  9. #include <Eigen/Core>
  10. namespace igl
  11. {
  12. // [ NV, NF ] = removeUnreferenced( V,F,epsilon )
  13. // Remove unreferenced vertices from V, updating F accordingly
  14. //
  15. // Input:
  16. // V,F: mesh description
  17. //
  18. // Output:
  19. // NV, NF: new mesh without unreferenced vertices
  20. template <typename T, typename S>
  21. IGL_INLINE void removeUnreferenced(
  22. const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &V,
  23. const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &F,
  24. Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &NV,
  25. Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &NF,
  26. Eigen::Matrix<S, Eigen::Dynamic, 1> &I);
  27. }
  28. #ifdef IGL_HEADER_ONLY
  29. # include "removeUnreferenced.cpp"
  30. #endif
  31. #endif