face_areas.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. // Inputs:
  17. // V #V by 3 list of mesh vertex positions
  18. // T #T by 3 list of tet mesh indices into V
  19. // Outputs:
  20. // A #T by 4 list of face areas corresponding to faces opposite vertices
  21. // 0,1,2,3
  22. //
  23. template <typename DerivedV, typename DerivedT, typename DerivedA>
  24. IGL_INLINE void face_areas(
  25. const Eigen::PlainObjectBase<DerivedV>& V,
  26. const Eigen::PlainObjectBase<DerivedT>& T,
  27. Eigen::PlainObjectBase<DerivedA>& A);
  28. // Compute tet-mesh face areas from edge lengths.
  29. //
  30. // Inputs:
  31. // L #T by 6 list of tet-mesh edge lengths corresponding to edges
  32. // [3 0],[3 1],[3 2],[1 2],[2 0],[0 1]
  33. // Outputs:
  34. // A #T by 4 list of face areas corresponding to faces opposite vertices
  35. // 0,1,2,3: i.e. made of edges [123],[024],[015],[345]
  36. //
  37. //
  38. template <typename DerivedL, typename DerivedA>
  39. IGL_INLINE void face_areas(
  40. const Eigen::PlainObjectBase<DerivedL>& L,
  41. Eigen::PlainObjectBase<DerivedA>& A);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "face_areas.cpp"
  45. #endif
  46. #endif