lscm.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 algorithm
  16. // presented in: Spectral Conformal Parameterization,
  17. // Patrick Mullen, Yiying Tong, Pierre Alliez and Mathieu Desbrun
  18. // Note: (V,F) must be a genus-0 mesh, with a single boundary
  19. //
  20. // Inputs:
  21. // V #V by 3 list of mesh vertex positions
  22. // F #F by 3 list of mesh faces (must be triangles)
  23. // b #b boundary indices into V
  24. // bc #b by #W list of boundary values
  25. // Outputs:
  26. // UV #V by 2 list of 2D mesh vertex positions in UV space
  27. //
  28. // Note: if b and bc are empty, lscm automatically removes the null space
  29. // by fixing two farthest points on the boundary
  30. IGL_INLINE Eigen::MatrixXd lscm(
  31. const Eigen::MatrixXd& V,
  32. const Eigen::MatrixXi& F,
  33. const Eigen::VectorXi& b,
  34. const Eigen::MatrixXd& bc);
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. # include "lscm.cpp"
  38. #endif
  39. #endif