outer_hull.h 1.9 KB

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