cotangent.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_COTANGENT_H
  9. #define IGL_COTANGENT_H
  10. #include "igl_inline.h"
  11. namespace igl
  12. {
  13. // COTANGENT compute the cotangents of each angle in mesh (V,F)
  14. //
  15. // Templates:
  16. // MatV vertex position matrix, e.g. Eigen::MatrixXd
  17. // MatF face index matrix, e.g. Eigen::MatrixXd
  18. // MatC cotangent weights matrix, e.g. Eigen::MatrixXd
  19. // Inputs:
  20. // V #V by dim list of rest domain positions
  21. // F #F by {3|4} list of {triangle|tetrahedra} indices into V
  22. // Outputs:
  23. // C #F by {3|6} list of cotangents corresponding angles
  24. // for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  25. // for tets, columns correspond to edges [1,2],[2,0],[0,1],[3,0],[3,1],[3,2]
  26. template <class MatV, class MatF, class MatC>
  27. IGL_INLINE void cotangent(const MatV & V, const MatF & F, MatC & C);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "cotangent.cpp"
  31. #endif
  32. #endif