cotmatrix_entries.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_COTMATRIX_ENTRIES_H
  9. #define IGL_COTMATRIX_ENTRIES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // COTMATRIX_ENTRIES compute the cotangents of each angle in mesh (V,F)
  15. //
  16. // Inputs:
  17. // V #V by dim list of rest domain positions
  18. // F #F by {3|4} list of {triangle|tetrahedra} indices into V
  19. // Outputs:
  20. // C #F by 3 list of 1/2*cotangents corresponding angles
  21. // for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  22. // OR
  23. // C #F by 6 list of 1/6*cotangents of dihedral angles*edge lengths
  24. // for tets, columns along edges [1,2],[2,0],[0,1],[3,0],[3,1],[3,2]
  25. //
  26. template <typename DerivedV, typename DerivedF, typename DerivedC>
  27. IGL_INLINE void cotmatrix_entries(
  28. const Eigen::PlainObjectBase<DerivedV>& V,
  29. const Eigen::PlainObjectBase<DerivedF>& F,
  30. Eigen::PlainObjectBase<DerivedC>& C);
  31. }
  32. #ifndef IGL_STATIC_LIBRARY
  33. # include "cotmatrix_entries.cpp"
  34. #endif
  35. #endif