removeDuplicates.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef IGL_REMOVEDUPLICATES_H
  2. #define IGL_REMOVEDUPLICATES_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. // [ NV, NF ] = removeDuplicates( V,F,epsilon )
  8. // Merge the duplicate vertices from V, fixing the topology accordingly
  9. //
  10. // Input:
  11. // V,F: mesh description
  12. // epsilon: minimal distance to consider two vertices identical
  13. //
  14. // Output:
  15. // NV, NF: new mesh without duplicate vertices
  16. // template <typename T, typename S>
  17. // IGL_INLINE void removeDuplicates(
  18. // const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &V,
  19. // const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &F,
  20. // Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &NV,
  21. // Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &NF,
  22. // Eigen::Matrix<S, Eigen::Dynamic, 1> &I,
  23. // const double epsilon = 2.2204e-15);
  24. template <typename DerivedV, typename DerivedF>
  25. IGL_INLINE void removeDuplicates(
  26. const Eigen::PlainObjectBase<DerivedV> &V,
  27. const Eigen::PlainObjectBase<DerivedF> &F,
  28. Eigen::PlainObjectBase<DerivedV> &NV,
  29. Eigen::PlainObjectBase<DerivedF> &NF,
  30. Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, 1> &I,
  31. const double epsilon = 2.2204e-15);
  32. }
  33. #ifdef IGL_HEADER_ONLY
  34. # include "removeDuplicates.cpp"
  35. #endif
  36. #endif