dihedral_angles.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_DIHEDRAL_ANGLES_H
  9. #define IGL_DIHEDRAL_ANGLES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // DIHEDRAL_ANGLES Compute dihedral angles for all tets of a given tet mesh
  15. // (V,T)
  16. //
  17. // theta = dihedral_angles(V,T)
  18. // theta = dihedral_angles(V,T,'ParameterName',parameter_value,...)
  19. //
  20. // Inputs:
  21. // V #V by dim list of vertex positions
  22. // T #V by 4 list of tet indices
  23. // Outputs:
  24. // theta #T by 6 list of dihedral angles (in radians)
  25. // cos_theta #T by 6 list of cosine of dihedral angles (in radians)
  26. //
  27. template <
  28. typename DerivedV,
  29. typename DerivedT,
  30. typename Derivedtheta,
  31. typename Derivedcos_theta>
  32. IGL_INLINE void dihedral_angles(
  33. Eigen::PlainObjectBase<DerivedV>& V,
  34. Eigen::PlainObjectBase<DerivedT>& T,
  35. Eigen::PlainObjectBase<Derivedtheta>& theta,
  36. Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
  37. template <
  38. typename DerivedL,
  39. typename DerivedA,
  40. typename Derivedtheta,
  41. typename Derivedcos_theta>
  42. IGL_INLINE void dihedral_angles_intrinsic(
  43. Eigen::PlainObjectBase<DerivedL>& L,
  44. Eigen::PlainObjectBase<DerivedA>& A,
  45. Eigen::PlainObjectBase<Derivedtheta>& theta,
  46. Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "dihedral_angles.cpp"
  50. #endif
  51. #endif