project_isometrically_to_plane.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@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_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. // [U,UF,I] = project_isometrically_to_plane(V,F)
  18. //
  19. // Inputs:
  20. // V #V by 3 list of vertex positions
  21. // F #F by 3 list of mesh indices
  22. // Outputs:
  23. // U #F*3 by 2 list of triangle positions
  24. // UF #F by 3 list of mesh indices into U
  25. // I #V by #F such that I(i,j) = 1 implies U(j,:) corresponds to V(i,:)
  26. //
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename DerivedU,
  31. typename DerivedUF,
  32. typename Scalar>
  33. IGL_INLINE void project_isometrically_to_plane(
  34. const Eigen::PlainObjectBase<DerivedV> & V,
  35. const Eigen::PlainObjectBase<DerivedF> & F,
  36. Eigen::PlainObjectBase<DerivedU> & U,
  37. Eigen::PlainObjectBase<DerivedUF> & UF,
  38. Eigen::SparseMatrix<Scalar>& I);
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "project_isometrically_to_plane.cpp"
  42. #endif
  43. #endif