nrosy.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@gmail.com>
  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_NROSY_H
  9. #define IGL_NROSY_H
  10. #include <iostream>
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. #include <vector>
  14. namespace igl
  15. {
  16. // Generate a N-RoSy field from a sparse set of constraints
  17. //
  18. // Inputs:
  19. // V #V by 3 list of mesh vertex coordinates
  20. // F #F by 3 list of mesh faces (must be triangles)
  21. // b #B by 1 list of constrained face indices
  22. // bc #B by 3 list of representative vectors for the constrained faces
  23. // b_soft #S by 1 b for soft constraints
  24. // w_soft #S by 1 weight for the soft constraints (0-1)
  25. // bc_soft #S by 3 bc for soft constraints
  26. // N the degree of the N-RoSy vector field
  27. // soft the strenght of the soft contraints w.r.t. smoothness
  28. // (0 -> smoothness only, 1->constraints only)
  29. // Outputs:
  30. // R #F by 3 the representative vectors of the interpolated field
  31. // S #V by 1 the singularity index for each vertex (0 = regular)
  32. IGL_INLINE void nrosy(
  33. const Eigen::MatrixXd& V,
  34. const Eigen::MatrixXi& F,
  35. const Eigen::VectorXi& b,
  36. const Eigen::MatrixXd& bc,
  37. const Eigen::VectorXi& b_soft,
  38. const Eigen::VectorXd& w_soft,
  39. const Eigen::MatrixXd& bc_soft,
  40. const int N,
  41. const double soft,
  42. Eigen::MatrixXd& R,
  43. Eigen::VectorXd& S
  44. );
  45. }
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "nrosy.cpp"
  48. #endif
  49. #endif