mesh_boolean_cork.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 MESH_BOOLEAN_CORK_H
  9. #define MESH_BOOLEAN_CORK_H
  10. #ifndef IGL_NO_CORK
  11. #include "MeshBooleanType.h"
  12. #include <igl/igl_inline.h>
  13. #include <Eigen/Core>
  14. #include <cork.h> // for consistent uint
  15. namespace igl
  16. {
  17. // Compute a boolean operation on two input meshes using the cork library.
  18. //
  19. // Inputs:
  20. // VA #VA by 3 list of vertex positions of first mesh
  21. // FA #FA by 3 list of triangle indices into VA
  22. // VB #VB by 3 list of vertex positions of second mesh
  23. // FB #FB by 3 list of triangle indices into VB
  24. // type of boolean operation see MeshBooleanType.h
  25. // Outputs:
  26. // VC #VC by 3 list of vertex positions of output mesh
  27. // FC #FC by 3 list of triangle indices into VC
  28. template <
  29. typename DerivedVA,
  30. typename DerivedFA,
  31. typename DerivedVB,
  32. typename DerivedFB,
  33. typename DerivedVC,
  34. typename DerivedFC>
  35. IGL_INLINE void mesh_boolean_cork(
  36. const Eigen::PlainObjectBase<DerivedVA > & VA,
  37. const Eigen::PlainObjectBase<DerivedFA > & FA,
  38. const Eigen::PlainObjectBase<DerivedVB > & VB,
  39. const Eigen::PlainObjectBase<DerivedFB > & FB,
  40. const MeshBooleanType & type,
  41. Eigen::PlainObjectBase<DerivedVC > & VC,
  42. Eigen::PlainObjectBase<DerivedFC > & FC);
  43. }
  44. #ifndef IGL_STATIC_LIBRARY
  45. # include "mesh_boolean_cork.cpp"
  46. #endif
  47. #endif
  48. #endif