outer_hull.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. // N #F by 3 list of per-face normals
  20. // Outputs:
  21. // G #G by 3 list of output triangle indices into V
  22. // J #G list of indices into F
  23. // flip #F list of whether facet was added to G **and** flipped orientation
  24. // (false for faces not added to G)
  25. template <
  26. typename DerivedV,
  27. typename DerivedF,
  28. typename DerivedN,
  29. typename DerivedG,
  30. typename DerivedJ,
  31. typename Derivedflip>
  32. IGL_INLINE void outer_hull(
  33. const Eigen::PlainObjectBase<DerivedV> & V,
  34. const Eigen::PlainObjectBase<DerivedF> & F,
  35. const Eigen::PlainObjectBase<DerivedN> & N,
  36. Eigen::PlainObjectBase<DerivedG> & G,
  37. Eigen::PlainObjectBase<DerivedJ> & J,
  38. Eigen::PlainObjectBase<Derivedflip> & flip);
  39. template <
  40. typename DerivedV,
  41. typename DerivedF,
  42. typename DerivedG,
  43. typename DerivedJ,
  44. typename Derivedflip>
  45. IGL_INLINE void outer_hull(
  46. const Eigen::PlainObjectBase<DerivedV> & V,
  47. const Eigen::PlainObjectBase<DerivedF> & F,
  48. Eigen::PlainObjectBase<DerivedG> & G,
  49. Eigen::PlainObjectBase<DerivedJ> & J,
  50. Eigen::PlainObjectBase<Derivedflip> & flip);
  51. }
  52. #ifndef IGL_STATIC_LIBRARY
  53. # include "outer_hull.cpp"
  54. #endif
  55. #endif