removeUnreferenced.h 973 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. //
  21. // Known bugs:
  22. // Also removes combinatorially degenerate faces in NF
  23. template <typename T, typename S>
  24. IGL_INLINE void removeUnreferenced(
  25. const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &V,
  26. const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &F,
  27. Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &NV,
  28. Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &NF,
  29. Eigen::Matrix<S, Eigen::Dynamic, 1> &I);
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "removeUnreferenced.cpp"
  33. #endif
  34. #endif