dihedral_angles.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "dihedral_angles.h"
  9. #include "dihedral_angles_intrinsic.h"
  10. #include "edge_lengths.h"
  11. #include "face_areas.h"
  12. #include <cassert>
  13. template <
  14. typename DerivedV,
  15. typename DerivedT,
  16. typename Derivedtheta,
  17. typename Derivedcos_theta>
  18. IGL_INLINE void igl::dihedral_angles(
  19. const Eigen::MatrixBase<DerivedV>& V,
  20. const Eigen::MatrixBase<DerivedT>& T,
  21. Eigen::PlainObjectBase<Derivedtheta>& theta,
  22. Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
  23. {
  24. assert(T.cols() == 4);
  25. Eigen::Matrix<typename Derivedtheta::Scalar ,Eigen::Dynamic,6> l;
  26. edge_lengths(V,T,l);
  27. Eigen::Matrix<typename Derivedtheta::Scalar ,Eigen::Dynamic,4> s;
  28. face_areas(l,s);
  29. return dihedral_angles_intrinsic(l,s,theta,cos_theta);
  30. }
  31. #ifdef IGL_STATIC_LIBRARY
  32. // Explicit template instantiation
  33. template void igl::dihedral_angles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  34. #endif