mesh_boolean.h 1.8 KB

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