per_corner_normals.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_PER_CORNER_NORMALS_H
  2. #define IGL_PER_CORNER_NORMALS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <vector>
  6. namespace igl
  7. {
  8. // Compute vertex normals via vertex position list, face list
  9. // Inputs:
  10. // V #V by 3 eigen Matrix of mesh vertex 3D positions
  11. // F #F by 3 eigne Matrix of face (triangle) indices
  12. // corner_threshold threshold in degrees on sharp angles
  13. // Output:
  14. // CN #F*3 by 3 eigen Matrix of mesh vertex 3D normals, where the normal
  15. // for corner F(i,j) is at CN(i*3+j,:)
  16. IGL_INLINE void per_corner_normals(
  17. const Eigen::MatrixXd & V,
  18. const Eigen::MatrixXi & F,
  19. const double corner_threshold,
  20. Eigen::MatrixXd & CN);
  21. // Other Inputs:
  22. // FN #F by 3 eigen Matrix of face normals
  23. // VF map from vertices to list of incident faces
  24. IGL_INLINE void per_corner_normals(
  25. const Eigen::MatrixXd & V,
  26. const Eigen::MatrixXi & F,
  27. const Eigen::MatrixXd & FN,
  28. const std::vector<std::vector<int> >& VF,
  29. const double corner_threshold,
  30. Eigen::MatrixXd & CN);
  31. }
  32. #ifdef IGL_HEADER_ONLY
  33. # include "per_corner_normals.cpp"
  34. #endif
  35. #endif