collapse_small_triangles.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. void collapse_small_triangles(
  28. const Eigen::MatrixXd & V,
  29. const Eigen::MatrixXi & F,
  30. const double eps,
  31. Eigen::MatrixXi & FF);
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "collapse_small_triangles.cpp"
  35. #endif
  36. #endif