1 # Copyright (C) 2020 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 from SketchAPI import *
22 from salome.shaper import model
25 partSet = model.moduleDocument()
26 Part_1 = model.addPart(partSet)
27 Part_1_doc = Part_1.document()
28 model.addParameter(Part_1_doc, "l", "50")
29 width = model.addParameter(Part_1_doc, "width", "10")
30 Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
31 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
32 SketchPoint_1 = SketchProjection_1.createdFeature()
33 SketchCircle_1 = Sketch_1.addCircle(0, 0, 9)
34 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
35 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 9)
36 SketchArc_1 = Sketch_1.addArc(0, 0, 18.97366669488877, 0.9999860756345847, -18.97366670156818, 0.9999859489016699, False)
37 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], 19)
38 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.center(), SketchCircle_1.center())
39 SketchProjection_2 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
40 SketchPoint_2 = SketchProjection_2.createdFeature()
41 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchArc_1.center())
42 SketchLine_1 = Sketch_1.addLine(-44, -2.000000000000004, 44, -2)
43 SketchLine_1.setName("SketchLine_2")
44 SketchLine_1.result().setName("SketchLine_2")
45 SketchLine_1.setAuxiliary(True)
46 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
47 SketchArc_2 = Sketch_1.addArc(-21.97366670156818, 1, -18.97366670156818, 0.9999859489016699, -21.97366670156818, -2, True)
48 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint())
49 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_2.endPoint())
50 SketchArc_3 = Sketch_1.addArc(21.97366669488877, 1, 18.97366669488877, 0.9999860756345847, 21.97366670156818, -2, False)
51 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchArc_3.startPoint())
52 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchArc_2.center(), SketchArc_2.startPoint(), 3)
53 SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchArc_3.center(), SketchArc_1.startPoint(), 3)
54 SketchLine_2 = Sketch_1.addLine(-21.97366670156818, -2, -44, -2.000000000000003)
55 SketchLine_2.setName("SketchLine_3")
56 SketchLine_2.result().setName("SketchLine_3")
57 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_2.startPoint())
58 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result())
59 SketchLine_3 = Sketch_1.addLine(-44, -2.000000000000003, -44, -15)
60 SketchLine_3.setName("SketchLine_4")
61 SketchLine_3.result().setName("SketchLine_4")
62 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
63 SketchLine_4 = Sketch_1.addLine(-44, -15, -18.09005251512554, -15)
64 SketchLine_4.setName("SketchLine_5")
65 SketchLine_4.result().setName("SketchLine_5")
66 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
67 SketchLine_5 = Sketch_1.addLine(-18.09005251512554, -15, -18.09005251512554, -18)
68 SketchLine_5.setName("SketchLine_6")
69 SketchLine_5.result().setName("SketchLine_6")
70 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
71 SketchLine_6 = Sketch_1.addLine(-18.09005251512554, -18, -4.999999999999997, -18)
72 SketchLine_6.setName("SketchLine_7")
73 SketchLine_6.result().setName("SketchLine_7")
74 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
75 SketchLine_7 = Sketch_1.addLine(-4.999999999999997, -18, -4.999999999999997, -24)
76 SketchLine_7.setName("SketchLine_8")
77 SketchLine_7.result().setName("SketchLine_8")
78 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
79 SketchLine_8 = Sketch_1.addLine(-4.999999999999997, -24, 5.000000000000002, -24)
80 SketchLine_8.setName("SketchLine_9")
81 SketchLine_8.result().setName("SketchLine_9")
82 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
83 SketchLine_9 = Sketch_1.addLine(5.000000000000002, -24, 5.000000000000002, -18)
84 SketchLine_9.setName("SketchLine_10")
85 SketchLine_9.result().setName("SketchLine_10")
86 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
87 SketchLine_10 = Sketch_1.addLine(5.000000000000002, -18, 18.09005251512554, -18)
88 SketchLine_10.setName("SketchLine_11")
89 SketchLine_10.result().setName("SketchLine_11")
90 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
91 SketchLine_11 = Sketch_1.addLine(18.09005251512554, -18, 18.09005251512554, -15)
92 SketchLine_11.setName("SketchLine_12")
93 SketchLine_11.result().setName("SketchLine_12")
94 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
95 SketchLine_12 = Sketch_1.addLine(18.09005251512554, -15, 44, -15)
96 SketchLine_12.setName("SketchLine_13")
97 SketchLine_12.result().setName("SketchLine_13")
98 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
99 SketchLine_13 = Sketch_1.addLine(44, -15, 44, -2.000000000000003)
100 SketchLine_13.setName("SketchLine_14")
101 SketchLine_13.result().setName("SketchLine_14")
102 SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
103 SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_1.result())
104 SketchLine_14 = Sketch_1.addLine(44, -2.000000000000003, 21.97366670156818, -2)
105 SketchLine_14.setName("SketchLine_15")
106 SketchLine_14.result().setName("SketchLine_15")
107 SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
108 SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_14.endPoint())
109 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_13.result())
110 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
111 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_5.result())
112 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_7.result())
113 SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_9.result())
114 SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_11.result())
115 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
116 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result())
117 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_8.result())
118 SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_10.result())
119 SketchConstraintHorizontal_6 = Sketch_1.setHorizontal(SketchLine_12.result())
120 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 13)
121 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_5.result(), 3)
122 SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_7.result(), 6)
123 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_9.result(), 6)
124 SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_11.result(), 3)
125 SketchLine_15 = Sketch_1.addLine(0, 19, 0, -112)
126 SketchLine_15.setName("SketchLine_16")
127 SketchLine_15.result().setName("SketchLine_16")
128 SketchLine_15.setAuxiliary(True)
129 SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
130 SketchLine_16 = SketchProjection_3.createdFeature()
131 SketchLine_16.setName("SketchLine_17")
132 SketchLine_16.result().setName("SketchLine_17")
133 SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_15.startPoint(), SketchLine_16.result())
134 SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_15.result())
135 SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchLine_6.endPoint(), SketchLine_9.endPoint(), "width")
136 SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_14.result())
137 SketchLine_17 = Sketch_1.addLine(-44, -15, -44, -54.03211253603285)
138 SketchLine_17.setName("SketchLine_18")
139 SketchLine_17.result().setName("SketchLine_18")
140 SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_17.result())
141 SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchLine_17.startPoint(), SketchLine_3.endPoint())
142 SketchLine_18 = Sketch_1.addLine(-39.73398465789798, -68, -16.15549442140351, -103)
143 SketchLine_18.setName("SketchLine_19")
144 SketchLine_18.result().setName("SketchLine_19")
145 SketchArc_4 = Sketch_1.addArc(0, -93, -16.15549442140351, -103, 16.15549442140351, -103, False)
146 SketchArc_4.setName("SketchArc_5")
147 SketchArc_4.result().setName("SketchArc_5")
148 SketchArc_4.results()[1].setName("SketchArc_5_2")
149 SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchLine_18.endPoint(), SketchArc_4.startPoint())
150 SketchLine_19 = Sketch_1.addLine(16.15549442140351, -103, 39.73398472457715, -68)
151 SketchLine_19.setName("SketchLine_20")
152 SketchLine_19.result().setName("SketchLine_20")
153 SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_19.startPoint())
154 SketchLine_20 = Sketch_1.addLine(44, -15, 44, -54.03211263501164)
155 SketchLine_20.setName("SketchLine_21")
156 SketchLine_20.result().setName("SketchLine_21")
157 SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_20.startPoint())
158 SketchConstraintVertical_9 = Sketch_1.setVertical(SketchLine_20.result())
159 SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_4.results()[1], 19)
160 SketchLine_21 = Sketch_1.addLine(-44, -46, 44.00000000000001, -46)
161 SketchLine_21.setName("SketchLine_22")
162 SketchLine_21.result().setName("SketchLine_22")
163 SketchLine_21.setAuxiliary(True)
164 SketchCircle_2 = Sketch_1.addCircle(-24.99999999999994, -46, 5)
165 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_4.result(), SketchCircle_2.center(), 31, True)
166 SketchConstraintRadius_4 = Sketch_1.setRadius(SketchCircle_2.results()[1], 5)
167 SketchPoint_3 = Sketch_1.addPoint(-44, -46)
168 SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchLine_21.startPoint(), SketchPoint_3.coordinates())
169 SketchPoint_4 = Sketch_1.addPoint(25, -46)
170 SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_21.result())
171 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_12.result(), SketchPoint_4.coordinates(), 31, True)
172 SketchMultiTranslation_1 = Sketch_1.addTranslation([SketchCircle_2.results()[1]], SketchCircle_2.center(), SketchPoint_4.coordinates(), 2)
173 [SketchCircle_3] = SketchMultiTranslation_1.translated()
174 SketchConstraintDistanceHorizontal_4 = Sketch_1.setHorizontalDistance(SketchCircle_2.center(), SketchAPI_Circle(SketchCircle_3).center(), "l")
175 SketchLine_22 = Sketch_1.addLine(-39.733984657898, -68, 39.73398472457715, -68)
176 SketchLine_22.setName("SketchLine_23")
177 SketchLine_22.result().setName("SketchLine_23")
178 SketchLine_22.setAuxiliary(True)
179 SketchConstraintHorizontal_8 = Sketch_1.setHorizontal(SketchLine_22.result())
180 SketchPoint_5 = Sketch_1.addPoint(0, -112)
181 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchPoint_5.coordinates(), SketchLine_8.result(), 88, True)
182 SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchPoint_5.coordinates(), SketchArc_4.results()[1])
183 SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchLine_15.startPoint(), SketchArc_1.results()[1])
184 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_2.center(), SketchLine_2.startPoint(), 3)
185 SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_14.endPoint())
186 SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchLine_14.result(), SketchArc_3.endPoint())
187 SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchArc_3.center(), SketchArc_3.endPoint(), 3)
188 SketchLine_23 = Sketch_1.addLine(-16.15549442140351, -103, 16.15549442140351, -103)
189 SketchLine_23.setName("SketchLine_29")
190 SketchLine_23.result().setName("SketchLine_29")
191 SketchLine_23.setAuxiliary(True)
192 SketchConstraintHorizontal_9 = Sketch_1.setHorizontal(SketchLine_23.result())
193 SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchLine_18.endPoint(), SketchLine_23.result())
194 SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchLine_23.result(), SketchLine_19.startPoint())
195 SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchLine_22.result(), SketchLine_18.startPoint())
196 SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchLine_22.result(), SketchLine_19.endPoint())
197 SketchConstraintDistance_4 = Sketch_1.setDistance(SketchLine_17.endPoint(), SketchLine_20.endPoint(), 88, True)
198 SketchConstraintDistanceVertical_3 = Sketch_1.setVerticalDistance(SketchLine_21.startPoint(), SketchLine_18.startPoint(), 22)
199 SketchConstraintDistanceVertical_4 = Sketch_1.setVerticalDistance(SketchLine_18.startPoint(), SketchLine_18.endPoint(), 35)
200 SketchConstraintDistanceVertical_5 = Sketch_1.setVerticalDistance(SketchLine_20.startPoint(), SketchArc_4.endPoint(), 88)
201 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_14.result())
202 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_12.result())
203 SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_6.result(), SketchLine_10.result())
204 SketchConstraintDistance_5 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_16).startPoint(), SketchLine_4.endPoint(), 23.5, True)
205 SketchConstraintDistance_6 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_16).startPoint(), SketchLine_11.endPoint(), 23.5, True)
206 SketchConstraintDistance_7 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_16).startPoint(), SketchLine_8.result(), 24, True)
207 SketchArc_5 = Sketch_1.addArc(-19, -54.03211253603285, -44, -54.03211253603285, -39.733984657898, -68, False)
208 SketchArc_5.setName("SketchArc_6")
209 SketchArc_5.result().setName("SketchArc_6")
210 SketchArc_5.results()[1].setName("SketchArc_6_2")
211 SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchArc_5.startPoint())
212 SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchLine_18.result(), SketchArc_5.endPoint())
213 SketchArc_6 = Sketch_1.addArc(19, -54.03211263501164, 44, -54.03211263501164, 39.73398472457715, -68, True)
214 SketchArc_6.setName("SketchArc_7")
215 SketchArc_6.result().setName("SketchArc_7")
216 SketchArc_6.results()[1].setName("SketchArc_7_2")
217 SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchArc_6.startPoint())
218 SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchLine_19.result(), SketchArc_6.endPoint())
219 SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_19.endPoint(), SketchArc_6.endPoint())
220 SketchConstraintRadius_5 = Sketch_1.setRadius(SketchArc_5.results()[1], 25)
221 SketchConstraintRadius_6 = Sketch_1.setRadius(SketchArc_6.results()[1], 25)
222 SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_17.result())
223 SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_22.startPoint(), SketchArc_5.endPoint())
224 SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_22.endPoint(), SketchLine_19.endPoint())
225 SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchLine_21.endPoint(), SketchLine_20.result())
226 SketchConstraintCoincidence_47 = Sketch_1.setCoincident(SketchArc_4.center(), SketchLine_15.result())
227 SketchConstraintCoincidence_48 = Sketch_1.setCoincident(SketchLine_23.endPoint(), SketchArc_4.endPoint())
228 SketchConstraintCoincidence_49 = Sketch_1.setCoincident(SketchLine_23.startPoint(), SketchLine_18.endPoint())
229 SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchPoint_5.coordinates())
230 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchLine_17.result(), SketchArc_5.results()[1])
231 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_20.result(), SketchArc_6.results()[1])
232 SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_5.results()[1], SketchLine_18.result())
233 SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_6.results()[1], SketchLine_19.result())
234 SketchConstraintTangent_5 = Sketch_1.setTangent(SketchLine_2.result(), SketchArc_2.results()[1])
235 SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.startPoint())
236 SketchConstraintCoincidence_52 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_13.result())
237 SketchConstraintCoincidence_53 = Sketch_1.setCoincident(SketchLine_15.startPoint(), SketchArc_1.results()[1])
238 SketchConstraintDistance_8 = Sketch_1.setDistance(SketchPoint_4.coordinates(), SketchLine_15.result(), "l/2", True)
240 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchArc_2_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchArc_3_2r-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchLine_18f-SketchArc_6_2f-SketchLine_19f-SketchArc_5_2f-SketchLine_20f-SketchArc_7_2f-SketchLine_21r-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 10, 0)
241 Wire_1_objects = [model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_15][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_14][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_13][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_12][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_11][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_10][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_9][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]")]
242 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects, False)
243 Recover_1 = model.addRecover(Part_1_doc, Wire_1, [Extrusion_1.result().subResult(0), Extrusion_1.result().subResult(1)])
244 Recover_1.result().setName("BaseHorizontale")
245 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Recover_1_2/Modified_Face&Extrusion_1_1_1/To_Face")], model.selection(), 40, 10)
246 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "_weak_name_8_Extrusion_2_1")])
247 Recover_2 = model.addRecover(Part_1_doc, Shell_1, [Extrusion_2.result()])
248 Recover_2.result().setName("BaseVerticale")
249 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection(), 0, 67)
250 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
251 SketchLine_24 = Sketch_2.addLine(-24, 50, -91, 10)
252 SketchLine_24.setName("SketchLine_24")
253 SketchLine_24.result().setName("SketchLine_24")
254 SketchLine_25 = Sketch_2.addLine(-91, 10, -95.16657804170339, 15.01933103534318)
255 SketchLine_25.setName("SketchLine_25")
256 SketchLine_25.result().setName("SketchLine_25")
257 SketchConstraintCoincidence_54 = Sketch_2.setCoincident(SketchLine_24.endPoint(), SketchLine_25.startPoint())
258 SketchLine_26 = Sketch_2.addLine(-95.16657804170339, 15.01933103534318, -95.16657804170339, 56.48490151730473)
259 SketchLine_26.setName("SketchLine_26")
260 SketchLine_26.result().setName("SketchLine_26")
261 SketchConstraintCoincidence_55 = Sketch_2.setCoincident(SketchLine_25.endPoint(), SketchLine_26.startPoint())
262 SketchLine_27 = Sketch_2.addLine(-95.16657804170339, 56.48490151730473, -23.26184103325994, 56.92117661842984)
263 SketchLine_27.setName("SketchLine_27")
264 SketchLine_27.result().setName("SketchLine_27")
265 SketchConstraintCoincidence_56 = Sketch_2.setCoincident(SketchLine_26.endPoint(), SketchLine_27.startPoint())
266 SketchLine_28 = Sketch_2.addLine(-23.26184103325994, 56.92117661842984, -24, 50)
267 SketchLine_28.setName("SketchLine_28")
268 SketchLine_28.result().setName("SketchLine_28")
269 SketchConstraintCoincidence_57 = Sketch_2.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
270 SketchConstraintCoincidence_58 = Sketch_2.setCoincident(SketchLine_24.startPoint(), SketchLine_28.endPoint())
271 SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[BaseHorizontale/Modified_Face&Sketch_1/SketchLine_19][BaseHorizontale/Modified_Face&Extrusion_1_1_2/To_Face]"), False)
272 SketchLine_29 = SketchProjection_4.createdFeature()
273 SketchLine_29.setName("SketchLine_30")
274 SketchLine_29.result().setName("SketchLine_30")
275 SketchConstraintCoincidence_59 = Sketch_2.setCoincident(SketchLine_25.startPoint(), SketchLine_29.result())
276 SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "[_weak_name_1_Extrusion_3_1_1][Extrusion_3_1_1/From_Face]"), False)
277 SketchLine_30 = SketchProjection_5.createdFeature()
278 SketchLine_30.setName("SketchLine_31")
279 SketchLine_30.result().setName("SketchLine_31")
280 SketchConstraintCoincidence_60 = Sketch_2.setCoincident(SketchLine_25.startPoint(), SketchLine_30.result())
281 SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "[_weak_name_1_Extrusion_3_1_1][_weak_name_4_Extrusion_3_1_1]"), False)
282 SketchLine_31 = SketchProjection_6.createdFeature()
283 SketchLine_31.setName("SketchLine_32")
284 SketchLine_31.result().setName("SketchLine_32")
285 SketchConstraintCoincidence_61 = Sketch_2.setCoincident(SketchLine_24.startPoint(), SketchAPI_Line(SketchLine_31).endPoint())
287 Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_28r-SketchLine_27r-SketchLine_26r-SketchLine_25r-SketchLine_24r_wire")], model.selection(), 50, 50)
288 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1_1")], [model.selection("SOLID", "Extrusion_4_1")])
289 Cut_1.result().setName("AreteDiagonale")
290 Fuse_1_objects_1 = [model.selection("SOLID", "BaseHorizontale"), model.selection("SOLID", "BaseVerticale"), model.selection("SOLID", "AreteDiagonale")]
291 Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1, removeEdges = True, keepSubResults = True)
292 RemoveResults_1 = model.addRemoveResults(Part_1_doc, [model.selection("WIRE", "Wire_1_1")])
293 Group_1 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "BaseHorizontale/Modified_Face&Extrusion_1_1_2/To_Face")])
294 Group_2 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "BaseHorizontale/Modified_Face&Sketch_2/SketchLine_24")])
295 Group_3 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "BaseHorizontale/Modified_Face&Extrusion_2_1/To_Face")])
299 from GeomAPI import *
301 model.testNbResults(Fuse_1, 1)
302 model.testNbSubResults(Fuse_1, [0])
303 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
304 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [27])
305 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [150])
306 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [300])
307 model.testResultsVolumes(Fuse_1, [163259.1989])
313 model.testNbResults(Fuse_1, 1)
314 model.testNbSubResults(Fuse_1, [0])
315 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
316 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [27])
317 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [150])
318 model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [300])
319 model.testResultsVolumes(Fuse_1, [155359.198457])
321 assert(model.checkPythonDump())