qslim.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_QSLIM_H
  2. #define IGL_QSLIM_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. // Decimate (simplify) a triangle mesh in nD according to the paper
  8. // "Simplifying Surfaces with Color and Texture using Quadric Error Metrics"
  9. // by [Garland and Heckbert, 1987] (technically a followup to qslim). The
  10. // mesh can have open boundaries but should be edge-manifold.
  11. //
  12. // Inputs:
  13. // V #V by dim list of vertex positions. Assumes that vertices w
  14. // F #F by 3 list of triangle indices into V
  15. // max_m desired number of output faces
  16. // Outputs:
  17. // U #U by dim list of output vertex posistions (can be same ref as V)
  18. // G #G by 3 list of output face indices into U (can be same ref as G)
  19. // J #G list of indices into F of birth face
  20. // I #U list of indices into V of birth vertices
  21. IGL_INLINE bool qslim(
  22. const Eigen::MatrixXd & V,
  23. const Eigen::MatrixXi & F,
  24. const size_t max_m,
  25. Eigen::MatrixXd & U,
  26. Eigen::MatrixXi & G,
  27. Eigen::VectorXi & J,
  28. Eigen::VectorXi & I);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. # include "qslim.cpp"
  32. #endif
  33. #endif