removeUnreferenced.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. //
  9. // removeUnreferenced.h
  10. // Preview3D
  11. //
  12. // Created by Daniele Panozzo on 17/11/11.
  13. #ifndef IGL_REMOVEUNREFERENCED_H
  14. #define IGL_REMOVEUNREFERENCED_H
  15. #include "igl_inline.h"
  16. #include <Eigen/Core>
  17. namespace igl
  18. {
  19. // [ NV, NF ] = removeUnreferenced( V,F,epsilon )
  20. // Remove unreferenced vertices from V, updating F accordingly
  21. //
  22. // Input:
  23. // V,F: mesh description
  24. //
  25. // Output:
  26. // NV, NF: new mesh without unreferenced vertices
  27. //
  28. // Known bugs:
  29. // Also removes combinatorially degenerate faces in NF
  30. template <typename T, typename S>
  31. IGL_INLINE void removeUnreferenced(
  32. const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &V,
  33. const Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &F,
  34. Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> &NV,
  35. Eigen::Matrix<S, Eigen::Dynamic, Eigen::Dynamic> &NF,
  36. Eigen::Matrix<S, Eigen::Dynamic, 1> &I);
  37. }
  38. #ifdef IGL_HEADER_ONLY
  39. # include "removeUnreferenced.cpp"
  40. #endif
  41. #endif