cut_mesh_from_singularities.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@gmail.com>, 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_CUT_MESH_FROM_SINGULARITIES_H
  9. #define IGL_CUT_MESH_FROM_SINGULARITIES_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Given a mesh (V,F) and the integer mismatch of a cross field per edge (MMatch),
  15. // finds the cut_graph connecting the singularities (seams) and the degree of the singularities
  16. // singularity_index
  17. //
  18. // Input:
  19. // V: #V by 3 list of mesh vertex positions
  20. // F: #F by 3 list of faces
  21. // MMatch: #F by 3 list of per corner integer mismatch
  22. // is_singularity: #V by 1 list of booleans that denotes if a vertex is a singularity
  23. // singularity_index: #V by 1 list of degree of the singularity
  24. // seams: #F by 3 list of per corner booleans that denotes if an edge is a seam or not
  25. //
  26. // TODO: remove is_singularity, it is redundant
  27. // make the name of the variables consistent in the cpp
  28. template <typename DerivedV, typename DerivedF, typename DerivedM, typename DerivedS, typename DerivedO>
  29. IGL_INLINE void cut_mesh_from_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
  30. const Eigen::PlainObjectBase<DerivedF> &F,
  31. const Eigen::PlainObjectBase<DerivedM> &MMatch,
  32. const Eigen::PlainObjectBase<DerivedS> &is_singularity,
  33. const Eigen::PlainObjectBase<DerivedS> &singularity_index,
  34. Eigen::PlainObjectBase<DerivedO> &seams);
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. #include "cut_mesh_from_singularities.cpp"
  38. #endif
  39. #endif