internal_angles.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_INTERNAL_ANGLES_H
  9. #define IGL_INTERNAL_ANGLES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute internal angles for a triangle mesh
  15. //
  16. // Inputs:
  17. // V #V by dim eigen Matrix of mesh vertex nD positions
  18. // F #F by poly-size eigen Matrix of face (triangle) indices
  19. // Output:
  20. // K #F by poly-size eigen Matrix of internal angles
  21. // for triangles, columns correspond to edges [1,2],[2,0],[0,1]
  22. //
  23. // Known Issues:
  24. // if poly-size ≠ 3 then dim must equal 3.
  25. template <typename DerivedV, typename DerivedF, typename DerivedK>
  26. IGL_INLINE void internal_angles(
  27. const Eigen::PlainObjectBase<DerivedV>& V,
  28. const Eigen::PlainObjectBase<DerivedF>& F,
  29. Eigen::PlainObjectBase<DerivedK> & K);
  30. // Inputs:
  31. // L #F by 3 list of edge lengths
  32. template <typename DerivedL, typename DerivedK>
  33. IGL_INLINE void internal_angles(
  34. const Eigen::PlainObjectBase<DerivedL>& L,
  35. Eigen::PlainObjectBase<DerivedK> & K);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "internal_angles.cpp"
  39. #endif
  40. #endif