peel_outer_hull_layers.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_PEEL_OUTER_HULL_LAYERS_H
  9. #define IGL_PEEL_OUTER_HULL_LAYERS_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Computes necessary generic information for boolean operations by
  15. // successively "peeling" off the "outer hull" of a mesh (V,F) resulting from
  16. // "resolving" all (self-)intersections.
  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. // odd #F list of whether facet belongs to an odd iteration peel (otherwise
  24. // an even iteration peel)
  25. // flip #F list of whether a facet's orientation was flipped when facet
  26. // "peeled" into its associated outer hull layer.
  27. // Returns number of peels
  28. template <
  29. typename DerivedV,
  30. typename DerivedF,
  31. typename DerivedN,
  32. typename Derivedodd,
  33. typename Derivedflip>
  34. IGL_INLINE size_t peel_outer_hull_layers(
  35. const Eigen::PlainObjectBase<DerivedV > & V,
  36. const Eigen::PlainObjectBase<DerivedF > & F,
  37. const Eigen::PlainObjectBase<DerivedN > & N,
  38. Eigen::PlainObjectBase<Derivedodd > & odd,
  39. Eigen::PlainObjectBase<Derivedflip > & flip);
  40. template <
  41. typename DerivedV,
  42. typename DerivedF,
  43. typename Derivedodd,
  44. typename Derivedflip>
  45. IGL_INLINE size_t peel_outer_hull_layers(
  46. const Eigen::PlainObjectBase<DerivedV > & V,
  47. const Eigen::PlainObjectBase<DerivedF > & F,
  48. Eigen::PlainObjectBase<Derivedodd > & odd,
  49. Eigen::PlainObjectBase<Derivedflip > & flip);
  50. }
  51. #ifndef IGL_STATIC_LIBRARY
  52. # include "peel_outer_hull_layers.cpp"
  53. #endif
  54. #endif