qslim.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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[in] block_intersections whether to block intersections (see
  27. /// intersection_blocking_collapse_edge_callbacks)
  28. /// @param[out] U #U by dim list of output vertex posistions (can be same ref as V)
  29. /// @param[out] G #G by 3 list of output face indices into U (can be same ref as F)
  30. /// @param[out] J #G list of indices into F of birth face
  31. /// @param[out] I #U list of indices into V of birth vertices
  32. IGL_INLINE bool qslim(
  33. const Eigen::MatrixXd & V,
  34. const Eigen::MatrixXi & F,
  35. const int max_m,
  36. const bool block_intersections,
  37. Eigen::MatrixXd & U,
  38. Eigen::MatrixXi & G,
  39. Eigen::VectorXi & J,
  40. Eigen::VectorXi & I);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "qslim.cpp"
  44. #endif
  45. #endif