orientable_patches.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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_ORIENTABLE_PATCHES_H
  9. #define IGL_ORIENTABLE_PATCHES_H
  10. #include <igl/igl_inline.h>
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. // Compute connected components of facets connected by manifold edges.
  16. //
  17. // Known bugs: This will detect a moebius strip as a single patch (manifold,
  18. // non-orientable) and also non-manfiold, yet orientable patches.
  19. //
  20. // Q: Does this find exactly (manifold || orientable) patches?
  21. //
  22. // Inputs:
  23. // F #F by simplex-size list of facets
  24. // Outputs:
  25. // C #F list of component ids
  26. // A #F by #F adjacency matrix
  27. //
  28. template <typename DerivedF, typename DerivedC, typename AScalar>
  29. IGL_INLINE void orientable_patches(
  30. const Eigen::PlainObjectBase<DerivedF> & F,
  31. Eigen::PlainObjectBase<DerivedC> & C,
  32. Eigen::SparseMatrix<AScalar> & A);
  33. template <typename DerivedF, typename DerivedC>
  34. IGL_INLINE void orientable_patches(
  35. const Eigen::PlainObjectBase<DerivedF> & F,
  36. Eigen::PlainObjectBase<DerivedC> & C);
  37. };
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "orientable_patches.cpp"
  40. #endif
  41. #endif