]> SALOME platform Git repositories - modules/shaper.git/blob - test.models/sprocket.py
Salome HOME
Sort alphabetically unit tests for SketchPlugin module
[modules/shaper.git] / test.models / sprocket.py
1 ## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
2 ##
3 ## This library is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU Lesser General Public
5 ## License as published by the Free Software Foundation; either
6 ## version 2.1 of the License, or (at your option) any later version.
7 ##
8 ## This library is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 ## Lesser General Public License for more details.
12 ##
13 ## You should have received a copy of the GNU Lesser General Public
14 ## License along with this library; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 ##
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 from SketchAPI import *
22 from GeomAPI import GeomAPI_Shape
23
24 from salome.shaper import model
25
26 model.begin()
27 partSet = model.moduleDocument()
28 Part_1 = model.addPart(partSet)
29 Part_1_doc = Part_1.document()
30
31 Param_m = model.addParameter(Part_1_doc, "m", "1")
32 Param_Z = model.addParameter(Part_1_doc, "Z", "30")
33 model.addParameter(Part_1_doc, "d", "m*Z")
34 model.addParameter(Part_1_doc, "da", "d+2*m")
35 model.addParameter(Part_1_doc, "df", "d-2.5*m")
36 model.addParameter(Part_1_doc, "ha", "m")
37 model.addParameter(Part_1_doc, "hf", "1.25*m")
38 model.addParameter(Part_1_doc, "h", "2.25*m")
39 model.addParameter(Part_1_doc, "e", "d/8.")
40 model.addParameter(Part_1_doc, "angle_L", "360/(d*2)")
41 model.addParameter(Part_1_doc, "R", "d*(13/16)")
42 model.addParameter(Part_1_doc, "r_1", "d/4")
43 model.addParameter(Part_1_doc, "r_2", "d/10")
44 model.addParameter(Part_1_doc, "r_3", "d/40")
45 model.addParameter(Part_1_doc, "R_1", "d*(3/20)")
46 model.addParameter(Part_1_doc, "ep", "1.5")
47 model.addParameter(Part_1_doc, "angle_1", "15")
48 model.addParameter(Part_1_doc, "angle_2", "21")
49 Param_NB = model.addParameter(Part_1_doc, "NB", "6")
50
51 Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
52 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
53 SketchPoint_1 = SketchProjection_1.createdFeature()
54 SketchCircle_1 = Sketch_1.addCircle(0, 0, 30)
55 SketchCircle_1.setAuxiliary(True)
56 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
57 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], "d")
58 SketchLine_1 = Sketch_1.addLine(-1.83495963955651, 27.43871212577585, -1.570078687288315, 29.95888604263722)
59 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
60 SketchLine_2 = Sketch_1.addLine(-1.570078687288315, 29.95888604263722, -0.7903152816259503, 31.99023916377664)
61 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
62 SketchLine_3 = Sketch_1.addLine(1.834959639556546, 27.43871212577585, 1.570078687288318, 29.95888604263721)
63 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchCircle_1.results()[1])
64 SketchLine_4 = Sketch_1.addLine(1.570078687288318, 29.95888604263721, 0.7903152816259467, 31.99023916377664)
65 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
66 SketchCircle_2 = Sketch_1.addCircle(0, 0, 27.5)
67 SketchCircle_2.setAuxiliary(True)
68 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchCircle_2.center())
69 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_2.results()[1])
70 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchCircle_2.results()[1])
71 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_4.result())
72 SketchArc_1 = Sketch_1.addArc(0, 0, 0.7903152816259467, 31.99023916377664, -0.7903152816259503, 31.99023916377664, False)
73 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_1.center())
74 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchArc_1.startPoint())
75 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.endPoint())
76 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
77 SketchLine_5 = SketchProjection_2.createdFeature()
78 SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_2.result(), SketchLine_5.result(), "angle_2")
79 SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_4.result(), "180+angle_1")
80 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
81 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], "da")
82 SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_2.results()[1], "df")
83 SketchLine_6 = Sketch_1.addLine(1.570078687288318, 29.95888604263721, 0, 0)
84 SketchLine_6.setAuxiliary(True)
85 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_6.startPoint())
86 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_6.endPoint())
87 SketchLine_7 = Sketch_1.addLine(-1.570078687288315, 29.95888604263722, 0, 0)
88 SketchLine_7.setAuxiliary(True)
89 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_7.startPoint())
90 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.endPoint())
91 SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_6.result(), SketchLine_5.result(), "angle_L/2")
92 SketchConstraintAngle_4 = Sketch_1.setAngle(SketchLine_5.result(), SketchLine_7.result(), "angle_L/2")
93 SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_3.result()], SketchAPI_Line(SketchLine_5).startPoint(), "360/Z", 2)
94 [SketchLine_8] = SketchMultiRotation_1.rotated()
95 SketchLine_8.setAuxiliary(True)
96 SketchArc_2 = Sketch_1.addArc(0, 0, -1.83495963955651, 27.43871212577585, -3.909967663056207, 27.22061999429577, False)
97 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_2.center())
98 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_2.startPoint())
99 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_8.result(), SketchArc_2.endPoint())
100 SketchProjection_3 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
101 SketchPoint_2 = SketchProjection_3.createdFeature()
102 SketchMultiRotation_2_objects = [SketchArc_2.results()[1], SketchLine_1.result(), SketchLine_2.result(), SketchArc_1.results()[1], SketchLine_4.result(), SketchLine_3.result()]
103 SketchMultiRotation_2 = Sketch_1.addRotation(SketchMultiRotation_2_objects, SketchAPI_Point(SketchPoint_2).coordinates(), "360/Z", "Z")
104 [SketchArc_3, SketchArc_4, SketchArc_5, SketchArc_6, SketchArc_7, SketchArc_8, SketchArc_9, SketchArc_10, SketchArc_11, SketchArc_12, SketchArc_13, SketchArc_14, SketchArc_15, SketchArc_16, SketchArc_17, SketchArc_18, SketchArc_19, SketchArc_20, SketchArc_21, SketchArc_22, SketchArc_23, SketchArc_24, SketchArc_25, SketchArc_26, SketchArc_27, SketchArc_28, SketchArc_29, SketchArc_30, SketchArc_31, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_20, SketchLine_21, SketchLine_22, SketchLine_23, SketchLine_24, SketchLine_25, SketchLine_26, SketchLine_27, SketchLine_28, SketchLine_29, SketchLine_30, SketchLine_31, SketchLine_32, SketchLine_33, SketchLine_34, SketchLine_35, SketchLine_36, SketchLine_37, SketchLine_38, SketchLine_39, SketchLine_40, SketchLine_41, SketchLine_42, SketchLine_43, SketchLine_44, SketchLine_45, SketchLine_46, SketchLine_47, SketchLine_48, SketchLine_49, SketchLine_50, SketchLine_51, SketchLine_52, SketchLine_53, SketchLine_54, SketchLine_55, SketchLine_56, SketchLine_57, SketchLine_58, SketchLine_59, SketchLine_60, SketchLine_61, SketchLine_62, SketchLine_63, SketchLine_64, SketchLine_65, SketchLine_66, SketchArc_32, SketchArc_33, SketchArc_34, SketchArc_35, SketchArc_36, SketchArc_37, SketchArc_38, SketchArc_39, SketchArc_40, SketchArc_41, SketchArc_42, SketchArc_43, SketchArc_44, SketchArc_45, SketchArc_46, SketchArc_47, SketchArc_48, SketchArc_49, SketchArc_50, SketchArc_51, SketchArc_52, SketchArc_53, SketchArc_54, SketchArc_55, SketchArc_56, SketchArc_57, SketchArc_58, SketchArc_59, SketchArc_60, SketchLine_67, SketchLine_68, SketchLine_69, SketchLine_70, SketchLine_71, SketchLine_72, SketchLine_73, SketchLine_74, SketchLine_75, SketchLine_76, SketchLine_77, SketchLine_78, SketchLine_79, SketchLine_80, SketchLine_81, SketchLine_82, SketchLine_83, SketchLine_84, SketchLine_85, SketchLine_86, SketchLine_87, SketchLine_88, SketchLine_89, SketchLine_90, SketchLine_91, SketchLine_92, SketchLine_93, SketchLine_94, SketchLine_95, SketchLine_96, SketchLine_97, SketchLine_98, SketchLine_99, SketchLine_100, SketchLine_101, SketchLine_102, SketchLine_103, SketchLine_104, SketchLine_105, SketchLine_106, SketchLine_107, SketchLine_108, SketchLine_109, SketchLine_110, SketchLine_111, SketchLine_112, SketchLine_113, SketchLine_114, SketchLine_115, SketchLine_116, SketchLine_117, SketchLine_118, SketchLine_119, SketchLine_120, SketchLine_121, SketchLine_122, SketchLine_123, SketchLine_124] = SketchMultiRotation_2.rotated()
105 model.do()
106 model.checkSketch(Sketch_1, 0)
107
108 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "e", 0)
109 model.testNbResults(Extrusion_1, 1)
110 model.testNbSubResults(Extrusion_1, [0])
111 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [1])
112 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [182])
113 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [1080])
114 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [2160])
115 model.testResultsVolumes(Extrusion_1, [10398.453966298400700907222926617])
116
117 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
118 SketchCircle_3 = Sketch_2.addCircle(0, 0, 4.5)
119 SketchLine_125 = Sketch_2.addLine(0, 0, -24.375, 0)
120 SketchLine_125.setAuxiliary(True)
121 SketchLine_126 = Sketch_2.addLine(0, 0, -12.18750000000149, 21.10936921724762)
122 SketchLine_126.setAuxiliary(True)
123 SketchLine_127 = Sketch_2.addLine(-5.267665072275066, 6.123863542435089, -11.74701189249443, 17.34642143491413)
124 SketchConstraintParallel_1 = Sketch_2.setParallel(SketchLine_127.result(), SketchLine_126.result())
125 SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_125.result())
126 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_125.startPoint(), SketchLine_126.startPoint())
127 SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
128 SketchPoint_3 = SketchProjection_4.createdFeature()
129 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_125.startPoint(), SketchAPI_Point(SketchPoint_3).coordinates())
130 SketchCircle_4 = Sketch_2.addCircle(0, 0, 7.5)
131 SketchCircle_4.setAuxiliary(True)
132 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchCircle_4.center())
133 SketchCircle_5 = Sketch_2.addCircle(0, 0, 24.375)
134 SketchCircle_5.setAuxiliary(True)
135 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchCircle_5.center())
136 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_126.endPoint(), SketchCircle_5.results()[1])
137 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_125.endPoint(), SketchCircle_5.results()[1])
138 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchAPI_Point(SketchPoint_3).coordinates())
139 SketchArc_61 = Sketch_2.addArc(0, 0, -5.379258295557134, 5.22623958403169, -7.21568539381252, 2.045454545454545, False)
140 SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchArc_61.center())
141 SketchArc_62 = Sketch_2.addArc(0, 0, -16.35843380263332, 18.07048058367397, -23.82871214537519, 5.131578947350746, False)
142 SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchArc_62.center())
143 SketchArc_63 = Sketch_2.addArc(-14.34508810384774, 15.8464214349141, -11.74701189249443, 17.34642143491413, -16.35843380263332, 18.07048058367397, False)
144 SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchArc_63.startPoint(), SketchLine_127.endPoint())
145 SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchArc_63.endPoint(), SketchArc_62.startPoint())
146 SketchConstraintTangent_1 = Sketch_2.setTangent(SketchArc_63.results()[1], SketchLine_127.result())
147 SketchConstraintTangent_2 = Sketch_2.setTangent(SketchArc_63.results()[1], SketchArc_62.results()[1])
148 SketchArc_64 = Sketch_2.addArc(-5.917184125113392, 5.74886354243508, -5.379258295557134, 5.22623958403169, -5.267665072275066, 6.123863542435089, False)
149 SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchArc_64.startPoint(), SketchArc_61.startPoint())
150 SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchArc_64.endPoint(), SketchLine_127.startPoint())
151 SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_64.results()[1], SketchArc_61.results()[1])
152 SketchConstraintTangent_4 = Sketch_2.setTangent(SketchArc_64.results()[1], SketchLine_127.result())
153 SketchLine_128 = Sketch_2.addLine(-20.8959475736328, 1.5, -7.937253933193772, 1.5)
154 SketchArc_65 = Sketch_2.addArc(-20.89594757363278, 4.500000000000018, -23.82871214537519, 5.131578947350746, -20.8959475736328, 1.5, False)
155 SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchArc_65.startPoint(), SketchArc_62.endPoint())
156 SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchArc_65.endPoint(), SketchLine_128.startPoint())
157 SketchConstraintTangent_5 = Sketch_2.setTangent(SketchArc_65.results()[1], SketchLine_128.result())
158 SketchConstraintTangent_6 = Sketch_2.setTangent(SketchArc_65.results()[1], SketchArc_62.results()[1])
159 SketchArc_66 = Sketch_2.addArc(-7.937253933193772, 2.25, -7.937253933193772, 1.5, -7.21568539381252, 2.045454545454545, False)
160 SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchArc_66.startPoint(), SketchLine_128.endPoint())
161 SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchArc_66.endPoint(), SketchArc_61.endPoint())
162 SketchConstraintTangent_7 = Sketch_2.setTangent(SketchArc_66.results()[1], SketchLine_128.result())
163 SketchConstraintTangent_8 = Sketch_2.setTangent(SketchArc_66.results()[1], SketchArc_61.results()[1])
164 SketchConstraintParallel_2 = Sketch_2.setParallel(SketchLine_128.result(), SketchLine_125.result())
165 SketchConstraintRadius_4 = Sketch_2.setRadius(SketchCircle_3.results()[1], "R_1")
166 SketchConstraintRadius_5 = Sketch_2.setRadius(SketchArc_61.results()[1], "r_1")
167 SketchConstraintEqual_3 = Sketch_2.setEqual(SketchArc_64.results()[1], SketchArc_66.results()[1])
168 SketchConstraintEqual_4 = Sketch_2.setEqual(SketchArc_63.results()[1], SketchArc_65.results()[1])
169 SketchConstraintRadius_6 = Sketch_2.setRadius(SketchArc_64.results()[1], "r_3")
170 SketchConstraintRadius_7 = Sketch_2.setRadius(SketchArc_63.results()[1], "r_2")
171 SketchConstraintDistanceVertical_1 = Sketch_2.setVerticalDistance(SketchArc_65.endPoint(), SketchLine_125.endPoint(), "ep")
172 SketchConstraintRadius_8 = Sketch_2.setRadius(SketchArc_62.results()[1], "R")
173 SketchConstraintAngle_5 = Sketch_2.setAngle(SketchLine_126.result(), SketchLine_125.result(), "360/NB")
174 SketchConstraintRadius_9 = Sketch_2.setRadius(SketchCircle_5.results()[1], "R")
175 SketchConstraintRadius_10 = Sketch_2.setRadius(SketchCircle_4.results()[1], "r_1")
176 SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_127.endPoint(), SketchLine_126.result(), "ep", True)
177 SketchMultiRotation_3_objects = [SketchArc_61.results()[1], SketchArc_64.results()[1], SketchLine_127.result(), SketchArc_63.results()[1], SketchArc_62.results()[1], SketchArc_65.results()[1], SketchLine_128.result(), SketchArc_66.results()[1]]
178 SketchMultiRotation_3 = Sketch_2.addRotation(SketchMultiRotation_3_objects, SketchCircle_5.center(), "360/NB", "NB")
179 [SketchArc_67, SketchArc_68, SketchArc_69, SketchArc_70, SketchArc_71, SketchArc_72, SketchArc_73, SketchArc_74, SketchArc_75, SketchArc_76, SketchLine_129, SketchLine_130, SketchLine_131, SketchLine_132, SketchLine_133, SketchArc_77, SketchArc_78, SketchArc_79, SketchArc_80, SketchArc_81, SketchArc_82, SketchArc_83, SketchArc_84, SketchArc_85, SketchArc_86, SketchArc_87, SketchArc_88, SketchArc_89, SketchArc_90, SketchArc_91, SketchLine_134, SketchLine_135, SketchLine_136, SketchLine_137, SketchLine_138, SketchArc_92, SketchArc_93, SketchArc_94, SketchArc_95, SketchArc_96] = SketchMultiRotation_3.rotated()
180 model.do()
181 model.checkSketch(Sketch_2, 0)
182
183 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 0, "e")
184 model.testNbResults(Extrusion_2, 7)
185 NB_SUBRES = 0
186 model.testNbSubResults(Extrusion_2, [NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES])
187 NB_SUBSH = 1
188 model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.SOLID, [NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH])
189 NB_F = [3, 10]
190 model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.FACE, [NB_F[0], NB_F[1], NB_F[1], NB_F[1], NB_F[1], NB_F[1], NB_F[1]])
191 NB_E = [6, 48]
192 model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.EDGE, [NB_E[0], NB_E[1], NB_E[1], NB_E[1], NB_E[1], NB_E[1], NB_E[1]])
193 model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.VERTEX, [2*NB_E[0], 2*NB_E[1], 2*NB_E[1], 2*NB_E[1], 2*NB_E[1], 2*NB_E[1], 2*NB_E[1]])
194 VOL = [238.564692131974851463382947259, 844.585236664367812409182079136]
195 model.testResultsVolumes(Extrusion_2, [VOL[0], VOL[1], VOL[1], VOL[1], VOL[1], VOL[1], VOL[1]])
196
197 Boolean_1_objects_2 = [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2"), model.selection("SOLID", "Extrusion_2_3"), model.selection("SOLID", "Extrusion_2_4"), model.selection("SOLID", "Extrusion_2_5"), model.selection("SOLID", "Extrusion_2_6"), model.selection("SOLID", "Extrusion_2_7")]
198 Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], Boolean_1_objects_2)
199 model.do()
200 model.testNbResults(Boolean_1, 1)
201 model.testNbSubResults(Boolean_1, [0])
202 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
203 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [231])
204 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [1374])
205 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [2748])
206 model.testResultsVolumes(Boolean_1, [5092.377854112805835029575973749])
207
208 # Change parameter 'Z' and check validity of result
209 Z_REF_DATA = [(20, 171, 1014, 2028,  1667.562983801989503263030201197),
210               (22, 183, 1086, 2172,  2160.297076967755856458097696304),
211               (25, 201, 1194, 2388,  3068.115476944114561774767935276),
212               (40, 291, 1734, 3468, 11471.942563079033789108507335186),
213               (34, 255, 1518, 3036,  7238.123725381414260482415556908),
214               (30, 231, 1374, 2748,  5092.377854112805835029575973749)]
215 for z in Z_REF_DATA:
216     Param_Z.setValue(z[0])
217     model.do()
218     Part_1_doc.setCurrentFeature(Boolean_1.feature(), False)
219     model.do()
220
221     model.testNbResults(Boolean_1, 1)
222     model.testNbSubResults(Boolean_1, [0])
223     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
224     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [z[1]])
225     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [z[2]])
226     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [z[3]])
227     model.testResultsVolumes(Boolean_1, [z[4]])
228
229 # Change parameter 'm' and check validity of result
230 M_REF_DATA = [(1.5, 14094.989002197671652538701891899),
231               (1.2, 8007.778784522399291745387017727),
232               (1.0, 5092.377854113199646235443651676)]
233 for m in M_REF_DATA:
234     Param_m.setValue(m[0])
235     model.do()
236
237     model.testNbResults(Boolean_1, 1)
238     model.testNbSubResults(Boolean_1, [0])
239     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
240     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [231])
241     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [1374])
242     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [2748])
243     model.testResultsVolumes(Boolean_1, [m[1]])
244
245 # change parameter 'NB' and check validity of result
246 NB_REF_DATA = [(4, 215, 1278, 2556, 4669.256782562274565862026065588),
247                (8, 247, 1470, 2940, 5515.498925714943652565125375986),
248                (7, 239, 1422, 2844, 5303.938389925016963388770818710),
249                (6, 231, 1374, 2748, 5092.377854112805835029575973749)]
250 for n in NB_REF_DATA:
251     Param_NB.setValue(n[0])
252     model.do()
253     Part_1_doc.setCurrentFeature(Boolean_1.feature(), False)
254     model.do()
255     Boolean_1_objects_2 = []
256     for res in Extrusion_2.results():
257         Boolean_1_objects_2.append(model.selection("SOLID", res.name()))
258     Boolean_1.setToolObjects(Boolean_1_objects_2)
259     model.do()
260
261     model.testNbResults(Boolean_1, 1)
262     model.testNbSubResults(Boolean_1, [0])
263     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
264     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [n[1]])
265     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [n[2]])
266     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [n[3]])
267     model.testResultsVolumes(Boolean_1, [n[4]])
268
269 model.end()
270
271 assert(model.checkPythonDump())