split_nonmanifold.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2022 Alec Jacobson <[email protected]>
  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_SPLIT_NONMANIFOLD_H
  9. #define IGL_SPLIT_NONMANIFOLD_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Split a non-manifold (or non-orientable) mesh into a orientable manifold
  15. /// mesh possibly with more connected components and geometrically duplicate
  16. /// vertices.
  17. ///
  18. /// @param[in] F #F by 3 list of mesh triangle indices into rows of some V
  19. /// @param[out] SF #F by 3 list of mesh triangle indices into rows of a new vertex list
  20. /// SV = V(SVI,:)
  21. /// @param[out] SVI #SV list of indices into V identifying vertex positions
  22. template <
  23. typename DerivedF,
  24. typename DerivedSF,
  25. typename DerivedSVI
  26. >
  27. IGL_INLINE void split_nonmanifold(
  28. const Eigen::MatrixBase<DerivedF> & F,
  29. Eigen::PlainObjectBase <DerivedSF> & SF,
  30. Eigen::PlainObjectBase <DerivedSVI> & SVI);
  31. /// \overload
  32. /// @param[in] V #V by dim explicit list of vertex positions
  33. /// @param[out] SV #SV by dim explicit list of vertex positions
  34. template <
  35. typename DerivedV,
  36. typename DerivedF,
  37. typename DerivedSV,
  38. typename DerivedSF,
  39. typename DerivedSVI
  40. >
  41. IGL_INLINE void split_nonmanifold(
  42. const Eigen::MatrixBase<DerivedV> & V,
  43. const Eigen::MatrixBase<DerivedF> & F,
  44. Eigen::PlainObjectBase <DerivedSV> & SV,
  45. Eigen::PlainObjectBase <DerivedSF> & SF,
  46. Eigen::PlainObjectBase <DerivedSVI> & SVI);
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "split_nonmanifold.cpp"
  50. #endif
  51. #endif