project_isometrically_to_plane.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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_PROJECT_ISOMETRICALLY_TO_PLANE_H
  9. #define IGL_PROJECT_ISOMETRICALLY_TO_PLANE_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Project each triangle to the plane
  16. ///
  17. /// @param[in] V #V by 3 list of vertex positions
  18. /// @param[in] F #F by 3 list of mesh indices
  19. /// @param[out] U #F*3 by 2 list of triangle positions
  20. /// @param[out] UF #F by 3 list of mesh indices into U
  21. /// @param[out] I #V by #F*3 such that I(i,j) = 1 implies U(j,:) corresponds to V(i,:)
  22. ///
  23. template <
  24. typename DerivedV,
  25. typename DerivedF,
  26. typename DerivedU,
  27. typename DerivedUF,
  28. typename Scalar>
  29. IGL_INLINE void project_isometrically_to_plane(
  30. const Eigen::MatrixBase<DerivedV> & V,
  31. const Eigen::MatrixBase<DerivedF> & F,
  32. Eigen::PlainObjectBase<DerivedU> & U,
  33. Eigen::PlainObjectBase<DerivedUF> & UF,
  34. Eigen::SparseMatrix<Scalar>& I);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "project_isometrically_to_plane.cpp"
  38. #endif
  39. #endif