]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Adjust unit tests for Boolean Fill
authorazv <azv@opencascade.com>
Fri, 15 Dec 2017 15:23:18 +0000 (18:23 +0300)
committerazv <azv@opencascade.com>
Fri, 15 Dec 2017 15:23:18 +0000 (18:23 +0300)
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/Test/TestFillFaceWire.py
src/FeaturesPlugin/Test/TestFillShellFace.py
src/FeaturesPlugin/Test/TestFillShellWire.py

index 27f0399180af3a76924736e1e202fbc78a5c03ee..64072e62accc7b53a9543440a8e4cbe5483051db 100644 (file)
@@ -731,16 +731,12 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> t
     std::string aName;
     for(ListOfShape::const_iterator
         anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
-      if((*anIter)->shapeType() == GeomAPI_Shape::EDGE) {
-        aTag = aModifyEdgeTag;
-        aName = aModEName;
-      }
-      else if((*anIter)->shapeType() == GeomAPI_Shape::FACE) {
+      if((*anIter)->shapeType() <= GeomAPI_Shape::FACE) {
         aTag = aModifyFaceTag;
         aName = aModFName;
       } else {
-        aTag = aModifyFaceTag;
-        aName = aModFName;
+        aTag = aModifyEdgeTag;
+        aName = aModEName;
       }
       theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter,
         aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE,
index a9eca062a64f1049d7fa4eedddd6beeb0967da33..a796ddacfe340981fe469654d9c0f22c0736ae05 100644 (file)
@@ -39,30 +39,24 @@ SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint()
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_2.result())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
-SketchLine_4 = Sketch_2.addLine(29.74624907439609, 30.07487215963349, 31.08202242513997, 0)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False)
-SketchPoint_1 = SketchProjection_2.createdFeature()
-SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result())
-SketchLine_5 = Sketch_2.addLine(31.08202242513997, 0, 45.45797599933665, 0)
-SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
-SketchLine_6 = SketchProjection_3.createdFeature()
-SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
-SketchLine_7 = Sketch_2.addLine(45.45797599933665, 0, 45.83553599350717, -22.747645239555)
-SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint())
-SketchLine_8 = Sketch_2.addLine(45.83553599350717, -22.747645239555, 70.40999925541598, 30.039147749218)
-SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
-SketchLine_9 = Sketch_2.addLine(70.40999925541598, 30.039147749218, 29.74624907439609, 30.07487215963349)
-SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
-SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.endPoint())
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_4 = Sketch_2.addLine(-42.38833891077762, 73.71572760627062, -18.23994072168525, 7.835320880296757)
+SketchLine_5 = Sketch_2.addLine(-18.23994072168525, 7.835320880296757, 13.89341696052619, 27.33089138697832)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_2.addLine(13.89341696052619, 27.33089138697832, 39.39985877388298, 9.747860956493145)
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_2.addLine(39.39985877388298, 9.747860956493145, 38.20105433548567, 71.93732104572752)
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_2.addLine(38.20105433548567, 71.93732104572752, -42.38833891077762, 73.71572760627062)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_8.endPoint())
 model.do()
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [1], [4], [9])
+model.checkBooleansResult(Boolean_1, model, 1, [5], [0], [5], [21], [42])
 model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
 
 model.end()
index e791e6f539117d5837555ccdc3f1cc6dd0005509..1ece54f1ae7b7d2a61ae5fa18639a09ae92e93d6 100644 (file)
@@ -61,50 +61,44 @@ SketchLine_7.result().setName("SketchLine_8")
 SketchLine_7.setAuxiliary(True)
 SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result())
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True)
-SketchLine_8 = Sketch_2.addLine(57.5, 0, 80, -10.81485284151855)
+SketchLine_8 = Sketch_2.addLine(50, -3.170182618622045, 80, -14.17077918941143)
 SketchLine_8.setName("SketchLine_9")
 SketchLine_8.result().setName("SketchLine_9")
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
-SketchLine_9 = SketchProjection_3.createdFeature()
-SketchLine_9.setName("SketchLine_10")
-SketchLine_9.result().setName("SketchLine_10")
-SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result())
-SketchLine_10 = Sketch_2.addLine(80, -10.81485284151855, 65, 11.50710132369052)
-SketchLine_10.setName("SketchLine_11")
-SketchLine_10.result().setName("SketchLine_11")
-SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint())
-SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052)
-SketchLine_11.setName("SketchLine_12")
-SketchLine_11.result().setName("SketchLine_12")
-SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
-SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result())
-SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True)
-SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L", True)
-SketchConstraintDistance_6 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True)
-SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result())
-SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()]
+SketchLine_9 = Sketch_2.addLine(80, -14.17077918941143, 64.99999999999999, 12.18920647716607)
+SketchLine_9.setName("SketchLine_11")
+SketchLine_9.result().setName("SketchLine_11")
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_9")
+SketchLine_10 = Sketch_2.addLine(64.99999999999999, 12.18920647716607, 50, 12.18920647716607)
+SketchLine_10.setName("SketchLine_12")
+SketchLine_10.result().setName("SketchLine_12")
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.result())
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L", True)
+SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_9.endPoint(), SketchLine_7.result(), "L/2", True)
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_10.result())
+SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_9.result(), SketchLine_10.result()]
 SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects)
-[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored()
-SketchLine_14.setName("SketchLine_15")
-SketchLine_14.result().setName("SketchLine_15")
-SketchLine_13.setName("SketchLine_14")
-SketchLine_13.result().setName("SketchLine_14")
-SketchLine_12.setName("SketchLine_13")
-SketchLine_12.result().setName("SketchLine_13")
-SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0)
-SketchLine_15.setName("SketchLine_16")
-SketchLine_15.result().setName("SketchLine_16")
-SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
-SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint())
+[SketchLine_11, SketchLine_12, SketchLine_13] = SketchConstraintMirror_1.mirrored()
+SketchLine_13.setName("SketchLine_15")
+SketchLine_13.result().setName("SketchLine_15")
+SketchLine_12.setName("SketchLine_14")
+SketchLine_12.result().setName("SketchLine_14")
+SketchLine_11.setName("SketchLine_13")
+SketchLine_11.result().setName("SketchLine_13")
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), False)
+SketchPoint_2 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_9.result())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_7.result())
 model.do()
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")])
 model.do()
 
-model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [4], [17], [34])
+model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [4], [13], [26])
 model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
 
 model.end()
index d7d5ea09745bc1af066ec9de2394b4a61ecf423c..017eb7ee7a93b7fe3c7ab0ff27d5334df2edbcd6 100644 (file)
@@ -52,59 +52,33 @@ SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.
 SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_5.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_3.result())
 model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_7 = Sketch_2.addLine(-14.33356820392057, 60, 15.66643179607943, 60)
+SketchLine_8 = Sketch_2.addLine(15.66643179607943, 60, 15.66643179607943, 30)
+SketchLine_9 = Sketch_2.addLine(15.66643179607943, 30, -14.33356820392057, 30)
+SketchLine_10 = Sketch_2.addLine(-14.33356820392057, 30, -14.33356820392057, 60)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_8.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_10.result())
+SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_9.result(), "L")
+SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_8.result(), "L")
 SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_2.createdFeature()
-SketchLine_7 = Sketch_2.addLine(50, -39.61510263929618, 50, 43.87280058651025)
-SketchLine_7.setName("SketchLine_8")
-SketchLine_7.result().setName("SketchLine_8")
-SketchLine_7.setAuxiliary(True)
-SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result())
-SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.result(), "D", True)
-SketchLine_8 = Sketch_2.addLine(57.5, 0, 65, -10.81485284151855)
-SketchLine_8.setName("SketchLine_9")
-SketchLine_8.result().setName("SketchLine_9")
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
-SketchLine_9 = SketchProjection_3.createdFeature()
-SketchLine_9.setName("SketchLine_10")
-SketchLine_9.result().setName("SketchLine_10")
-SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result())
-SketchLine_10 = Sketch_2.addLine(65, -10.81485284151855, 65, 11.50710132369052)
-SketchLine_10.setName("SketchLine_11")
-SketchLine_10.result().setName("SketchLine_11")
-SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.startPoint())
-SketchLine_11 = Sketch_2.addLine(65, 11.50710132369052, 50, 11.50710132369052)
-SketchLine_11.setName("SketchLine_12")
-SketchLine_11.result().setName("SketchLine_12")
-SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
-SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_7.result())
-SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_8.startPoint(), SketchLine_7.result(), "L/4", True)
-SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L/2", True)
-SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_7.result(), "L/2", True)
-SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_11.result())
-SketchConstraintMirror_1_objects = [SketchLine_8.result(), SketchLine_10.result(), SketchLine_11.result()]
-SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_7.result(), SketchConstraintMirror_1_objects)
-[SketchLine_12, SketchLine_13, SketchLine_14] = SketchConstraintMirror_1.mirrored()
-SketchLine_14.setName("SketchLine_15")
-SketchLine_14.result().setName("SketchLine_15")
-SketchLine_13.setName("SketchLine_14")
-SketchLine_13.result().setName("SketchLine_14")
-SketchLine_12.setName("SketchLine_13")
-SketchLine_12.result().setName("SketchLine_13")
-SketchLine_15 = Sketch_2.addLine(42.5, 0, 57.5, 0)
-SketchLine_15.setName("SketchLine_16")
-SketchLine_15.result().setName("SketchLine_16")
-SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
-SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint())
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.result(), "L", True)
 model.do()
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [2], [10], [22])
+model.checkBooleansResult(Boolean_1, model, 1, [0], [0], [8], [30], [60])
 model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
 
 model.end()