// Collecting solids from compsolids which will not be modified
// in boolean operation and will be added to result.
+ bool isProcessCompsolid = !isSimpleCreation || aFuseVersion >= THE_FUSE_VERSION_1;
ListOfShape aShapesToAdd;
for (ObjectHierarchy::Iterator anObjectsIt = anObjectsHierarchy.Begin();
- anObjectsIt != anObjectsHierarchy.End(); ++anObjectsIt) {
+ isProcessCompsolid && anObjectsIt != anObjectsHierarchy.End();
+ ++anObjectsIt) {
GeomShapePtr anObject = *anObjectsIt;
GeomShapePtr aParent = anObjectsHierarchy.Parent(anObject, false);
aMakeShapeList->appendAlgo(aCutAlgo);
}
}
- anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(),
- anEdgesAndFaces.end());
+
+ if (aShapesToAdd.empty() || !aCuttedEdgesAndFaces) {
+ anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(),
+ anEdgesAndFaces.end());
+ }
// If we have compsolids then cut with not used solids all others.
if (!aShapesToAdd.empty()) {
model.testResultsVolumes(Fuse_1, [785.398163397447774514148477465])
Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("FACE", "Fuse_1_1_1")])
-assert(Fuse_2.feature().error() != "")
+model.testNbResults(Fuse_2, 1)
+model.testNbSubResults(Fuse_2, [2])
+model.testNbSubShapes(Fuse_2, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Fuse_2, GeomAPI_Shape.FACE, [19])
+model.testNbSubShapes(Fuse_2, GeomAPI_Shape.EDGE, [82])
+model.testNbSubShapes(Fuse_2, GeomAPI_Shape.VERTEX, [164])
+model.testResultsVolumes(Fuse_2, [25803.607097738855372881516814232])
model.end()
Part_1_doc.removeFeature(Fuse_1.feature())
Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2")])
-assert(Fuse_1.feature().error() != "")
+# after merging Union and Fuse features, fusing of solids in the same composolid should work (issue #3062)
+assert(Fuse_1.feature().error() == "")
Part_1_doc.removeFeature(Fuse_1.feature())
Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
-assert(Fuse_1.feature().error() != "")
+# after merging Union and Fuse features, fusing of solids in the same composolid should work (issue #3062)
+assert(Fuse_1.feature().error() == "")
Part_1_doc.removeFeature(Fuse_1.feature())
model.end()
from GeomAPI import GeomAPI_Shape
model.testNbResults(Fuse_1, 1)
-model.testNbSubResults(Fuse_1, [1])
+model.testNbSubResults(Fuse_1, [0])
model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [0])
model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [1])
model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [2])
Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1_1")], [model.selection("SOLID", "LinearCopy_2_1_1_1"), model.selection("FACE", "Compound_1_1_2")], True)
model.end()
-assert(Fuse_1.feature().error() != "")
+from GeomAPI import *
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [2])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [16])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [78])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [156])
+model.testResultsVolumes(Fuse_1, [1589.048622670478835])
model.testNbResults(Fuse_1, 1)
model.testNbSubResults(Fuse_1, [3])
-model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [6])
-model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [23])
-model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [70])
-model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [140])
-model.testResultsVolumes(Fuse_1, [5016.039439659862])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [7])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [31])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [108])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [216])
+model.testResultsVolumes(Fuse_1, [5516.039439659862])
assert(model.checkPythonDump())
Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1_1")], [model.selection("SOLID", "LinearCopy_2_1_1_1"), model.selection("FACE", "Compound_1_1_2")], True, 20190506)
model.end()
-assert(Fuse_1.feature().error() != "")
+from GeomAPI import *
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [5])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [9])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [44])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [160])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [320])
+model.testResultsVolumes(Fuse_1, [6516.03943965772123])
Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5, True)
Partition_1_objects = [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("SOLID", "Box_1_1")]
Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
-Union_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
-Union_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fuse_1_1_2"), model.selection("SOLID", "Fuse_1_1_1")])
+Union_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")], False, 20190506)
+Union_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fuse_1_1_2"), model.selection("SOLID", "Fuse_1_1_1")], False, 20190506)
model.do()
model.end()