polyvector_field_cut_mesh_with_singularities.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Olga Diamanti <olga.diam@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_POLYVECTOR_FIELD_CUT_MESH_WITH_SINGULARITIES
  9. #define IGL_POLYVECTOR_FIELD_CUT_MESH_WITH_SINGULARITIES
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl {
  14. // Given a mesh and the singularities of a polyvector field, cut the mesh
  15. // to disk topology in such a way that the singularities lie at the boundary of
  16. // the disk, as described in the paper "Mixed Integer Quadrangulation" by
  17. // Bommes et al. 2009.
  18. // Inputs:
  19. // V #V by 3 list of the vertex positions
  20. // F #F by 3 list of the faces (must be triangles)
  21. // VF #V list of lists of incident faces (adjacency list), e.g.
  22. // as returned by igl::vertex_triangle_adjacency
  23. // VV #V list of lists of incident vertices (adjacency list), e.g.
  24. // as returned by igl::adjacency_list
  25. // TT #F by 3 triangle to triangle adjacent matrix (e.g. computed
  26. // via igl:triangle_triangle_adjacency)
  27. // TTi #F by 3 adjacent matrix, the element i,j is the id of edge of the
  28. // triangle TT(i,j) that is adjacent with triangle i (e.g. computed
  29. // via igl:triangle_triangle_adjacency)
  30. // singularities #S by 1 list of the indices of the singular vertices
  31. // Outputs:
  32. // cuts #F by 3 list of boolean flags, indicating the edges that need to be cut
  33. // (has 1 at the face edges that are to be cut, 0 otherwise)
  34. //
  35. template <typename DerivedV, typename DerivedF, typename VFType, typename VVType, typename DerivedTT, typename DerivedC, typename DerivedS>
  36. IGL_INLINE void polyvector_field_cut_mesh_with_singularities(
  37. const Eigen::PlainObjectBase<DerivedV> &V,
  38. const Eigen::PlainObjectBase<DerivedF> &F,
  39. const std::vector<std::vector<VFType> >& VF,
  40. const std::vector<std::vector<VVType> >& VV,
  41. const Eigen::PlainObjectBase<DerivedTT>& TT,
  42. const Eigen::PlainObjectBase<DerivedTT>& TTi,
  43. const Eigen::PlainObjectBase<DerivedS> &singularities,
  44. Eigen::PlainObjectBase<DerivedC> &cuts);
  45. //Wrapper of the above with only vertices and faces as mesh input
  46. template <typename DerivedV, typename DerivedF, typename DerivedC, typename DerivedS>
  47. IGL_INLINE void polyvector_field_cut_mesh_with_singularities(
  48. const Eigen::PlainObjectBase<DerivedV> &V,
  49. const Eigen::PlainObjectBase<DerivedF> &F,
  50. const Eigen::PlainObjectBase<DerivedS> &singularities,
  51. Eigen::PlainObjectBase<DerivedC> &cuts);
  52. };
  53. #ifndef IGL_STATIC_LIBRARY
  54. #include "polyvector_field_cut_mesh_with_singularities.cpp"
  55. #endif
  56. #endif /* defined(IGL_POLYVECTOR_FIELD_CUT_MESH_WITH_SINGULARITIES) */