extract_manifold_patches.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 manifold patches from a given mesh.
  8. // A maximal manifold patch is a subset of the input faces that is
  9. // connected and manifold, and it cannot be expanded further by
  10. // including more faces.
  11. //
  12. // Assumes the input mesh have all self-intersection resolved. See
  13. // ``igl::cgal::remesh_self_intersection`` for more details.
  14. //
  15. // Inputs:
  16. // F #F by 3 list representing triangles.
  17. // EMAP #F*3 list of indices of unique undirected edges.
  18. // uE2E #uE list of lists of indices into E of coexisting edges.
  19. //
  20. // Output:
  21. // P #F list of patch incides.
  22. //
  23. // Returns:
  24. // number of manifold patches.
  25. template <
  26. typename DerivedF,
  27. typename DerivedEMAP,
  28. typename uE2EType,
  29. typename DerivedP>
  30. IGL_INLINE size_t extract_manifold_patches(
  31. const Eigen::PlainObjectBase<DerivedF>& F,
  32. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  33. const std::vector<std::vector<uE2EType> >& uE2E,
  34. Eigen::PlainObjectBase<DerivedP>& P);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "extract_manifold_patches.cpp"
  38. #endif
  39. #endif