cut_to_disk.h 1.6 KB

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