peel_outer_hull_layers.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H
  9. #define IGL_COPYLEFT_CGAL_PEEL_OUTER_HULL_LAYERS_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. // Computes necessary generic information for boolean operations by
  19. // successively "peeling" off the "outer hull" of a mesh (V,F) resulting from
  20. // "resolving" all (self-)intersections.
  21. //
  22. // Inputs:
  23. // V #V by 3 list of vertex positions
  24. // F #F by 3 list of triangle indices into V
  25. // Outputs:
  26. // I #F list of which peel Iation a facet belongs
  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 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. Eigen::PlainObjectBase<DerivedI > & I,
  39. Eigen::PlainObjectBase<Derivedflip > & flip);
  40. }
  41. }
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "peel_outer_hull_layers.cpp"
  45. #endif
  46. #endif