removeDuplicates.h 935 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // removeDuplicates.h
  3. // Preview3D
  4. //
  5. // Created by Olga Diamanti on 17/11/11.
  6. // Copyright (c) 2011 __MyCompanyName__. All rights reserved.
  7. //
  8. #ifndef IGL_REMOVEDUPLICATES_H
  9. #define IGL_REMOVEDUPLICATES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // [ NV, NF ] = removeDuplicates( V,F,epsilon )
  15. // Merge the duplicate vertices from V, fixing the topology accordingly
  16. //
  17. // Input:
  18. // V,F: mesh description
  19. // epsilon: minimal distance to consider two vertices identical
  20. //
  21. // Output:
  22. // NV, NF: new mesh without duplicate vertices
  23. template <typename T>
  24. IGL_INLINE void removeDuplicates(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &V, const Eigen::MatrixXi &F, Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &NV, Eigen::MatrixXi &NF, Eigen::VectorXi &I, const double epsilon = 2.2204e-15);
  25. }
  26. #ifdef IGL_HEADER_ONLY
  27. # include "removeDuplicates.cpp"
  28. #endif
  29. #endif