outer_hull_legacy.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_COPYLEFT_CGAL_OUTER_HULL_LEGACY_H
  9. #define IGL_COPYLEFT_CGAL_OUTER_HULL_LEGACY_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. /// Compute the "outer hull" of a potentially non-manifold mesh (V,F) whose
  19. /// intersections have been "resolved" (e.g. using `cork` or
  20. /// `igl::copyleft::cgal::selfintersect`). The outer hull is defined to be all facets
  21. /// (regardless of orientation) for which there exists some path from infinity
  22. /// to the face without intersecting any other facets. For solids, this is the
  23. /// surface of the solid. In general this includes any thin "wings" or
  24. /// "flaps". This implementation largely follows Section 3.6 of "Direct
  25. /// repair of self-intersecting meshes" [Attene 2014].
  26. ///
  27. /// \note This doesn't require the input mesh to be piecewise constant
  28. /// winding number, but won't handle multiple non-nested connected
  29. /// components.
  30. ///
  31. /// @param[in] V #V by 3 list of vertex positions
  32. /// @param[in] F #F by 3 list of triangle indices into V
  33. /// @param[out] G #G by 3 list of output triangle indices into V
  34. /// @param[out] J #G list of indices into F
  35. /// @param[out] flip #F list of whether facet was added to G **and** flipped orientation
  36. /// (false for faces not added to G)
  37. template <
  38. typename DerivedV,
  39. typename DerivedF,
  40. typename DerivedG,
  41. typename DerivedJ,
  42. typename Derivedflip>
  43. IGL_INLINE void outer_hull_legacy(
  44. const Eigen::MatrixBase<DerivedV> & V,
  45. const Eigen::MatrixBase<DerivedF> & F,
  46. Eigen::PlainObjectBase<DerivedG> & G,
  47. Eigen::PlainObjectBase<DerivedJ> & J,
  48. Eigen::PlainObjectBase<Derivedflip> & flip);
  49. }
  50. }
  51. }
  52. #ifndef IGL_STATIC_LIBRARY
  53. # include "outer_hull_legacy.cpp"
  54. #endif
  55. #endif