peel_outer_hull_layers.h 1.6 KB

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