Salome HOME
Fix: update of the sub-results number when the sub-results number is reduced in the OB
[modules/shaper.git] / test.models / plug.py
index d8998625f7fea7b7024f6bc81bec45cd090d8774..37ce6db8bd1490caff41cccf08aed498ae88b9c3 100644 (file)
@@ -309,8 +309,8 @@ SketchConstraintAngle_5 = Sketch_3.setAngle(SketchLine_51.result(), SketchLine_4
 SketchConstraintDistanceHorizontal_15 = Sketch_3.setHorizontalDistance(SketchAPI_Line(SketchLine_50).endPoint(), SketchLine_42.startPoint(), "Slot_Width")
 SketchConstraintDistanceVertical_5 = Sketch_3.setVerticalDistance(SketchLine_39.startPoint(), SketchLine_39.endPoint(), 8)
 SketchConstraintDistanceHorizontal_16 = Sketch_3.setHorizontalDistance(SketchLine_39.endPoint(), SketchAPI_Line(SketchLine_50).startPoint(), 3)
-model.do()
 ExtrusionCut_2.setNestedSketch(Sketch_3)
+model.do()
 # check Sketch_3
 model.checkSketch(Sketch_3, 0)
 # check ExtrusionCut_2
@@ -325,7 +325,7 @@ model.testResultsVolumes(ExtrusionCut_2, [28317.789547563083033310249447823])
 Folder_1 = model.addFolder(Part_1_doc, Fillet_1, Fillet_5)
 
 Sketch_4 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
-SketchLine_52 = Sketch_4.addLine(28.5, -19, 28.5, 0)
+SketchLine_52 = Sketch_4.addLine(28.5, -19.5, 28.5, 0)
 SketchProjection_12 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_53 = SketchProjection_12.createdFeature()
 SketchConstraintCoincidence_47 = Sketch_4.setCoincident(SketchLine_52.endPoint(), SketchLine_53.result())
@@ -334,9 +334,9 @@ SketchConstraintCoincidence_48 = Sketch_4.setCoincident(SketchLine_52.endPoint()
 SketchConstraintCoincidence_49 = Sketch_4.setCoincident(SketchLine_54.endPoint(), SketchLine_53.result())
 SketchLine_55 = Sketch_4.addLine(29, 0, 29, -11.5)
 SketchConstraintCoincidence_50 = Sketch_4.setCoincident(SketchLine_54.endPoint(), SketchLine_55.startPoint())
-SketchLine_56 = Sketch_4.addLine(28.5, -19, 29.9, -19)
+SketchLine_56 = Sketch_4.addLine(28.5, -19.5, 30.4, -19.5)
 SketchConstraintCoincidence_51 = Sketch_4.setCoincident(SketchLine_52.startPoint(), SketchLine_56.startPoint())
-SketchLine_57 = Sketch_4.addLine(29.9, -19, 29.4, -18.5)
+SketchLine_57 = Sketch_4.addLine(30.4, -19.5, 29.4, -18.5)
 SketchConstraintCoincidence_52 = Sketch_4.setCoincident(SketchLine_56.endPoint(), SketchLine_57.startPoint())
 SketchLine_58 = Sketch_4.addLine(29.4, -18.5, 29.4, -12.5)
 SketchConstraintCoincidence_53 = Sketch_4.setCoincident(SketchLine_57.endPoint(), SketchLine_58.startPoint())
@@ -354,15 +354,18 @@ SketchConstraintDistanceHorizontal_18 = Sketch_4.setHorizontalDistance(SketchLin
 SketchProjection_14 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_20"), False)
 SketchLine_59 = SketchProjection_14.createdFeature()
 SketchConstraintAngle_6 = Sketch_4.setAngle(SketchLine_57.result(), SketchLine_56.result(), 45)
-SketchConstraintLength_4 = Sketch_4.setLength(SketchLine_56.result(), "Drill2_Radius")
 SketchConstraintMirror_2 = Sketch_4.addMirror(SketchLine_53.result(), [SketchLine_59.result()])
 [SketchLine_60] = SketchConstraintMirror_2.mirrored()
 SketchLine_60.setAuxiliary(True)
-SketchConstraintCoincidence_56 = Sketch_4.setCoincident(SketchLine_56.startPoint(), SketchLine_60.result())
 SketchConstraintDistance_12 = Sketch_4.setDistance(SketchArc_2.endPoint(), SketchLine_60.result(), "Drill2_DepthMax", True)
 SketchConstraintDistance_13 = Sketch_4.setDistance(SketchLine_58.endPoint(), SketchLine_60.result(), "Drill2_DepthMin", True)
 SketchConstraintDistance_14 = Sketch_4.setDistance(SketchLine_57.endPoint(), SketchLine_60.result(), 0.5, True)
 SketchConstraintTangent_3 = Sketch_4.setTangent(SketchLine_58.result(), SketchArc_2.results()[1])
+SketchPoint_5 = Sketch_4.addPoint(29.9, -19)
+SketchConstraintCoincidence_56 = Sketch_4.setCoincident(SketchPoint_5.coordinates(), SketchLine_60.result())
+SketchConstraintCoincidence_57 = Sketch_4.setCoincident(SketchPoint_5.coordinates(), SketchLine_57.result())
+SketchConstraintDistance_15 = Sketch_4.setDistance(SketchPoint_5.coordinates(), SketchLine_52.result(), "Drill2_Radius", True)
+SketchConstraintDistanceVertical_6 = Sketch_4.setVerticalDistance(SketchLine_56.endPoint(), SketchPoint_5.coordinates(), 0.5)
 model.do()
 # check Sketch_4
 model.checkSketch(Sketch_4, 0)
@@ -380,22 +383,26 @@ model.testResultsVolumes(RevolutionCut_1, [28297.246041844206047244369983673])
 RevolutionCut_2 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OX"), 360, 0, [model.selection("SOLID", "RevolutionCut_1_1")])
 Sketch_5 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_61 = Sketch_5.addLine(63.5, 10.5, 64, 10.5)
+SketchLine_61.setAuxiliary(True)
 SketchProjection_15 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), False)
 SketchLine_62 = SketchProjection_15.createdFeature()
-SketchConstraintCoincidence_57 = Sketch_5.setCoincident(SketchLine_61.startPoint(), SketchLine_62.result())
-SketchConstraintCoincidence_58 = Sketch_5.setCoincident(SketchAPI_Line(SketchLine_62).endPoint(), SketchLine_61.endPoint())
-SketchLine_63 = Sketch_5.addLine(64, 10.5, 64, 11)
-SketchConstraintCoincidence_59 = Sketch_5.setCoincident(SketchLine_61.endPoint(), SketchLine_63.startPoint())
-SketchProjection_16 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), False)
-SketchLine_64 = SketchProjection_16.createdFeature()
-SketchConstraintCoincidence_60 = Sketch_5.setCoincident(SketchLine_63.endPoint(), SketchLine_64.result())
-SketchLine_65 = Sketch_5.addLine(64, 11, 63.5, 10.5)
-SketchConstraintCoincidence_61 = Sketch_5.setCoincident(SketchLine_63.endPoint(), SketchLine_65.startPoint())
-SketchConstraintCoincidence_62 = Sketch_5.setCoincident(SketchLine_65.endPoint(), SketchLine_61.startPoint())
-SketchConstraintEqual_2 = Sketch_5.setEqual(SketchLine_61.result(), SketchLine_63.result())
-SketchConstraintLength_5 = Sketch_5.setLength(SketchLine_61.result(), "Chamfer")
-model.do()
+SketchConstraintCoincidence_58 = Sketch_5.setCoincident(SketchLine_61.startPoint(), SketchLine_62.result())
+SketchConstraintCoincidence_59 = Sketch_5.setCoincident(SketchAPI_Line(SketchLine_62).endPoint(), SketchLine_61.endPoint())
+SketchLine_63 = Sketch_5.addLine(64.25, 10.25, 64.25, 11.25)
+SketchLine_64 = Sketch_5.addLine(64.25, 11.25, 63.25, 10.25)
+SketchConstraintCoincidence_60 = Sketch_5.setCoincident(SketchLine_63.endPoint(), SketchLine_64.startPoint())
+SketchConstraintLength_3 = Sketch_5.setLength(SketchLine_61.result(), "Chamfer")
+SketchConstraintCoincidence_61 = Sketch_5.setCoincident(SketchLine_61.startPoint(), SketchLine_64.result())
+SketchLine_65 = Sketch_5.addLine(63.25, 10.25, 64.25, 10.25)
+SketchConstraintCoincidence_62 = Sketch_5.setCoincident(SketchLine_64.endPoint(), SketchLine_65.startPoint())
+SketchConstraintCoincidence_63 = Sketch_5.setCoincident(SketchLine_63.startPoint(), SketchLine_65.endPoint())
+SketchConstraintEqual_2 = Sketch_5.setEqual(SketchLine_65.result(), SketchLine_63.result())
+SketchConstraintVertical_18 = Sketch_5.setVertical(SketchLine_63.result())
+SketchConstraintHorizontal_12 = Sketch_5.setHorizontal(SketchLine_65.result())
+SketchConstraintDistanceVertical_7 = Sketch_5.setVerticalDistance(SketchLine_65.startPoint(), SketchLine_61.startPoint(), "Chamfer/2")
+SketchConstraintDistanceVertical_8 = Sketch_5.setVerticalDistance(SketchLine_61.startPoint(), SketchLine_63.endPoint(), "Chamfer*1.5")
 RevolutionCut_2.setNestedSketch(Sketch_5)
+model.do()
 # check Sketch_5
 model.checkSketch(Sketch_5, 0)
 # check RevolutionCut_2
@@ -419,7 +426,7 @@ model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1476])
 model.testResultsVolumes(Partition_1, [28288.886256640704232268035411835])
 
 Result = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1"))
-Result.setSubShapesToRemove([model.selection("SOLID", "Partition_1_1_1")])
+Result.setSubShapesToRemove([model.selection("SOLID", "Partition_1_1_2")])
 Result.result().setName("Plug")
 # check Remove_SubShapes_1
 model.testNbResults(Result, 1)
@@ -430,7 +437,7 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
 model.testResultsVolumes(Result, [14144.443128843522572424262762070])
 
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Plug/Modified_Face_1_1"), model.selection("FACE", "Plug/Modified_Face_2_1"), model.selection("FACE", "Plug/Modified_Face_3_1"), model.selection("FACE", "Plug/Modified_Face_4_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Plug/Modified_Face_27_1"), model.selection("FACE", "Plug/Modified_Face_26_1"), model.selection("FACE", "Plug/Modified_Face_28_1"), model.selection("FACE", "Plug/Modified_Face_32_1")])
 Group_1.result().setColor(68, 68, 68)
 # check Group_1
 model.checkGroup(Group_1, GeomAPI_Shape.FACE)
@@ -482,25 +489,25 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
 model.testResultsVolumes(Result, [22969.553506208951148437336087227])
 
-Param_Drill2Loc.setValue(9)
+Param_Drill2Loc.setValue(7.5)
 model.do()
 model.testNbResults(Result, 1)
 model.testNbSubResults(Result, [0])
 model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
-model.testResultsVolumes(Result, [22970.312703100276848999783396721])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testResultsVolumes(Result, [22969.986144881491782143712043762])
 
-Param_Drill2Radius.setValue(2)
+Param_Drill2Radius.setValue(1.9)
 model.do()
 model.testNbResults(Result, 1)
 model.testNbSubResults(Result, [0])
 model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
-model.testResultsVolumes(Result, [22953.781532584092929027974605560])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testResultsVolumes(Result, [22956.808010807682876475155353546])
 
 Param_Fillet1.setValue(3)
 model.do()
@@ -508,12 +515,12 @@ model.testNbResults(Result, 1)
 model.testNbSubResults(Result, [0])
 model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
-model.testResultsVolumes(Result, [23372.112422200712899211794137955])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testResultsVolumes(Result, [23373.503259112552768783643841743])
 
 model.checkGroup(Group_1, GeomAPI_Shape.FACE)
 
 model.end()
 
-assert(model.checkPythonDump())
\ No newline at end of file
+assert(model.checkPythonDump())