sharp_edges.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef IGL_SHARP_EDGES_H
  2. #define IGL_SHARP_EDGES_H
  3. #include <igl/igl_inline.h>
  4. #include <Eigen/Core>
  5. #include <vector>
  6. namespace igl
  7. {
  8. // SHARP_EDGES Given a mesh, compute sharp edges.
  9. //
  10. // Inputs:
  11. // V #V by 3 list of vertex positions
  12. // F #F by 3 list of triangle mesh indices into V
  13. // angle dihedral angle considered to sharp (e.g., igl::PI * 0.11)
  14. // Outputs:
  15. // SE #SE by 2 list of edge indices into V
  16. // uE #uE by 2 list of unique undirected edges
  17. // EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  18. // undirected edge so that uE(EMAP(f+#F*c)) is the unique edge
  19. // corresponding to E.row(f+#F*c)
  20. // uE2E #uE list of lists of indices into E of coexisting edges, so that
  21. // E.row(uE2E[i][j]) corresponds to uE.row(i) for all j in
  22. // 0..uE2E[i].size()-1.
  23. // sharp #SE list of indices into uE revealing sharp undirected edges
  24. template <
  25. typename DerivedV,
  26. typename DerivedF,
  27. typename DerivedSE,
  28. typename DerivedE,
  29. typename DeriveduE,
  30. typename DerivedEMAP,
  31. typename uE2Etype,
  32. typename sharptype>
  33. IGL_INLINE void sharp_edges(
  34. const Eigen::MatrixBase<DerivedV> & V,
  35. const Eigen::MatrixBase<DerivedF> & F,
  36. const typename DerivedV::Scalar angle,
  37. Eigen::PlainObjectBase<DerivedSE> & SE,
  38. Eigen::PlainObjectBase<DerivedE> & E,
  39. Eigen::PlainObjectBase<DeriveduE> & uE,
  40. Eigen::PlainObjectBase<DerivedEMAP> & EMAP,
  41. std::vector<std::vector<uE2Etype> > & uE2E,
  42. std::vector< sharptype > & sharp);
  43. template <
  44. typename DerivedV,
  45. typename DerivedF,
  46. typename DerivedSE>
  47. IGL_INLINE void sharp_edges(
  48. const Eigen::MatrixBase<DerivedV> & V,
  49. const Eigen::MatrixBase<DerivedF> & F,
  50. const typename DerivedV::Scalar angle,
  51. Eigen::PlainObjectBase<DerivedSE> & SE
  52. );
  53. }
  54. #ifndef IGL_STATIC_LIBRARY
  55. # include "sharp_edges.cpp"
  56. #endif
  57. #endif