peel_outer_hull_layers.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef IGL_CGAL_PEEL_OUTER_HULL_LAYERS_H
  2. #define IGL_CGAL_PEEL_OUTER_HULL_LAYERS_H
  3. #include "../igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. namespace cgal
  8. {
  9. // Computes necessary generic information for boolean operations by
  10. // successively "peeling" off the "outer hull" of a mesh (V,F) resulting from
  11. // "resolving" all (self-)intersections.
  12. //
  13. // Inputs:
  14. // V #V by 3 list of vertex positions
  15. // F #F by 3 list of triangle indices into V
  16. // N #F by 3 list of per-face normals
  17. // Outputs:
  18. // odd #F list of whether facet belongs to an odd iteration peel (otherwise
  19. // an even iteration peel)
  20. // flip #F list of whether a facet's orientation was flipped when facet
  21. // "peeled" into its associated outer hull layer.
  22. // Returns number of peels
  23. template <
  24. typename DerivedV,
  25. typename DerivedF,
  26. typename DerivedN,
  27. typename Derivedodd,
  28. typename Derivedflip>
  29. IGL_INLINE size_t peel_outer_hull_layers(
  30. const Eigen::PlainObjectBase<DerivedV > & V,
  31. const Eigen::PlainObjectBase<DerivedF > & F,
  32. const Eigen::PlainObjectBase<DerivedN > & N,
  33. Eigen::PlainObjectBase<Derivedodd > & odd,
  34. Eigen::PlainObjectBase<Derivedflip > & flip);
  35. template <
  36. typename DerivedV,
  37. typename DerivedF,
  38. typename Derivedodd,
  39. typename Derivedflip>
  40. IGL_INLINE size_t peel_outer_hull_layers(
  41. const Eigen::PlainObjectBase<DerivedV > & V,
  42. const Eigen::PlainObjectBase<DerivedF > & F,
  43. Eigen::PlainObjectBase<Derivedodd > & odd,
  44. Eigen::PlainObjectBase<Derivedflip > & flip);
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "peel_outer_hull_layers.cpp"
  49. #endif
  50. #endif