peel_outer_hull_layers.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. // I #F list of which peel Iation a facet belongs
  26. // flip #F list of whether a facet's orientation was flipped when facet
  27. // "peeled" into its associated outer hull layer.
  28. // Returns number of peels
  29. template <
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename DerivedN,
  33. typename DerivedI,
  34. typename Derivedflip>
  35. IGL_INLINE size_t peel_outer_hull_layers(
  36. const Eigen::PlainObjectBase<DerivedV > & V,
  37. const Eigen::PlainObjectBase<DerivedF > & F,
  38. const Eigen::PlainObjectBase<DerivedN > & N,
  39. Eigen::PlainObjectBase<DerivedI > & I,
  40. Eigen::PlainObjectBase<Derivedflip > & flip);
  41. template <
  42. typename DerivedV,
  43. typename DerivedF,
  44. typename DerivedI,
  45. typename Derivedflip>
  46. IGL_INLINE size_t peel_outer_hull_layers(
  47. const Eigen::PlainObjectBase<DerivedV > & V,
  48. const Eigen::PlainObjectBase<DerivedF > & F,
  49. Eigen::PlainObjectBase<DerivedI > & I,
  50. Eigen::PlainObjectBase<Derivedflip > & flip);
  51. }
  52. }
  53. #ifndef IGL_STATIC_LIBRARY
  54. # include "peel_outer_hull_layers.cpp"
  55. #endif
  56. #endif