parallel_transport_angles.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Olga Diamanti <[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_PARALLEL_TRANSPORT_ANGLE
  9. #define IGL_PARALLEL_TRANSPORT_ANGLE
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl {
  14. /// Given the per-face local bases computed via igl::local_basis, this function
  15. /// computes the angle between the two reference frames across each edge.
  16. /// Any two vectors across the edge whose 2D representation only differs by
  17. /// this angle are considered to be parallel.
  18. ///
  19. /// @param[in] V #V by 3 list of mesh vertex coordinates
  20. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  21. /// @param[in] FN #F by 3 list of face normals
  22. /// @param[in] E2F #E by 2 list of the edge-to-face relation (e.g. computed
  23. /// via igl::edge_topology)
  24. /// @param[in] F2E #F by 3 list of the face-to-edge relation (e.g. computed
  25. /// @param[out] K #E by 1 list of the parallel transport angles (zero
  26. /// for all boundary edges)
  27. ///
  28. template <typename DerivedV, typename DerivedF, typename DerivedK>
  29. IGL_INLINE void parallel_transport_angles(
  30. const Eigen::PlainObjectBase<DerivedV>&V,
  31. const Eigen::PlainObjectBase<DerivedF>&F,
  32. const Eigen::PlainObjectBase<DerivedV>&FN,
  33. const Eigen::MatrixXi &E2F,
  34. const Eigen::MatrixXi &F2E,
  35. Eigen::PlainObjectBase<DerivedK>&K);
  36. };
  37. #ifndef IGL_STATIC_LIBRARY
  38. #include "parallel_transport_angles.cpp"
  39. #endif
  40. #endif /* defined(IGL_PARALLEL_TRANSPORT_ANGLE) */