From d40494cbcddd82f8cb02ce72435ef7bde0986d7b Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 15 May 2019 08:17:42 +0300 Subject: [PATCH] Fix regression in Partition feature --- src/FeaturesPlugin/FeaturesPlugin_Partition.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index 83a87047e..514fbdf83 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -258,12 +258,15 @@ bool FeaturesPlugin_Partition::cutSubs( // cut subs bool isOk = true; - for (; anIt != theHierarchy.End() && isOk; ++anIt) { + for (++anIt; anIt != theHierarchy.End() && isOk; ++anIt) { ListOfShape aUsed, aNotUsed; GeomShapePtr aParent = theHierarchy.Parent(*anIt); - if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID) + if (aParent && aParent->shapeType() <= GeomAPI_Shape::COMPSOLID) { theHierarchy.SplitCompound(aParent, aUsed, aNotUsed); + if (aParent->shapeType() == GeomAPI_Shape::COMPOUND) + aNotUsed.clear(); // do not cut unused subshapes of compound + } else aUsed.push_back(*anIt); -- 2.39.2