parallel_transport_angles.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Olga Diamanti <olga.diam@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_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. // Inputs:
  19. // V #V by 3 list of mesh vertex coordinates
  20. // F #F by 3 list of mesh faces (must be triangles)
  21. // FN #F by 3 list of face normals
  22. // E2F #E by 2 list of the edge-to-face relation (e.g. computed
  23. // via igl::edge_topology)
  24. // F2E #F by 3 list of the face-to-edge relation (e.g. computed
  25. // via igl::edge_topology)
  26. // Output:
  27. // K #E by 1 list of the parallel transport angles (zero
  28. // for all boundary edges)
  29. //
  30. template <typename DerivedV, typename DerivedF, typename DerivedK>
  31. IGL_INLINE void parallel_transport_angles(
  32. const Eigen::PlainObjectBase<DerivedV>&V,
  33. const Eigen::PlainObjectBase<DerivedF>&F,
  34. const Eigen::PlainObjectBase<DerivedV>&FN,
  35. const Eigen::MatrixXi &E2F,
  36. const Eigen::MatrixXi &F2E,
  37. Eigen::PlainObjectBase<DerivedK>&K);
  38. };
  39. #ifndef IGL_STATIC_LIBRARY
  40. #include "parallel_transport_angles.cpp"
  41. #endif
  42. #endif /* defined(IGL_PARALLEL_TRANSPORT_ANGLE) */