lscm_hessian.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2023 Alec Jacobson
  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_LSCM_HESSIAN_H
  9. #define IGL_LSCM_HESSIAN_H
  10. #include <Eigen/Dense>
  11. #include <Eigen/Sparse>
  12. namespace igl
  13. {
  14. /// Compute a Least-squares conformal map parametrization (equivalently
  15. /// derived in "Intrinsic Parameterizations of Surface Meshes" [Desbrun et al.
  16. /// 2002] and "Least Squares Conformal Maps for Automatic Texture Atlas
  17. /// Generation" [Lévy et al. 2002]), though this implementation follows the
  18. /// derivation in: "Spectral Conformal Parameterization" [Mullen et al. 2008]
  19. /// (note, this does **not** implement the Eigen-decomposition based method in
  20. /// [Mullen et al. 2008], which is not equivalent). Input should be a manifold
  21. /// mesh (also no unreferenced vertices) and "boundary" (fixed vertices) `b`
  22. /// should contain at least two vertices per connected component.
  23. ///
  24. /// @param[in] V #V by 3 list of mesh vertex positions
  25. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  26. /// @param[in] b #b boundary indices into V
  27. /// @param[in] bc #b by 2 list of boundary values
  28. /// @param[out] UV #V by 2 list of 2D mesh vertex positions in UV space
  29. /// @param[out] Q #Vx2 by #Vx2 symmetric positive semi-definite matrix for computing LSCM energy
  30. /// @return true only on solver success.
  31. ///
  32. template <typename DerivedV, typename DerivedF, typename QScalar>
  33. void lscm_hessian(
  34. const Eigen::MatrixBase<DerivedV> & V,
  35. const Eigen::MatrixBase<DerivedF> & F,
  36. Eigen::SparseMatrix<QScalar> & Q);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. #include "lscm_hessian.cpp"
  40. #endif
  41. #endif