]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/Test/Test2859.py
Salome HOME
Added a unit-test for #21537 : Dumped file not loadable
[modules/shaper.git] / src / ModelAPI / Test / Test2859.py
1 # Copyright (C) 2014-2020  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 ModelAPI import *
22 from salome.shaper import model
23
24 model.begin()
25 partSet = model.moduleDocument()
26 Part_1 = model.addPart(partSet)
27 Part_1_doc = Part_1.document()
28 model.addParameter(Part_1_doc, "h1", "15")
29 param_h2 = model.addParameter(Part_1_doc, "h2", "70")
30 model.addParameter(Part_1_doc, "h3", "7")
31 model.addParameter(Part_1_doc, "d", "15")
32 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
33 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
34 SketchPoint_1 = SketchProjection_1.createdFeature()
35 SketchLine_1 = Sketch_1.addLine(-7.500000000000083, -15.81138830084192, -7.500000000000083, -26.99999999999995)
36 SketchLine_1.setName("SketchLine_2")
37 SketchLine_1.result().setName("SketchLine_2")
38 SketchLine_2 = Sketch_1.addLine(-4.499999999999853, -30, 4.499999999999912, -30)
39 SketchLine_2.setName("SketchLine_3")
40 SketchLine_2.result().setName("SketchLine_3")
41 SketchLine_3 = Sketch_1.addLine(7.499999999999912, -27, 7.499999999999912, -15.81138830084196)
42 SketchLine_3.setName("SketchLine_4")
43 SketchLine_3.result().setName("SketchLine_4")
44 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
45 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
46 SketchConstraintHorizontal_1.setName("SketchConstraintHorizontal_2")
47 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
48 SketchPoint_2 = Sketch_1.addPoint(0, -30)
49 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_2.result())
50 SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_6")
51 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
52 SketchLine_4 = SketchProjection_2.createdFeature()
53 SketchLine_4.setName("SketchLine_5")
54 SketchLine_4.result().setName("SketchLine_5")
55 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result())
56 SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_7")
57 SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
58 SketchLine_5 = SketchProjection_3.createdFeature()
59 SketchLine_5.setName("SketchLine_6")
60 SketchLine_5.result().setName("SketchLine_6")
61 SketchArc_1 = Sketch_1.addArc(0, 0, -7.500000000000083, -15.81138830084192, -17.44306393762917, 1.410503622037771, True)
62 SketchArc_1.setName("SketchArc_2")
63 SketchArc_1.result().setName("SketchArc_2")
64 SketchArc_1.results()[1].setName("SketchArc_2_2")
65 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
66 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 17.5)
67 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.startPoint())
68 SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_14")
69 SketchArc_2 = Sketch_1.addArc(-4.499999999999853, -27, -7.500000000000083, -26.99999999999995, -4.499999999999853, -30, False)
70 SketchArc_2.setName("SketchArc_3")
71 SketchArc_2.result().setName("SketchArc_3")
72 SketchArc_2.results()[1].setName("SketchArc_3_2")
73 SketchPoint_3 = Sketch_1.addPoint(-7.500000000000085, -30)
74 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchLine_5.result(), 30, True)
75 SketchPoint_3.setAuxiliary(True)
76 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_2.result())
77 SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8")
78 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_1.result())
79 SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
80 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_1.endPoint())
81 SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10")
82 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_2.startPoint())
83 SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_11")
84 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_2.result())
85 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_1.result())
86 SketchArc_3 = Sketch_1.addArc(4.499999999999912, -27, 4.499999999999912, -30, 7.499999999999912, -27, False)
87 SketchArc_3.setName("SketchArc_4")
88 SketchArc_3.result().setName("SketchArc_4")
89 SketchArc_3.results()[1].setName("SketchArc_4_2")
90 SketchPoint_4 = Sketch_1.addPoint(7.499999999999914, -30)
91 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchPoint_4.coordinates(), 15, False)
92 SketchPoint_4.setAuxiliary(True)
93 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_3.result())
94 SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_13")
95 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_2.result())
96 SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_15")
97 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchLine_2.endPoint())
98 SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_16")
99 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_3.startPoint())
100 SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_17")
101 SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_3.result())
102 SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_2.result())
103 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 3)
104 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_3.results()[1], SketchArc_2.results()[1])
105 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
106 SketchMultiRotation_1_objects = [SketchLine_1.result(), SketchArc_2.results()[1], SketchLine_2.result(), SketchArc_3.results()[1], SketchLine_3.result()]
107 SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_5).startPoint(), 360, 3, True)
108 [SketchLine_6, SketchLine_7, SketchArc_4, SketchArc_5, SketchLine_8, SketchLine_9, SketchArc_6, SketchArc_7, SketchLine_10, SketchLine_11] = SketchMultiRotation_1.rotated()
109 SketchLine_11.setName("SketchLine_14")
110 SketchLine_11.result().setName("SketchLine_14")
111 SketchLine_10.setName("SketchLine_13")
112 SketchLine_10.result().setName("SketchLine_13")
113 SketchArc_7.setName("SketchArc_9")
114 SketchArc_7.result().setName("SketchArc_9")
115 SketchArc_7.results()[1].setName("SketchArc_9_2")
116 SketchArc_6.setName("SketchArc_8")
117 SketchArc_6.result().setName("SketchArc_8")
118 SketchArc_6.results()[1].setName("SketchArc_8_2")
119 SketchLine_9.setName("SketchLine_11")
120 SketchLine_9.result().setName("SketchLine_11")
121 SketchLine_8.setName("SketchLine_10")
122 SketchLine_8.result().setName("SketchLine_10")
123 SketchArc_5.setName("SketchArc_6")
124 SketchArc_5.result().setName("SketchArc_6")
125 SketchArc_5.results()[1].setName("SketchArc_6_2")
126 SketchArc_4.setName("SketchArc_5")
127 SketchArc_4.result().setName("SketchArc_5")
128 SketchArc_4.results()[1].setName("SketchArc_5_2")
129 SketchLine_7.setName("SketchLine_8")
130 SketchLine_7.result().setName("SketchLine_8")
131 SketchLine_6.setName("SketchLine_7")
132 SketchLine_6.result().setName("SketchLine_7")
133 SketchArc_8 = Sketch_1.addArc(0, 0, -9.943063937629109, 14.40088467880429, 9.94306393762926, 14.40088467880419, True)
134 SketchArc_8.setName("SketchArc_10")
135 SketchArc_8.result().setName("SketchArc_10")
136 SketchArc_8.results()[1].setName("SketchArc_10_2")
137 SketchConstraintEqual_3 = Sketch_1.setEqual(SketchArc_1.results()[1], SketchArc_8.results()[1])
138 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_1.center(), SketchArc_8.center())
139 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_18")
140 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_11.result())
141 SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_19")
142 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchArc_8.startPoint(), SketchLine_7.result())
143 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_20")
144 SketchArc_9 = Sketch_1.addArc(0, 0, 17.44306393762918, 1.410503622037589, 7.499999999999912, -15.81138830084196, True)
145 SketchArc_9.setName("SketchArc_11")
146 SketchArc_9.result().setName("SketchArc_11")
147 SketchArc_9.results()[1].setName("SketchArc_11_2")
148 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_9.endPoint(), SketchLine_3.endPoint())
149 SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_12")
150 SketchConstraintEqual_4 = Sketch_1.setEqual(SketchArc_8.results()[1], SketchArc_9.results()[1])
151 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_8.center(), SketchArc_9.center())
152 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_21")
153 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_8.endPoint(), SketchLine_10.result())
154 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_22")
155 SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_9.startPoint(), SketchLine_6.result())
156 SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_23")
157 SketchCircle_1 = Sketch_1.addCircle(0, 0, 24)
158 SketchCircle_1.setAuxiliary(True)
159 SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchCircle_1.center())
160 SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24")
161 SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_1.results()[1], 24)
162 SketchCircle_2 = Sketch_1.addCircle(0, -24, 4)
163 SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
164 SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_25")
165 SketchConstraintRadius_4 = Sketch_1.setRadius(SketchCircle_2.results()[1], 4)
166 SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchLine_4.result())
167 SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26")
168 SketchMultiRotation_2 = Sketch_1.addRotation([SketchCircle_2.results()[1]], SketchAPI_Line(SketchLine_4).startPoint(), 360, 3, True)
169 [SketchCircle_3, SketchCircle_4] = SketchMultiRotation_2.rotated()
170 model.do()
171 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_3_2f-SketchLine_3f-SketchArc_4_2f-SketchLine_4f-SketchArc_11_2f-SketchLine_7f-SketchArc_5_2f-SketchLine_10f-SketchArc_8_2f-SketchLine_13f-SketchArc_10_2f-SketchLine_8f-SketchArc_6_2f-SketchLine_11f-SketchArc_9_2f-SketchLine_14f-SketchArc_2_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r")], model.selection(), "h1", 0)
172 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
173 SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
174 SketchLine_12 = SketchProjection_4.createdFeature()
175 SketchLine_12.setName("SketchLine_12")
176 SketchLine_12.result().setName("SketchLine_12")
177 SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
178 SketchLine_13 = SketchProjection_5.createdFeature()
179 SketchLine_13.setName("SketchLine_15")
180 SketchLine_13.result().setName("SketchLine_15")
181 SketchLine_14 = Sketch_2.addLine(7.500000000000332, 12.99038105676728, 15, 0)
182 SketchLine_14.setName("SketchLine_16")
183 SketchLine_14.result().setName("SketchLine_16")
184 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_12.result())
185 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_28")
186 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_14.startPoint(), "d", True)
187 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_14.endPoint(), "d", True)
188 SketchLine_15 = Sketch_2.addLine(0, 0, 7.500000000000332, 12.99038105676728)
189 SketchLine_15.setName("SketchLine_17")
190 SketchLine_15.result().setName("SketchLine_17")
191 SketchLine_15.setAuxiliary(True)
192 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
193 SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_27")
194 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchLine_15.endPoint())
195 SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29")
196 SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_12.result(), SketchLine_15.result(), "360/6")
197 SketchMultiRotation_3 = Sketch_2.addRotation([SketchLine_14.result()], SketchAPI_Line(SketchLine_12).startPoint(), 360, 6, True)
198 [SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_20] = SketchMultiRotation_3.rotated()
199 SketchLine_20.setName("SketchLine_22")
200 SketchLine_20.result().setName("SketchLine_22")
201 SketchLine_19.setName("SketchLine_21")
202 SketchLine_19.result().setName("SketchLine_21")
203 SketchLine_18.setName("SketchLine_20")
204 SketchLine_18.result().setName("SketchLine_20")
205 SketchLine_17.setName("SketchLine_19")
206 SketchLine_17.result().setName("SketchLine_19")
207 SketchLine_16.setName("SketchLine_18")
208 SketchLine_16.result().setName("SketchLine_18")
209 model.do()
210 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_18r-SketchLine_19r-SketchLine_20r-SketchLine_21r-SketchLine_22r-SketchLine_16r_wire")], model.selection(), "h2-h3-h1", 0)
211 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face"))
212 SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
213 SketchLine_21 = SketchProjection_6.createdFeature()
214 SketchLine_21.setName("SketchLine_23")
215 SketchLine_21.result().setName("SketchLine_23")
216 SketchCircle_5 = Sketch_3.addCircle(0, 0, 10)
217 SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_21).startPoint(), SketchCircle_5.center())
218 SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30")
219 SketchConstraintRadius_5 = Sketch_3.setRadius(SketchCircle_5.results()[1], 10)
220 model.do()
221 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
222 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_5_2f")], model.selection(), 0, 60, [model.selection("SOLID", "Fuse_1_1")])
223 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/From_Face"))
224 SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), False)
225 SketchLine_22 = SketchProjection_7.createdFeature()
226 SketchLine_22.setName("SketchLine_24")
227 SketchLine_22.result().setName("SketchLine_24")
228 SketchCircle_6 = Sketch_4.addCircle(0, 0, 12.5)
229 SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchAPI_Line(SketchLine_22).startPoint(), SketchCircle_6.center())
230 SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_31")
231 SketchConstraintRadius_6 = Sketch_4.setRadius(SketchCircle_6.results()[1], 12.5)
232 model.do()
233 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_3_2f-SketchLine_3f-SketchArc_4_2f-SketchLine_4f-SketchArc_11_2f-SketchLine_7f-SketchArc_5_2f-SketchLine_10f-SketchArc_8_2f-SketchLine_13f-SketchArc_10_2f-SketchLine_8f-SketchArc_6_2f-SketchLine_11f-SketchArc_9_2f-SketchLine_14f-SketchArc_2_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
234 Fillet_1_objects = [model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_20]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_21]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_22]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_16]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_19]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_18]")]
235 Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 1)
236 Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_2_1/To_Face"))
237 SketchProjection_8 = Sketch_5.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Extrusion_2_1/To_Face][ExtrusionCut_1_1/Generated_Face&Sketch_3/SketchCircle_5_2]__cc"), False)
238 SketchPoint_5 = SketchProjection_8.createdFeature()
239 SketchCircle_7 = Sketch_5.addCircle(0, 0, 22)
240 SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchPoint_5.result(), SketchCircle_7.center())
241 SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_32")
242 SketchConstraintRadius_7 = Sketch_5.setRadius(SketchCircle_7.results()[1], 22)
243 model.do()
244 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchCircle_7_2f")], model.selection(), "h3", 0)
245 Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fillet_1_1"), model.selection("SOLID", "Extrusion_3_1")])
246 Sketch_6 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
247 SketchLine_23 = Sketch_6.addLine(22, 70, 20, 70)
248 SketchLine_23.setName("SketchLine_25")
249 SketchLine_23.result().setName("SketchLine_25")
250 SketchProjection_9 = Sketch_6.addProjection(model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_5/SketchCircle_7_2][Extrusion_3_1/To_Face]"), False)
251 SketchPoint_6 = SketchProjection_9.createdFeature()
252 SketchConstraintCoincidence_29 = Sketch_6.setCoincident(SketchLine_23.startPoint(), SketchPoint_6.result())
253 SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_33")
254 SketchLine_24 = Sketch_6.addLine(20, 70, 22, 68.84529946162075)
255 SketchLine_24.setName("SketchLine_26")
256 SketchLine_24.result().setName("SketchLine_26")
257 SketchConstraintCoincidence_30 = Sketch_6.setCoincident(SketchLine_23.endPoint(), SketchLine_24.startPoint())
258 SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_34")
259 SketchProjection_10 = Sketch_6.addProjection(model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_5/SketchCircle_7_2][Extrusion_3_1/To_Face])_Fuse_2_1"), False)
260 SketchLine_25 = SketchProjection_10.createdFeature()
261 SketchLine_25.setName("SketchLine_27")
262 SketchLine_25.result().setName("SketchLine_27")
263 SketchConstraintCoincidence_31 = Sketch_6.setCoincident(SketchLine_24.endPoint(), SketchLine_25.result())
264 SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_35")
265 SketchLine_26 = Sketch_6.addLine(22, 68.84529946162075, 22, 70)
266 SketchLine_26.setName("SketchLine_28")
267 SketchLine_26.result().setName("SketchLine_28")
268 SketchConstraintCoincidence_32 = Sketch_6.setCoincident(SketchLine_24.endPoint(), SketchLine_26.startPoint())
269 SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_36")
270 SketchConstraintCoincidence_33 = Sketch_6.setCoincident(SketchLine_23.startPoint(), SketchLine_26.endPoint())
271 SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_37")
272 SketchLine_27 = Sketch_6.addLine(21.99999999999999, 64, 22, 63)
273 SketchLine_27.setName("SketchLine_29")
274 SketchLine_27.result().setName("SketchLine_29")
275 SketchConstraintCoincidence_34 = Sketch_6.setCoincident(SketchLine_27.startPoint(), SketchLine_25.result())
276 SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_38")
277 SketchConstraintCoincidence_35 = Sketch_6.setCoincident(SketchAPI_Line(SketchLine_25).startPoint(), SketchLine_27.endPoint())
278 SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_39")
279 SketchLine_28 = Sketch_6.addLine(21.99999999999999, 64, 21.73205080756888, 63)
280 SketchLine_28.setName("SketchLine_30")
281 SketchLine_28.result().setName("SketchLine_30")
282 SketchConstraintCoincidence_36 = Sketch_6.setCoincident(SketchLine_27.startPoint(), SketchLine_28.startPoint())
283 SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_40")
284 SketchLine_29 = Sketch_6.addLine(21.73205080756888, 63, 22, 63)
285 SketchLine_29.setName("SketchLine_31")
286 SketchLine_29.result().setName("SketchLine_31")
287 SketchConstraintCoincidence_37 = Sketch_6.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
288 SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_41")
289 SketchConstraintCoincidence_38 = Sketch_6.setCoincident(SketchAPI_Line(SketchLine_25).startPoint(), SketchLine_29.endPoint())
290 SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_42")
291 SketchConstraintLength_1 = Sketch_6.setLength(SketchLine_23.result(), 2)
292 SketchConstraintAngle_2 = Sketch_6.setAngleBackward(SketchLine_23.result(), SketchLine_24.result(), 30)
293 SketchConstraintHorizontal_2 = Sketch_6.setHorizontal(SketchLine_23.result())
294 SketchConstraintHorizontal_2.setName("SketchConstraintHorizontal_3")
295 SketchConstraintHorizontal_3 = Sketch_6.setHorizontal(SketchLine_29.result())
296 SketchConstraintHorizontal_3.setName("SketchConstraintHorizontal_4")
297 SketchConstraintLength_2 = Sketch_6.setLength(SketchLine_27.result(), 1)
298 SketchConstraintAngle_3 = Sketch_6.setAngle(SketchLine_28.result(), SketchLine_27.result(), 15)
299 model.do()
300 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
301 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fuse_2_1")], [model.selection("SOLID", "Revolution_1_2"), model.selection("SOLID", "Revolution_1_1")])
302 Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Cut_1_1/Modified_Face&Extrusion_3_1/To_Face"))
303 SketchProjection_11 = Sketch_7.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_6/SketchLine_26][Cut_1_1/Modified_Face&Extrusion_3_1/To_Face]__cc"), False)
304 SketchPoint_7 = SketchProjection_11.createdFeature()
305 SketchCircle_8 = Sketch_7.addCircle(0, 0, 26)
306 SketchCircle_8.setAuxiliary(True)
307 SketchConstraintCoincidence_39 = Sketch_7.setCoincident(SketchPoint_7.result(), SketchCircle_8.center())
308 SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43")
309 SketchConstraintRadius_8 = Sketch_7.setRadius(SketchCircle_8.results()[1], 26)
310 SketchCircle_9 = Sketch_7.addCircle(0, -26, 5.25)
311 SketchConstraintCoincidence_40 = Sketch_7.setCoincident(SketchCircle_8.results()[1], SketchCircle_9.center())
312 SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44")
313 SketchProjection_12 = Sketch_7.addProjection(model.selection("EDGE", "PartSet/OY"), False)
314 SketchLine_30 = SketchProjection_12.createdFeature()
315 SketchLine_30.setName("SketchLine_32")
316 SketchLine_30.result().setName("SketchLine_32")
317 SketchConstraintRadius_9 = Sketch_7.setRadius(SketchCircle_9.results()[1], 5.25)
318 SketchConstraintCoincidence_41 = Sketch_7.setCoincident(SketchCircle_9.center(), SketchLine_30.result())
319 SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45")
320 SketchMultiRotation_4 = Sketch_7.addRotation([SketchCircle_9.results()[1]], SketchAPI_Line(SketchLine_30).startPoint(), 360, 16, True)
321 [SketchCircle_10, SketchCircle_11, SketchCircle_12, SketchCircle_13, SketchCircle_14, SketchCircle_15, SketchCircle_16, SketchCircle_17, SketchCircle_18, SketchCircle_19, SketchCircle_20, SketchCircle_21, SketchCircle_22, SketchCircle_23, SketchCircle_24] = SketchMultiRotation_4.rotated()
322 model.do()
323 Extrusion_4_objects = [model.selection("FACE", "Sketch_7/Face-SketchCircle_19_2f-SketchCircle_20_2r-SketchCircle_19_2f-SketchCircle_19_2f-SketchCircle_18_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_18_2f-SketchCircle_19_2r-SketchCircle_18_2f-SketchCircle_17_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_17_2f-SketchCircle_18_2r-SketchCircle_18_2r-SketchCircle_17_2f-SketchCircle_16_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_15_2f-SketchCircle_15_2f-SketchCircle_16_2r-SketchCircle_15_2f-SketchCircle_14_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_16_2f-SketchCircle_16_2f-SketchCircle_17_2r-SketchCircle_17_2r-SketchCircle_16_2f-SketchCircle_15_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_14_2f-SketchCircle_14_2f-SketchCircle_15_2r-SketchCircle_14_2f-SketchCircle_13_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_13_2f-SketchCircle_13_2f-SketchCircle_14_2r-SketchCircle_13_2f-SketchCircle_12_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_12_2f-SketchCircle_12_2f-SketchCircle_13_2r-SketchCircle_12_2f-SketchCircle_11_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_11_2f-SketchCircle_11_2f-SketchCircle_12_2r-SketchCircle_11_2f-SketchCircle_10_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_9_2r-SketchCircle_10_2f-SketchCircle_10_2f-SketchCircle_11_2r-SketchCircle_10_2f-SketchCircle_9_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_9_2f-SketchCircle_24_2r-SketchCircle_24_2r-SketchCircle_9_2f-SketchCircle_10_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_24_2f-SketchCircle_23_2r-SketchCircle_24_2f-SketchCircle_9_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_23_2f-SketchCircle_24_2r-SketchCircle_23_2f-SketchCircle_23_2f-SketchCircle_22_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_22_2f-SketchCircle_23_2r-SketchCircle_22_2f-SketchCircle_22_2f-SketchCircle_21_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_21_2f-SketchCircle_22_2r-SketchCircle_21_2f-SketchCircle_21_2f-SketchCircle_20_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_20_2f-SketchCircle_21_2r-SketchCircle_20_2f-SketchCircle_20_2f-SketchCircle_19_2r")]
324 Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection(), model.selection("FACE", "Sketch_5/Face-SketchCircle_7_2f"), 0, model.selection(), 0)
325 model.do()
326 # change the parameter value
327 param_h2.setValue(90)
328 model.end()
329 # check the final extrusion is valid:
330 aFactory = ModelAPI_Session.get().validators()
331 assert(aFactory.validate(Extrusion_4.feature()))
332
333 model.testResultsVolumes(Extrusion_4, [597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447])