arap_rhs.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[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_ARAP_RHS_H
  9. #define IGL_ARAP_RHS_H
  10. #include "igl_inline.h"
  11. #include "ARAPEnergyType.h"
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. /// Right-hand side constructor of global poisson solve for various Arap
  17. /// energies
  18. ///
  19. /// @param[in] V #V by Vdim list of initial domain positions
  20. /// @param[in] F #F by 3 list of triangle indices into V
  21. /// @param[in] dim dimension being used at solve time. For deformation usually dim =
  22. /// V.cols(), for surface parameterization V.cols() = 3 and dim = 2
  23. /// @param[in] energy igl::ARAPEnergyType enum value defining which energy is being
  24. /// used. See igl::ARAPEnergyType.h for valid options and explanations.
  25. /// @param[out] K #V*dim by #(F|V)*dim*dim matrix such that:
  26. /// b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1);
  27. ///
  28. /// \see arap_linear_block
  29. template<typename DerivedV, typename DerivedF, typename DerivedK>
  30. IGL_INLINE void arap_rhs(
  31. const Eigen::MatrixBase<DerivedV> & V,
  32. const Eigen::MatrixBase<DerivedF> & F,
  33. const int dim,
  34. const igl::ARAPEnergyType energy,
  35. Eigen::SparseCompressedBase<DerivedK>& K);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. #include "arap_rhs.cpp"
  39. #endif
  40. #endif