Salome HOME
Fix for the issue #3033: ExtrusionCut error
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_CompositeBoolean.cpp
index d10c82d852ff728393fc144d6cfcf34e01ffda99..cfe002fb0b1ff080ad3d279ac92825f87d85b8e5 100644 (file)
@@ -225,17 +225,20 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools,
         aMakeShapeList->appendAlgo(aBoolAlgo);
 
         // Add result to not used solids from compsolid.
-        aShapesToAdd.push_back(aBoolAlgo->shape());
-        std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
-          new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-        if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) {
-          myFeature->setError("Error: PaveFiller algorithm failed.");
-          return false;
+        GeomShapePtr aBoolRes = aBoolAlgo->shape();
+        if (!aShapesToAdd.empty()) {
+          aShapesToAdd.push_back(aBoolRes);
+          std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+            new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+          if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) {
+            myFeature->setError("Error: PaveFiller algorithm failed.");
+            return false;
+          }
+          aBoolRes = aFillerAlgo->shape();
+          aMakeShapeList->appendAlgo(aFillerAlgo);
         }
 
-        aMakeShapeList->appendAlgo(aFillerAlgo);
-
-        if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-27) {
+        if(GeomAlgoAPI_ShapeTools::volume(aBoolRes) > 1.e-27) {
           theObjects.push_back(aCompSolid);
           theMakeShapes.push_back(aMakeShapeList);
         }