face_areas.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_FACE_AREAS_H
  9. #define IGL_FACE_AREAS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. // Constructs a list of face areas of faces opposite each index in a tet list
  15. //
  16. // Templates:
  17. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  18. // DerivedT derived from face indices matrix type: i.e. MatrixXi
  19. // DerivedL derived from edge lengths matrix type: i.e. MatrixXd
  20. // Inputs:
  21. // V eigen matrix #V by 3
  22. // T #T by 3 list of mesh faces (must be triangles)
  23. // Outputs:
  24. // E #E by 2 list of edges in no particular order
  25. //
  26. // See also: adjacency_matrix
  27. template <typename DerivedV, typename DerivedT, typename DerivedA>
  28. IGL_INLINE void face_areas(
  29. const Eigen::PlainObjectBase<DerivedV>& V,
  30. const Eigen::PlainObjectBase<DerivedT>& T,
  31. Eigen::PlainObjectBase<DerivedA>& A);
  32. template <typename DerivedL, typename DerivedA>
  33. IGL_INLINE void face_areas(
  34. const Eigen::PlainObjectBase<DerivedL>& L,
  35. Eigen::PlainObjectBase<DerivedA>& A);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "face_areas.cpp"
  39. #endif
  40. #endif