collapse_small_triangles.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <[email protected]>
  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. #ifndef IGL_COLLAPSE_SMALL_TRIANGLES_H
  9. #define IGL_COLLAPSE_SMALL_TRIANGLES_H
  10. #include <Eigen/Dense>
  11. namespace igl
  12. {
  13. /// Given a triangle mesh (V,F) compute a new mesh (VV,FF) which contains the
  14. /// original faces and vertices of (V,F) except any small triangles have been
  15. /// removed via collapse.
  16. ///
  17. /// We are *not* following the rules in "Mesh Optimization" [Hoppe et al]
  18. /// Section 4.2. But for our purposes we don't care about this criteria.
  19. ///
  20. /// @param[in] V #V by 3 list of vertex positions
  21. /// @param[in] F #F by 3 list of triangle indices into V
  22. /// @param[in] eps epsilon for smallest allowed area treated as fraction of squared bounding box
  23. /// diagonal
  24. /// @param[out] FF #FF by 3 list of triangle indices into V
  25. ///
  26. ///
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename DerivedFF>
  31. void collapse_small_triangles(
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. const double eps,
  35. Eigen::PlainObjectBase<DerivedFF> & FF);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "collapse_small_triangles.cpp"
  39. #endif
  40. #endif