mixed_integer_quadrangulate.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef IGL_MIXED_INTEGER_QUADRANGULATE_H
  2. #define IGL_MIXED_INTEGER_QUADRANGULATE_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <vector>
  6. namespace igl
  7. {
  8. // Creates a quad mesh from a triangular mesh and a set of two directions
  9. // per face, using the algorithm described in the paper
  10. // "Mixed-Integer Quadrangulation" by D. Bommes, H. Zimmer, L. Kobbelt
  11. // ACM SIGGRAPH 2009, Article No. 77 (http://dl.acm.org/citation.cfm?id=1531383)
  12. // Inputs:
  13. // Vin #V by 3 eigen Matrix of mesh vertex 3D positions
  14. // F #F by 4 eigen Matrix of face (quad) indices
  15. // maxIter maximum numbers of iterations
  16. // threshold minimum allowed threshold for non-planarity
  17. // Output:
  18. // Vout #V by 3 eigen Matrix of planar mesh vertex 3D positions
  19. //
  20. template <typename DerivedV, typename DerivedF, typename DerivedU>
  21. IGL_INLINE void mixed_integer_quadrangulate(const Eigen::PlainObjectBase<DerivedV> &V,
  22. const Eigen::PlainObjectBase<DerivedF> &F,
  23. const Eigen::PlainObjectBase<DerivedV> &PD1,
  24. const Eigen::PlainObjectBase<DerivedV> &PD2,
  25. Eigen::PlainObjectBase<DerivedU> &UV,
  26. Eigen::PlainObjectBase<DerivedF> &FUV,
  27. double GradientSize = 30.0,
  28. double Stiffness = 5.0,
  29. bool DirectRound = false,
  30. int iter = 5,
  31. int localIter = 5, bool DoRound = true,
  32. std::vector<int> roundVertices = std::vector<int>(),
  33. std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
  34. template <typename DerivedV, typename DerivedF, typename DerivedU>
  35. IGL_INLINE void mixed_integer_quadrangulate(const Eigen::PlainObjectBase<DerivedV> &V,
  36. const Eigen::PlainObjectBase<DerivedF> &F,
  37. const Eigen::PlainObjectBase<DerivedV> &PD1_combed,
  38. const Eigen::PlainObjectBase<DerivedV> &PD2_combed,
  39. const Eigen::PlainObjectBase<DerivedV> &BIS1_combed,
  40. const Eigen::PlainObjectBase<DerivedV> &BIS2_combed,
  41. const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_MMatch,
  42. const Eigen::Matrix<int, Eigen::Dynamic, 1> &Handle_Singular,
  43. const Eigen::Matrix<int, Eigen::Dynamic, 1> &Handle_SingularDegree,
  44. const Eigen::Matrix<int, Eigen::Dynamic, 3> &Handle_Seams,
  45. Eigen::PlainObjectBase<DerivedU> &UV,
  46. Eigen::PlainObjectBase<DerivedF> &FUV,
  47. double GradientSize = 30.0,
  48. double Stiffness = 5.0,
  49. bool DirectRound = false,
  50. int iter = 5,
  51. int localIter = 5, bool DoRound = true,
  52. std::vector<int> roundVertices = std::vector<int>(),
  53. std::vector<std::vector<int> > hardFeatures = std::vector<std::vector<int> >());
  54. };
  55. #ifdef IGL_HEADER_ONLY
  56. #include "mixed_integer_quadrangulate.cpp"
  57. #endif
  58. #endif