face_areas.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <[email protected]>
  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. /// @param[in] V #V by 3 list of mesh vertex positions
  17. /// @param[in] T #T by 3 list of tet mesh indices into V
  18. /// @param[out] A #T by 4 list of face areas corresponding to faces opposite vertices
  19. /// 0,1,2,3
  20. ///
  21. template <typename DerivedV, typename DerivedT, typename DerivedA>
  22. IGL_INLINE void face_areas(
  23. const Eigen::MatrixBase<DerivedV>& V,
  24. const Eigen::MatrixBase<DerivedT>& T,
  25. Eigen::PlainObjectBase<DerivedA>& A);
  26. /// \overload
  27. /// \brief Compute tet-mesh face areas from edge lengths.
  28. ///
  29. /// @param[in] L #T by 6 list of tet-mesh edge lengths corresponding to edges
  30. /// [3 0],[3 1],[3 2],[1 2],[2 0],[0 1]
  31. template <typename DerivedL, typename DerivedA>
  32. IGL_INLINE void face_areas(
  33. const Eigen::MatrixBase<DerivedL>& L,
  34. Eigen::PlainObjectBase<DerivedA>& A);
  35. /// \overload
  36. ///
  37. /// @param[in] doublearea_nan_replacement See doublearea.h
  38. template <typename DerivedL, typename DerivedA>
  39. IGL_INLINE void face_areas(
  40. const Eigen::MatrixBase<DerivedL>& L,
  41. const typename DerivedL::Scalar doublearea_nan_replacement,
  42. Eigen::PlainObjectBase<DerivedA>& A);
  43. }
  44. #ifndef IGL_STATIC_LIBRARY
  45. # include "face_areas.cpp"
  46. #endif
  47. #endif