cut_to_disk.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /// @tparam Index Integrable type large enough to represent the total number of faces
  24. /// and edges in the surface represented by F, and all entries of F.
  25. /// @param[in] F #F by 3 list of the faces (must be triangles)
  26. /// @param[out] cuts List of cuts. Each cut is a sequence of vertex indices (where
  27. /// pairs of consecutive vertices share a face), is simple, and is either
  28. /// a closed loop (in which the first and last indices are identical) or
  29. /// an open curve. Cuts are edge-disjoint.
  30. ///
  31. template <
  32. typename DerivedF,
  33. typename Index>
  34. IGL_INLINE void cut_to_disk(
  35. const Eigen::MatrixBase<DerivedF> &F,
  36. std::vector<std::vector<Index> > &cuts);
  37. };
  38. #ifndef IGL_STATIC_LIBRARY
  39. #include "cut_to_disk.cpp"
  40. #endif
  41. #endif