sharp_edges.h 1.9 KB

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