From 3a3609cb2e2f171082ca2e807e6c8c8ba24d1075 Mon Sep 17 00:00:00 2001 From: dbv Date: Mon, 24 Aug 2015 18:51:01 +0300 Subject: [PATCH] Fix exception when collecting shells for compsolids --- src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp | 8 +++----- src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp | 6 ++---- src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp | 6 ++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index f0876e1f1..261a32931 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -126,13 +126,11 @@ void FeaturesPlugin_CompositeBoolean::execute() ListOfShape aFreeFaces; std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aFacesList); GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); - if(aShells.empty()) { - aShells = aFreeFaces; - } else { - aShells.merge(aFreeFaces); + for(ListOfShape::const_iterator anIter = aFreeFaces.cbegin(); anIter != aFreeFaces.cend(); anIter++) { + aShells.push_back(*anIter); } - // Pass shells/faces to soldis creation function. + // Pass shells/faces to solids creation function. ListOfShape aBooleanTools; std::list> aSolidsAlgos; makeSolids(aShells, aBooleanTools, aSolidsAlgos); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 09e3e3c14..f76a68460 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -133,10 +133,8 @@ void FeaturesPlugin_Extrusion::execute() ListOfShape aFreeFaces; std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aFacesList); GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); - if(aShells.empty()) { - aShells = aFreeFaces; - } else { - aShells.merge(aFreeFaces); + for(ListOfShape::const_iterator anIter = aFreeFaces.cbegin(); anIter != aFreeFaces.cend(); anIter++) { + aShells.push_back(*anIter); } // Generating result for each shell and face. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp index 52b00ffc1..503c1c8a9 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp @@ -143,10 +143,8 @@ void FeaturesPlugin_Revolution::execute() ListOfShape aFreeFaces; std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aFacesList); GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); - if(aShells.empty()) { - aShells = aFreeFaces; - } else { - aShells.merge(aFreeFaces); + for(ListOfShape::const_iterator anIter = aFreeFaces.cbegin(); anIter != aFreeFaces.cend(); anIter++) { + aShells.push_back(*anIter); } // Generating result for each shell and face. -- 2.39.2