]> SALOME platform Git repositories - modules/shaper.git/blob - test.models/sprocket.py
Salome HOME
oubli
[modules/shaper.git] / test.models / sprocket.py
1 # Copyright (C) 2018-2022  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 email : webmaster.salome@opencascade.com
18 #
19
20 from SketchAPI import *
21 from GeomAPI import GeomAPI_Shape
22
23 from salome.shaper import model
24
25 model.begin()
26 partSet = model.moduleDocument()
27 Part_1 = model.addPart(partSet)
28 Part_1_doc = Part_1.document()
29
30 Param_m = model.addParameter(Part_1_doc, "m", "1")
31 Param_Z = model.addParameter(Part_1_doc, "Z", "30")
32 model.addParameter(Part_1_doc, "d", "m*Z")
33 model.addParameter(Part_1_doc, "da", "d+2*m")
34 model.addParameter(Part_1_doc, "df", "d-2.5*m")
35 model.addParameter(Part_1_doc, "ha", "m")
36 model.addParameter(Part_1_doc, "hf", "1.25*m")
37 model.addParameter(Part_1_doc, "h", "2.25*m")
38 model.addParameter(Part_1_doc, "e", "d/8.")
39 model.addParameter(Part_1_doc, "angle_L", "360/(d*2)")
40 model.addParameter(Part_1_doc, "R", "d*(13/16)")
41 model.addParameter(Part_1_doc, "r_1", "d/4")
42 model.addParameter(Part_1_doc, "r_2", "d/10")
43 model.addParameter(Part_1_doc, "r_3", "d/40")
44 model.addParameter(Part_1_doc, "R_1", "d*(3/20)")
45 model.addParameter(Part_1_doc, "ep", "1.5")
46 model.addParameter(Part_1_doc, "angle_1", "15")
47 model.addParameter(Part_1_doc, "angle_2", "21")
48 Param_NB = model.addParameter(Part_1_doc, "NB", "6")
49
50 Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
51 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
52 SketchPoint_1 = SketchProjection_1.createdFeature()
53 SketchCircle_1 = Sketch_1.addCircle(0, 0, 30)
54 SketchCircle_1.setAuxiliary(True)
55 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
56 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], "d")
57 SketchLine_1 = Sketch_1.addLine(-1.83495963955651, 27.43871212577585, -1.570078687288315, 29.95888604263722)
58 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
59 SketchLine_2 = Sketch_1.addLine(-1.570078687288315, 29.95888604263722, -0.7903152816259503, 31.99023916377664)
60 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
61 SketchLine_3 = Sketch_1.addLine(1.834959639556546, 27.43871212577585, 1.570078687288318, 29.95888604263721)
62 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchCircle_1.results()[1])
63 SketchLine_4 = Sketch_1.addLine(1.570078687288318, 29.95888604263721, 0.7903152816259467, 31.99023916377664)
64 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
65 SketchCircle_2 = Sketch_1.addCircle(0, 0, 27.5)
66 SketchCircle_2.setAuxiliary(True)
67 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchCircle_2.center())
68 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_2.results()[1])
69 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchCircle_2.results()[1])
70 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_4.result())
71 SketchArc_1 = Sketch_1.addArc(0, 0, 0.7903152816259467, 31.99023916377664, -0.7903152816259503, 31.99023916377664, False)
72 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_1.center())
73 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchArc_1.startPoint())
74 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.endPoint())
75 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
76 SketchLine_5 = SketchProjection_2.createdFeature()
77 SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_2.result(), SketchLine_5.result(), "angle_2")
78 SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_4.result(), "180+angle_1")
79 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
80 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], "da")
81 SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_2.results()[1], "df")
82 SketchLine_6 = Sketch_1.addLine(1.570078687288318, 29.95888604263721, 0, 0)
83 SketchLine_6.setAuxiliary(True)
84 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_6.startPoint())
85 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_6.endPoint())
86 SketchLine_7 = Sketch_1.addLine(-1.570078687288315, 29.95888604263722, 0, 0)
87 SketchLine_7.setAuxiliary(True)
88 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_7.startPoint())
89 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_7.endPoint())
90 SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_6.result(), SketchLine_5.result(), "angle_L/2")
91 SketchConstraintAngle_4 = Sketch_1.setAngle(SketchLine_5.result(), SketchLine_7.result(), "angle_L/2")
92 SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_3.result()], SketchAPI_Line(SketchLine_5).startPoint(), "360/Z", 2)
93 [SketchLine_8] = SketchMultiRotation_1.rotated()
94 SketchLine_8.setAuxiliary(True)
95 SketchArc_2 = Sketch_1.addArc(0, 0, -1.83495963955651, 27.43871212577585, -3.909967663056207, 27.22061999429577, False)
96 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_2.center())
97 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_2.startPoint())
98 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_8.result(), SketchArc_2.endPoint())
99 SketchProjection_3 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
100 SketchPoint_2 = SketchProjection_3.createdFeature()
101 SketchMultiRotation_2_objects = [SketchArc_2.results()[1], SketchLine_1.result(), SketchLine_2.result(), SketchArc_1.results()[1], SketchLine_4.result(), SketchLine_3.result()]
102 SketchMultiRotation_2 = Sketch_1.addRotation(SketchMultiRotation_2_objects, SketchAPI_Point(SketchPoint_2).coordinates(), "360/Z", "Z")
103 [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()
104 model.do()
105 model.checkSketch(Sketch_1, 0)
106
107 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "e", 0)
108 model.testNbResults(Extrusion_1, 1)
109 model.testNbSubResults(Extrusion_1, [0])
110 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [1])
111 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [182])
112 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [1080])
113 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [2160])
114 model.testResultsVolumes(Extrusion_1, [10398.453966298400700907222926617])
115
116 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
117 SketchCircle_3 = Sketch_2.addCircle(0, 0, 4.5)
118 SketchLine_125 = Sketch_2.addLine(0, 0, -24.375, 0)
119 SketchLine_125.setAuxiliary(True)
120 SketchLine_126 = Sketch_2.addLine(0, 0, -12.18750000000149, 21.10936921724762)
121 SketchLine_126.setAuxiliary(True)
122 SketchLine_127 = Sketch_2.addLine(-5.267665072275066, 6.123863542435089, -11.74701189249443, 17.34642143491413)
123 SketchConstraintParallel_1 = Sketch_2.setParallel(SketchLine_127.result(), SketchLine_126.result())
124 SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_125.result())
125 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_125.startPoint(), SketchLine_126.startPoint())
126 SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
127 SketchPoint_3 = SketchProjection_4.createdFeature()
128 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_125.startPoint(), SketchAPI_Point(SketchPoint_3).coordinates())
129 SketchCircle_4 = Sketch_2.addCircle(0, 0, 7.5)
130 SketchCircle_4.setAuxiliary(True)
131 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchCircle_4.center())
132 SketchCircle_5 = Sketch_2.addCircle(0, 0, 24.375)
133 SketchCircle_5.setAuxiliary(True)
134 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchCircle_5.center())
135 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_126.endPoint(), SketchCircle_5.results()[1])
136 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_125.endPoint(), SketchCircle_5.results()[1])
137 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchAPI_Point(SketchPoint_3).coordinates())
138 SketchArc_61 = Sketch_2.addArc(0, 0, -5.379258295557134, 5.22623958403169, -7.21568539381252, 2.045454545454545, False)
139 SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchArc_61.center())
140 SketchArc_62 = Sketch_2.addArc(0, 0, -16.35843380263332, 18.07048058367397, -23.82871214537519, 5.131578947350746, False)
141 SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchArc_62.center())
142 SketchArc_63 = Sketch_2.addArc(-14.34508810384774, 15.8464214349141, -11.74701189249443, 17.34642143491413, -16.35843380263332, 18.07048058367397, False)
143 SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchArc_63.startPoint(), SketchLine_127.endPoint())
144 SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchArc_63.endPoint(), SketchArc_62.startPoint())
145 SketchConstraintTangent_1 = Sketch_2.setTangent(SketchArc_63.results()[1], SketchLine_127.result())
146 SketchConstraintTangent_2 = Sketch_2.setTangent(SketchArc_63.results()[1], SketchArc_62.results()[1])
147 SketchArc_64 = Sketch_2.addArc(-5.917184125113392, 5.74886354243508, -5.379258295557134, 5.22623958403169, -5.267665072275066, 6.123863542435089, False)
148 SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchArc_64.startPoint(), SketchArc_61.startPoint())
149 SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchArc_64.endPoint(), SketchLine_127.startPoint())
150 SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_64.results()[1], SketchArc_61.results()[1])
151 SketchConstraintTangent_4 = Sketch_2.setTangent(SketchArc_64.results()[1], SketchLine_127.result())
152 SketchLine_128 = Sketch_2.addLine(-20.8959475736328, 1.5, -7.937253933193772, 1.5)
153 SketchArc_65 = Sketch_2.addArc(-20.89594757363278, 4.500000000000018, -23.82871214537519, 5.131578947350746, -20.8959475736328, 1.5, False)
154 SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchArc_65.startPoint(), SketchArc_62.endPoint())
155 SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchArc_65.endPoint(), SketchLine_128.startPoint())
156 SketchConstraintTangent_5 = Sketch_2.setTangent(SketchArc_65.results()[1], SketchLine_128.result())
157 SketchConstraintTangent_6 = Sketch_2.setTangent(SketchArc_65.results()[1], SketchArc_62.results()[1])
158 SketchArc_66 = Sketch_2.addArc(-7.937253933193772, 2.25, -7.937253933193772, 1.5, -7.21568539381252, 2.045454545454545, False)
159 SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchArc_66.startPoint(), SketchLine_128.endPoint())
160 SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchArc_66.endPoint(), SketchArc_61.endPoint())
161 SketchConstraintTangent_7 = Sketch_2.setTangent(SketchArc_66.results()[1], SketchLine_128.result())
162 SketchConstraintTangent_8 = Sketch_2.setTangent(SketchArc_66.results()[1], SketchArc_61.results()[1])
163 SketchConstraintParallel_2 = Sketch_2.setParallel(SketchLine_128.result(), SketchLine_125.result())
164 SketchConstraintRadius_4 = Sketch_2.setRadius(SketchCircle_3.results()[1], "R_1")
165 SketchConstraintRadius_5 = Sketch_2.setRadius(SketchArc_61.results()[1], "r_1")
166 SketchConstraintEqual_3 = Sketch_2.setEqual(SketchArc_64.results()[1], SketchArc_66.results()[1])
167 SketchConstraintEqual_4 = Sketch_2.setEqual(SketchArc_63.results()[1], SketchArc_65.results()[1])
168 SketchConstraintRadius_6 = Sketch_2.setRadius(SketchArc_64.results()[1], "r_3")
169 SketchConstraintRadius_7 = Sketch_2.setRadius(SketchArc_63.results()[1], "r_2")
170 SketchConstraintDistanceVertical_1 = Sketch_2.setVerticalDistance(SketchArc_65.endPoint(), SketchLine_125.endPoint(), "ep")
171 SketchConstraintRadius_8 = Sketch_2.setRadius(SketchArc_62.results()[1], "R")
172 SketchConstraintAngle_5 = Sketch_2.setAngle(SketchLine_126.result(), SketchLine_125.result(), "360/NB")
173 SketchConstraintRadius_9 = Sketch_2.setRadius(SketchCircle_5.results()[1], "R")
174 SketchConstraintRadius_10 = Sketch_2.setRadius(SketchCircle_4.results()[1], "r_1")
175 SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_127.endPoint(), SketchLine_126.result(), "ep", True)
176 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]]
177 SketchMultiRotation_3 = Sketch_2.addRotation(SketchMultiRotation_3_objects, SketchCircle_5.center(), "360/NB", "NB")
178 [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()
179 model.do()
180 model.checkSketch(Sketch_2, 0)
181
182 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 0, "e")
183 model.testNbResults(Extrusion_2, 7)
184 NB_SUBRES = 0
185 model.testNbSubResults(Extrusion_2, [NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES, NB_SUBRES])
186 NB_SUBSH = 1
187 model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.SOLID, [NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH, NB_SUBSH])
188 NB_F = [3, 10]
189 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]])
190 NB_E = [6, 48]
191 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]])
192 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]])
193 VOL = [238.564692131974851463382947259, 844.585236664367812409182079136]
194 model.testResultsVolumes(Extrusion_2, [VOL[0], VOL[1], VOL[1], VOL[1], VOL[1], VOL[1], VOL[1]])
195
196 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")]
197 Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], Boolean_1_objects_2)
198 model.do()
199 model.testNbResults(Boolean_1, 1)
200 model.testNbSubResults(Boolean_1, [0])
201 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
202 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [231])
203 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [1374])
204 model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [2748])
205 model.testResultsVolumes(Boolean_1, [5092.377854112805835029575973749])
206
207 # Change parameter 'Z' and check validity of result
208 Z_REF_DATA = [(20, 171, 1014, 2028,  1667.562983801989503263030201197),
209               (22, 183, 1086, 2172,  2160.297076967755856458097696304),
210               (25, 201, 1194, 2388,  3068.115476944114561774767935276),
211               (40, 291, 1734, 3468, 11471.942563079033789108507335186),
212               (34, 255, 1518, 3036,  7238.122819170104776276275515556),
213               (30, 231, 1374, 2748,  5092.377854112805835029575973749)]
214 for z in Z_REF_DATA:
215     Param_Z.setValue(z[0])
216     model.do()
217     Part_1_doc.setCurrentFeature(Boolean_1.feature(), False)
218     model.do()
219
220     model.testNbResults(Boolean_1, 1)
221     model.testNbSubResults(Boolean_1, [0])
222     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
223     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [z[1]])
224     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [z[2]])
225     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [z[3]])
226     model.testResultsVolumes(Boolean_1, [z[4]])
227
228 # Change parameter 'm' and check validity of result
229 M_REF_DATA = [(1.5, 14094.989002197671652538701891899),
230               (1.2, 8007.778784522399291745387017727),
231               (1.0, 5092.377854113199646235443651676)]
232 for m in M_REF_DATA:
233     Param_m.setValue(m[0])
234     model.do()
235
236     model.testNbResults(Boolean_1, 1)
237     model.testNbSubResults(Boolean_1, [0])
238     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
239     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [231])
240     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [1374])
241     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [2748])
242     model.testResultsVolumes(Boolean_1, [m[1]])
243
244 # change parameter 'NB' and check validity of result
245 NB_REF_DATA = [(4, 215, 1278, 2556, 4669.256782562274565862026065588),
246                (8, 247, 1470, 2940, 5515.498925714943652565125375986),
247                (7, 239, 1422, 2844, 5303.938389925016963388770818710),
248                (6, 231, 1374, 2748, 5092.377854112805835029575973749)]
249 for n in NB_REF_DATA:
250     Param_NB.setValue(n[0])
251     model.do()
252     Part_1_doc.setCurrentFeature(Boolean_1.feature(), False)
253     model.do()
254     Boolean_1_objects_2 = []
255     for res in Extrusion_2.results():
256         Boolean_1_objects_2.append(model.selection("SOLID", res.name()))
257     Boolean_1.setToolObjects(Boolean_1_objects_2)
258     model.do()
259
260     model.testNbResults(Boolean_1, 1)
261     model.testNbSubResults(Boolean_1, [0])
262     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
263     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [n[1]])
264     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [n[2]])
265     model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [n[3]])
266     model.testResultsVolumes(Boolean_1, [n[4]])
267
268 model.end()
269
270 assert(model.checkPythonDump())