peel_outer_hull_layers.h 2.0 KB

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