dihedral_angles.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_DIHEDRAL_ANGLES_H
  9. #define IGL_DIHEDRAL_ANGLES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute dihedral angles for all tets of a given tet mesh (V,T).
  15. ///
  16. /// @param[in] V #V by dim list of vertex positions
  17. /// @param[in] T #V by 4 list of tet indices
  18. /// @param[out] theta #T by 6 list of dihedral angles (in radians)
  19. /// @param[out] cos_theta #T by 6 list of cosine of dihedral angles (in radians)
  20. ///
  21. template <
  22. typename DerivedV,
  23. typename DerivedT,
  24. typename Derivedtheta,
  25. typename Derivedcos_theta>
  26. IGL_INLINE void dihedral_angles(
  27. const Eigen::MatrixBase<DerivedV>& V,
  28. const Eigen::MatrixBase<DerivedT>& T,
  29. Eigen::PlainObjectBase<Derivedtheta>& theta,
  30. Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
  31. }
  32. #ifndef IGL_STATIC_LIBRARY
  33. # include "dihedral_angles.cpp"
  34. #endif
  35. #endif