outer_hull.h 1.5 KB

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