collapse_small_triangles.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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. #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. // Inputs:
  21. // V #V by 3 list of vertex positions
  22. // F #F by 3 list of triangle indices into V
  23. // eps epsilon for smallest allowed area treated as fraction of squared bounding box
  24. // diagonal
  25. // Outputs:
  26. // FF #FF by 3 list of triangle indices into V
  27. //
  28. //
  29. void collapse_small_triangles(
  30. const Eigen::MatrixXd & V,
  31. const Eigen::MatrixXi & F,
  32. const double eps,
  33. Eigen::MatrixXi & FF);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "collapse_small_triangles.cpp"
  37. #endif
  38. #endif