From e42b9baadb7359a38d206ce1fb60eefa9fa0da3b Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 1 Nov 2018 16:49:33 +0300 Subject: [PATCH] Another fix for storing generated faces in ExtrusionCut/Fuse and RevolutionCut/Fuse. Now they stored as generated faces from edges, without intermediate generated face. --- src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp | 10 ++++------ src/Model/Model_BodyBuilder.cpp | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index f1b693c5b..670dbe02a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -77,8 +77,6 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean() for(; aBoolObjIt != aBooleanObjects.cend() && aBoolMSIt != aBooleanMakeShapes.cend(); ++aBoolObjIt, ++aBoolMSIt) { - int aTag = 1; - ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex); if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) { @@ -88,14 +86,15 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean() { aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape()); - aTag += 5000; - // Store generation history. ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin(); ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin(); for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend(); ++aGenBaseIt, ++aGenMSIt) { - storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt); + std::shared_ptr aMSList(new GeomAlgoAPI_MakeShapeList()); + aMSList->appendAlgo(*aGenMSIt); + aMSList->appendAlgo(*aBoolMSIt); + storeGenerationHistory(aResultBody, *aGenBaseIt, aMSList); } storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt); @@ -383,7 +382,6 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the ListOfShape aTools = theTools; aTools.push_back(theObject); - std::string aName; for(ListOfShape::const_iterator anIt = aTools.begin(); anIt != aTools.end(); anIt++) { theResultBody->loadModifiedShapes(theMakeShape, *anIt, (*anIt)->shapeType() == GeomAPI_Shape::EDGE ? diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index a6e4446bb..c751bcba9 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -608,7 +608,9 @@ void Model_BodyBuilder::loadGeneratedShapes(const GeomMakeShapePtr& theAlgo, const TopoDS_Shape& aNewShape_ = aNewShape->impl(); bool aNewShapeIsSameAsOldShape = anOldSubShape->isSame(aNewShape); - if (aNewShapeIsSameAsOldShape) + bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(aNewShape, false); + if (aNewShapeIsSameAsOldShape + || aNewShapeIsNotInResultShape) { continue; } -- 2.39.2