frame_field.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <[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_COMISO_FRAMEFIELD_H
  9. #define IGL_COMISO_FRAMEFIELD_H
  10. #include "../../igl_inline.h"
  11. #include "../../PI.h"
  12. #include <Eigen/Dense>
  13. #include <vector>
  14. namespace igl
  15. {
  16. namespace copyleft
  17. {
  18. namespace comiso
  19. {
  20. /// Generate a piecewise-constant frame-field field from a sparse set of constraints on faces
  21. /// using the algorithm proposed in:
  22. /// Frame Fields: Anisotropic and Non-Orthogonal Cross Fields
  23. /// Daniele Panozzo, Enrico Puppo, Marco Tarini, Olga Sorkine-Hornung,
  24. /// ACM Transactions on Graphics (SIGGRAPH, 2014)
  25. ///
  26. /// @param[in] V #V by 3 list of mesh vertex coordinates
  27. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  28. /// @param[in] b #B by 1 list of constrained face indices
  29. /// @param[in] bc1 #B by 3 list of the constrained first representative vector of the frame field (up to permutation and sign)
  30. /// @param[in] bc2 #B by 3 list of the constrained second representative vector of the frame field (up to permutation and sign)
  31. /// @param[out] FF1 #F by 3 the first representative vector of the frame field (up to permutation and sign)
  32. /// @param[out] FF2 #F by 3 the second representative vector of the frame field (up to permutation and sign)
  33. ///
  34. /// \note it now supports only soft constraints, should be extended to support both hard and soft constraints
  35. IGL_INLINE void frame_field(
  36. const Eigen::MatrixXd& V,
  37. const Eigen::MatrixXi& F,
  38. const Eigen::VectorXi& b,
  39. const Eigen::MatrixXd& bc1,
  40. const Eigen::MatrixXd& bc2,
  41. Eigen::MatrixXd& FF1,
  42. Eigen::MatrixXd& FF2
  43. );
  44. }
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "frame_field.cpp"
  49. #endif
  50. #endif