doublearea.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef IGL_DOUBLEAREA_H
  2. #define IGL_DOUBLEAREA_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. namespace igl
  6. {
  7. // DOUBLEAREA computes twice the area for each input triangle
  8. //
  9. // Templates:
  10. // DerivedV derived type of eigen matrix for V (e.g. derived from
  11. // MatrixXd)
  12. // DerivedF derived type of eigen matrix for F (e.g. derived from
  13. // MatrixXi)
  14. // DeriveddblA derived type of eigen matrix for dblA (e.g. derived from
  15. // MatrixXd)
  16. // Inputs:
  17. // V #V by dim list of mesh vertex positions
  18. // F #F by simplex_size list of mesh faces (must be triangles)
  19. // Outputs:
  20. // dblA #F list of triangle double areas
  21. template <typename DerivedV, typename DerivedF, typename DeriveddblA>
  22. IGL_INLINE void doublearea(
  23. const Eigen::PlainObjectBase<DerivedV> & V,
  24. const Eigen::PlainObjectBase<DerivedF> & F,
  25. Eigen::PlainObjectBase<DeriveddblA> & dblA);
  26. // Same as above but use instrinsic edge lengths rather than (V,F) mesh
  27. // Templates:
  28. // DerivedV derived type of eigen matrix for V (e.g. derived from
  29. // MatrixXd)
  30. // DerivedF derived type of eigen matrix for F (e.g. derived from
  31. // MatrixXi)
  32. // DeriveddblA derived type of eigen matrix for dblA (e.g. derived from
  33. // MatrixXd)
  34. // Inputs:
  35. // l #F by dim list of edge lengths using
  36. // for triangles, columns correspond to edges 23,31,12
  37. // Outputs:
  38. // dblA #F list of triangle double areas
  39. template <typename Derivedl, typename DeriveddblA>
  40. IGL_INLINE void doublearea(
  41. const Eigen::PlainObjectBase<Derivedl> & l,
  42. Eigen::PlainObjectBase<DeriveddblA> & dblA);
  43. }
  44. #ifdef IGL_HEADER_ONLY
  45. # include "doublearea.h"
  46. #endif
  47. #endif