frame_field_deformer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_FRAME_FIELD_DEFORMER_H
  9. #define IGL_FRAME_FIELD_DEFORMER_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. /// Deform a mesh to transform the given per-face frame field to be as close
  15. /// as possible to a cross field, in the least square sense.
  16. ///
  17. /// @param[in] V #V by 3 coordinates of the vertices
  18. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  19. /// @param[in] FF1 #F by 3 first representative vector of the frame field
  20. /// @param[in] FF2 #F by 3 second representative vector of the frame field
  21. /// @param[out] V_d #V? by 3 deformed, first representative vector??
  22. /// @param[out] FF1_d #F by 3 deformed, first representative vector??
  23. /// @param[out] FF2_d #F by 3 deformed, first representative vector??
  24. /// @param[in] iterations number of iterations
  25. /// @param[in] lambda laplacian regularization parameter 0=no regularization 1=full regularization
  26. /// @param[in] perturb_initial_guess whether to perturb the initial guess
  27. IGL_INLINE void frame_field_deformer(
  28. const Eigen::MatrixXd& V,
  29. const Eigen::MatrixXi& F,
  30. const Eigen::MatrixXd& FF1,
  31. const Eigen::MatrixXd& FF2,
  32. Eigen::MatrixXd& V_d,
  33. Eigen::MatrixXd& FF1_d,
  34. Eigen::MatrixXd& FF2_d,
  35. const int iterations = 50,
  36. const double lambda = 0.1,
  37. const bool perturb_initial_guess = true);
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "frame_field_deformer.cpp"
  41. #endif
  42. #endif