]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2329: group of vertices is empty
authordbv <dbv@opencascade.com>
Tue, 5 Dec 2017 11:57:20 +0000 (14:57 +0300)
committerdbv <dbv@opencascade.com>
Tue, 5 Dec 2017 11:57:38 +0000 (14:57 +0300)
Fixed

src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/Test/Test2194.py
src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py
src/ModelAPI/Test/Test1512.py
src/PythonAPI/examples/Platine.py

index d10b03f1c365ed906aefd7150e61682d5bea1328..27f0399180af3a76924736e1e202fbc78a5c03ee 100644 (file)
@@ -708,10 +708,11 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> t
     theResultBody->store(theResultShape, false);
   } else {
     const int aModifyTag = 1;
-    const int aDeletedTag = 2;
-    /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
-    const int aSubsolidsTag = 3;
-    const int anEdgesAndFacesTag = 10000;
+    const int aModifyEdgeTag = 2;
+    const int aModifyFaceTag = 3;
+    const int aDeletedTag = 4;
+    /// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
+    const int aSubsolidsTag = 5;
 
     theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
 
@@ -719,8 +720,10 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> t
     const std::string aModEName = "Modified_Edge";
     const std::string aModFName = "Modified_Face";
 
+    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
+      aModifyEdgeTag, aModEName, theMapOfShapes, false, theIsStoreAsGenerated, true);
     theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-      aModifyTag, aModName, theMapOfShapes, false, theIsStoreAsGenerated, true);
+      aModifyFaceTag, aModFName, theMapOfShapes, false, theIsStoreAsGenerated, true);
     theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
                                      GeomAPI_Shape::FACE, aDeletedTag);
 
@@ -729,15 +732,15 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> t
     for(ListOfShape::const_iterator
         anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
       if((*anIter)->shapeType() == GeomAPI_Shape::EDGE) {
-        aTag = anEdgesAndFacesTag;
+        aTag = aModifyEdgeTag;
         aName = aModEName;
       }
       else if((*anIter)->shapeType() == GeomAPI_Shape::FACE) {
-        aTag = anEdgesAndFacesTag;
+        aTag = aModifyFaceTag;
         aName = aModFName;
       } else {
-        aTag = aModifyTag;
-        aName = aModName;
+        aTag = aModifyFaceTag;
+        aName = aModFName;
       }
       theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter,
         aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE,
index 855ae61e1abf747502e96142b3db086f1f85b7ea..1324186907a695c402ae61379d2c366e15988c20 100644 (file)
@@ -34,7 +34,7 @@ SketchCircle_3 = Sketch_2.addCircle(-41.97827733564338, 89.35676702647821, 6.102
 model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0)
 Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Boolean_1_1_1/Modified_1"), model.selection("FACE", "_Extrusion_1_1/From_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Boolean_1_1_1/Modified_Face_1"), model.selection("FACE", "_Extrusion_1_1/From_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
 model.do()
 model.end()
 
index dbc2670078209d7186d9d1449c318acf48c0ddf1..31a1b4b0fc370b12acc711ecc3f0b1100e9e0dab 100644 (file)
@@ -52,7 +52,7 @@ SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0)
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/YOZ")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Boolean_1_1_4/Modified_3"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Boolean_1_1_4/Modified_2"), model.selection("FACE", "Boolean_1_1_4/Modified_4"), model.selection("FACE", "Boolean_1_1_4/Modified_1"), model.selection("FACE", "Boolean_1_1_4/Modified_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_6"), model.selection("FACE", "Boolean_1_1_3/Modified_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_7"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Boolean_1_1_1/Modified_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_5"), model.selection("FACE", "Boolean_1_1_4/Modified_4"), model.selection("FACE", "Boolean_1_1_1/Modified_2"), model.selection("FACE", "Boolean_1_1_3/Modified_4"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_11"), model.selection("FACE", "Boolean_1_1_3/Modified_3"), model.selection("FACE", "Boolean_1_1_3/Modified_2"), model.selection("FACE", "Boolean_1_1_3/Modified_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Boolean_1_1_3/Modified_4"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "_Extrusion_1_1/To_Face_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "_Extrusion_1_1/From_Face_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Boolean_1_1_4/Modified_Face_5"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_2"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_7"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_4"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_3"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_5"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_10"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_5"), model.selection("FACE", "Boolean_1_1_1/Modified_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_7"), model.selection("FACE", "Boolean_1_1_1/Modified_Face_2"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_4"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_11"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_4"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_5"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_5"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_2"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_3"), model.selection("FACE", "Boolean_1_1_4/Modified_Face_1"), model.selection("FACE", "Boolean_1_1_3/Modified_Face_4"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "_Extrusion_1_1/To_Face_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "_Extrusion_1_1/From_Face_3"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "_Extrusion_1_1/Generated_Face_2")])
 model.do()
 model.end()
 
index ef0f8c564e011606b8f3e6684eb9aa04d9e38b02..25aba1f260fd65b6f22c3b209af384c217915f81 100755 (executable)
@@ -156,12 +156,12 @@ def check_owner(selection, topology_type, feature):
 
 # check faces
 check_owner("_Extrusion_1_1/Generated_Face_1", "face", aBox)
-check_owner("Extrusion_3_1/Modified_3", "face", aBox)
-check_owner("Extrusion_1_1/Modified_1", "face", aHoleExt)
-check_owner("Extrusion_3_1/Modified_2", "face", aTower)
+check_owner("Extrusion_3_1/Modified_Face_3", "face", aBox)
+check_owner("Extrusion_1_1/Modified_Face_1", "face", aHoleExt)
+check_owner("Extrusion_3_1/Modified_Face_2", "face", aTower)
 # check edges without ambiguity
-check_owner("Extrusion_3_1/Modified_3&_Extrusion_1_1/Generated_Face_2", "edge", aBox)
-check_owner("Extrusion_3_1/Modified_2&_Extrusion_3_1/To_Face_1", "edge", aTower)
+check_owner("Extrusion_3_1/Modified_Face_3&_Extrusion_1_1/Generated_Face_2", "edge", aBox)
+check_owner("Extrusion_3_1/Modified_Face_2&_Extrusion_3_1/To_Face_1", "edge", aTower)
 
 # check the connected topology method: solid is not a compound of connected topology
 assert(aFuse.firstResult().shape().isConnectedTopology() == False)
index 800ce0e05fbec009dcfc5543ffc70186ca71dc30..aad9beb92d98a9730d5f7fa0dc174bcd15cc5abb 100644 (file)
@@ -132,7 +132,7 @@ def bottom_body():
 
 def body_3():
     # Create XOZ sketch
-    sketch = model.addSketch(part, "Boolean_1_1/Modified_3")
+    sketch = model.addSketch(part, "Boolean_1_1/Modified_Face_3")
 
     # Create base polygon
     H, L, l, r = 28, 40, 8, 12
@@ -170,7 +170,7 @@ def body_3():
     sketch.setRadius(arc, r)
 
     # Binding
-    bottom_e = sketch.addLine("Boolean_1_1/Modified_8&Boolean_1_1/Modified_5")
+    bottom_e = sketch.addLine("Boolean_1_1/Modified_Face_8&Boolean_1_1/Modified_Face_5")
     sketch.setCoincident(bottom_e, bottom.startPoint())
     sketch.setCoincident(bottom_e.startPoint(), bottom.endPoint())
 
@@ -183,7 +183,7 @@ def body_3():
 
 def body_4():
     # Create XOZ 2nd sketch
-    sketch = model.addSketch(part, "Boolean_2_1/Modified_4")
+    sketch = model.addSketch(part, "Boolean_2_1/Modified_Face_4")
 
     # Create base polygon
     points = [(0, 0), (0, 1), (1, 0)]
@@ -192,11 +192,11 @@ def body_4():
     left, diagonal, bottom = model.addPolygon(sketch, *geom_points)
 
     # Binding
-    bottom_e = sketch.addLine("Boolean_2_1/Modified_3&Boolean_2_1/Modified_4")
+    bottom_e = sketch.addLine("Boolean_2_1/Modified_Face_3&Boolean_2_1/Modified_Face_4")
     sketch.setCoincident(bottom_e.endPoint(), bottom.startPoint())
     sketch.setCoincident(bottom_e.startPoint(), left.startPoint())
 
-    left_e = sketch.addLine("Boolean_2_1/Modified_6&Boolean_2_1/Modified_7")
+    left_e = sketch.addLine("Boolean_2_1/Modified_Face_6&Boolean_2_1/Modified_Face_7")
     sketch.setCoincident(left_e.startPoint(), left.endPoint())
 
     model.do()  #!!!