diff --git a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.cxx b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.cxx index e1716a6..39dd81a 100644 --- a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.cxx +++ b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.cxx @@ -199,14 +199,25 @@ int stkLibiglBoolean3DMesher::RequestData(vtkInformation *, Eigen::MatrixXi outputMeshCells; try { - if (this->Mode >= Modes::UNION && this->Mode <= Modes::DIFFERENCE) - { + if (this->Mode == stkLibiglBoolean3DMesher::Modes::UNION) { + igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells, + inputMeshBVerts, inputMeshBCells, + igl::MeshBooleanType::MESH_BOOLEAN_TYPE_UNION, + outputMeshVerts, outputMeshCells); + } + else if (this->Mode == stkLibiglBoolean3DMesher::Modes::INTERSECTION) { igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells, inputMeshBVerts, inputMeshBCells, - static_cast(this->Mode), + igl::MeshBooleanType::MESH_BOOLEAN_TYPE_INTERSECT, + outputMeshVerts, outputMeshCells); + } + else if (this->Mode == stkLibiglBoolean3DMesher::Modes::DIFFERENCE) { + igl::copyleft::cgal::mesh_boolean(inputMeshAVerts, inputMeshACells, + inputMeshBVerts, inputMeshBCells, + igl::MeshBooleanType::MESH_BOOLEAN_TYPE_MINUS, outputMeshVerts, outputMeshCells); } - else if (this->Mode == Modes::DIFFERENCE2) + else if (this->Mode == stkLibiglBoolean3DMesher::Modes::DIFFERENCE2) { igl::copyleft::cgal::mesh_boolean(inputMeshBVerts, inputMeshBCells, inputMeshAVerts, inputMeshACells, diff --git a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.h b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.h index 71f0ec8..76a5ad0 100644 --- a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.h +++ b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglBoolean3DMesher.h @@ -18,7 +18,7 @@ class STKLIBIGLCOPYLEFT_EXPORT stkLibiglBoolean3DMesher : public vtkPolyDataAlgo vtkPolyData* GetInputMeshB(); enum Modes { - UNION = 0, + UNION = 1, INTERSECTION, DIFFERENCE, DIFFERENCE2 diff --git a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglCopyleftPlugins.xml b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglCopyleftPlugins.xml index 0257902..7285faa 100644 --- a/Plugins/Libigl/stkLibiglCopyleft/stkLibiglCopyleftPlugins.xml +++ b/Plugins/Libigl/stkLibiglCopyleft/stkLibiglCopyleftPlugins.xml @@ -24,10 +24,10 @@ - - - - + + + + Set the boolean operation to perform.