local_basis.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef IGL_LOCALBASIS_H
  2. #define IGL_LOCALBASIS_H
  3. #include "igl/igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <string>
  6. #include <vector>
  7. namespace igl
  8. {
  9. // Compute a local orthogonal reference system for each triangle in the given mesh
  10. // Templates:
  11. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  12. // DerivedF derived from face indices matrix type: i.e. MatrixXi
  13. // Inputs:
  14. // V eigen matrix #V by 3
  15. // F #F by 3 list of mesh faces (must be triangles)
  16. // Outputs:
  17. // B1 eigen matrix #F by 3, each vector is tangent to the triangle
  18. // B2 eigen matrix #F by 3, each vector is tangent to the triangle and perpendicular to B1
  19. // B3 eigen matrix #F by 3, normal of the triangle
  20. //
  21. // See also: adjacency_matrix
  22. template <typename DerivedV, typename DerivedF>
  23. IGL_INLINE void local_basis(
  24. const Eigen::PlainObjectBase<DerivedV>& V,
  25. const Eigen::PlainObjectBase<DerivedF>& F,
  26. Eigen::PlainObjectBase<DerivedV>& B1,
  27. Eigen::PlainObjectBase<DerivedV>& B2,
  28. Eigen::PlainObjectBase<DerivedV>& B3
  29. );
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "local_basis.cpp"
  33. #endif
  34. #endif