cut_to_disk.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef IGL_CUT_TO_DISK_H
  2. #define IGL_CUT_TO_DISK_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <vector>
  6. #include <map>
  7. #include <set>
  8. #include <deque>
  9. #include <algorithm>
  10. namespace igl
  11. {
  12. // Given a triangle mesh, computes a set of edge cuts sufficient to carve the
  13. // mesh into a topological disk, without disconnecting any connected components.
  14. // Nothing else about the cuts (including number, total length, or smoothness)
  15. // is guaranteed to be optimal.
  16. //
  17. // Simply-connected components without boundary (topological spheres) are left
  18. // untouched (delete any edge if you really want a disk).
  19. // All other connected components are cut into disks. Meshes with boundary are
  20. // supported; boundary edges will be included as cuts.
  21. //
  22. // The cut mesh itself can be materialized using cut_mesh().
  23. //
  24. // Implements the triangle-deletion approach described by Gu et al's
  25. // "Geometry Images."
  26. //
  27. // Template Parameters:
  28. // Index Integrable type large enough to represent the total number of faces
  29. // and edges in the surface represented by F, and all entries of F.
  30. //
  31. // Inputs:
  32. // F #F by 3 list of the faces (must be triangles)
  33. //
  34. // Outputs:
  35. // cuts List of cuts. Each cut is a sequence of vertex indices (where
  36. // pairs of consecutive vertices share a face), is simple, and is either
  37. // a closed loop (in which the first and last indices are identical) or
  38. // an open curve. Cuts are edge-disjoint.
  39. //
  40. template <
  41. typename DerivedF,
  42. typename Index>
  43. IGL_INLINE void cut_to_disk(
  44. const Eigen::MatrixBase<DerivedF> &F,
  45. std::vector<std::vector<Index> > &cuts);
  46. };
  47. #ifndef IGL_STATIC_LIBRARY
  48. #include "cut_to_disk.cpp"
  49. #endif
  50. #endif