cotmatrix_entries.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <[email protected]>
  4. // Copyright (C) 2018 Alec Jacobson <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_COTMATRIX_ENTRIES_H
  10. #define IGL_COTMATRIX_ENTRIES_H
  11. #include "igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. /// Compute the cotmatrix contributions (cotangents) of each angle in mesh (V,F)
  16. ///
  17. /// @param[in] V #V by dim list of rest domain positions
  18. /// @param[in] F #F by {3|4} list of {triangle|tetrahedra} indices into V
  19. /// @param[out] C #F by 3 list of 1/2*cotangents corresponding angles
  20. /// for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  21. /// or
  22. /// C #F by 6 list of 1/6*cotangents of dihedral angles*edge lengths
  23. /// for tets, columns along edges [1,2],[2,0],[0,1],[3,0],[3,1],[3,2]
  24. ///
  25. /// \see cotmatrix
  26. template <typename DerivedV, typename DerivedF, typename DerivedC>
  27. IGL_INLINE void cotmatrix_entries(
  28. const Eigen::MatrixBase<DerivedV>& V,
  29. const Eigen::MatrixBase<DerivedF>& F,
  30. Eigen::PlainObjectBase<DerivedC>& C);
  31. /// Compute the cotmatrix contributions (cotangents) of each angle in mesh with edge lengths (l)
  32. ///
  33. /// @param[in] l #F by 3 list of triangle edge lengths (see edge_lengths)
  34. /// @param[out] C #F by 3 list of 1/2*cotangents corresponding angles
  35. /// for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  36. ///
  37. /// \see cotmatrix
  38. template <typename Derivedl, typename DerivedC>
  39. IGL_INLINE void cotmatrix_entries(
  40. const Eigen::MatrixBase<Derivedl>& l,
  41. Eigen::PlainObjectBase<DerivedC>& C);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "cotmatrix_entries.cpp"
  45. #endif
  46. #endif