peel_outer_hull_layers.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // Outputs:
  24. // I #F list of which peel Iation a facet belongs
  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 DerivedI,
  32. typename Derivedflip>
  33. IGL_INLINE size_t peel_outer_hull_layers(
  34. const Eigen::PlainObjectBase<DerivedV > & V,
  35. const Eigen::PlainObjectBase<DerivedF > & F,
  36. Eigen::PlainObjectBase<DerivedI > & I,
  37. Eigen::PlainObjectBase<Derivedflip > & flip);
  38. }
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "peel_outer_hull_layers.cpp"
  42. #endif
  43. #endif