2
0

qslim.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_QSLIM_H
  9. #define IGL_QSLIM_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Decimate (simplify) a triangle mesh in nD according to the paper
  15. /// "Simplifying Surfaces with Color and Texture using Quadric Error Metrics"
  16. /// by [Garland and Heckbert, 1987] (technically a followup to qslim). The
  17. /// mesh can have open boundaries but should be edge-manifold.
  18. ///
  19. /// @param[in] V #V by dim list of vertex positions. Assumes that vertices with
  20. /// infinite coordinates are "points at infinity" being used to close up
  21. /// boundary edges with faces. This allows special subspace quadrice for
  22. /// boundary edges: There should never be more than one "point at
  23. /// infinity" in a single triangle.
  24. /// @param[in] F #F by 3 list of triangle indices into V
  25. /// @param[in] max_m desired number of output faces
  26. /// @param[out] U #U by dim list of output vertex posistions (can be same ref as V)
  27. /// @param[out] G #G by 3 list of output face indices into U (can be same ref as F)
  28. /// @param[out] J #G list of indices into F of birth face
  29. /// @param[out] I #U list of indices into V of birth vertices
  30. IGL_INLINE bool qslim(
  31. const Eigen::MatrixXd & V,
  32. const Eigen::MatrixXi & F,
  33. const size_t max_m,
  34. Eigen::MatrixXd & U,
  35. Eigen::MatrixXi & G,
  36. Eigen::VectorXi & J,
  37. Eigen::VectorXi & I);
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "qslim.cpp"
  41. #endif
  42. #endif