lscm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_LSCM_H
  9. #define IGL_LSCM_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. // Compute a Least-squares conformal map parametrization following the
  16. // algorithm presented in: Spectral Conformal Parameterization, Patrick
  17. // Mullen, Yiying Tong, Pierre Alliez and Mathieu Desbrun. Input should be a
  18. // manifold mesh (also no unreferenced vertices) and "boundary" `b` should
  19. // contain at least two vertices per connected component.
  20. //
  21. //
  22. // Inputs:
  23. // V #V by 3 list of mesh vertex positions
  24. // F #F by 3 list of mesh faces (must be triangles)
  25. // b #b boundary indices into V
  26. // bc #b by 3 list of boundary values
  27. // Outputs:
  28. // UV #V by 2 list of 2D mesh vertex positions in UV space
  29. // Returns true only on solver success.
  30. //
  31. IGL_INLINE bool lscm(
  32. const Eigen::MatrixXd& V,
  33. const Eigen::MatrixXi& F,
  34. const Eigen::VectorXi& b,
  35. const Eigen::MatrixXd& bc,
  36. Eigen::MatrixXd& V_uv);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "lscm.cpp"
  40. #endif
  41. #endif