cotangent.h 893 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_COTANGENT_H
  2. #define IGL_COTANGENT_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // COTANGENT compute the cotangents of each angle in mesh (V,F)
  7. //
  8. // Templates:
  9. // MatV vertex position matrix, e.g. Eigen::MatrixXd
  10. // MatF face index matrix, e.g. Eigen::MatrixXd
  11. // MatC cotangent weights matrix, e.g. Eigen::MatrixXd
  12. // Inputs:
  13. // V #V by dim list of rest domain positions
  14. // F #F by {3|4} list of {triangle|tetrahedra} indices into V
  15. // Outputs:
  16. // C #F by {3|6} list of cotangents corresponding angles
  17. // for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  18. // for tets, columns correspond to edges [1,2],[2,0],[0,1],[3,0],[3,1],[3,2]
  19. template <class MatV, class MatF, class MatC>
  20. IGL_INLINE void cotangent(const MatV & V, const MatF & F, MatC & C);
  21. }
  22. #ifdef IGL_HEADER_ONLY
  23. # include "cotangent.cpp"
  24. #endif
  25. #endif