mesh_boolean_cork.h 1.7 KB

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