extract_manifold_patches.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef IGL_EXTRACT_MANIFOLD_PATCHES
  2. #define IGL_EXTRACT_MANIFOLD_PATCHES
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. #include <vector>
  6. namespace igl {
  7. // Extract a set of maximal patches from a given mesh.
  8. // A maximal patch is a subset of the input faces that are connected via
  9. // manifold edges; a patch is as large as possible.
  10. //
  11. // Inputs:
  12. // F #F by 3 list representing triangles.
  13. // EMAP #F*3 list of indices of unique undirected edges.
  14. // uE2E #uE list of lists of indices into E of coexisting edges.
  15. //
  16. // Output:
  17. // P #F list of patch incides.
  18. //
  19. // Returns:
  20. // number of manifold patches.
  21. template <
  22. typename DerivedF,
  23. typename DerivedEMAP,
  24. typename uE2EType,
  25. typename DerivedP>
  26. IGL_INLINE size_t extract_manifold_patches(
  27. const Eigen::PlainObjectBase<DerivedF>& F,
  28. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  29. const std::vector<std::vector<uE2EType> >& uE2E,
  30. Eigen::PlainObjectBase<DerivedP>& P);
  31. template <
  32. typename DerivedF,
  33. typename DerivedP>
  34. IGL_INLINE size_t extract_manifold_patches(
  35. const Eigen::PlainObjectBase<DerivedF>& F,
  36. Eigen::PlainObjectBase<DerivedP>& P);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "extract_manifold_patches.cpp"
  40. #endif
  41. #endif