outer_hull.h 2.1 KB

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