Salome HOME
Copyright update 2022
[modules/shaper.git] / src / FeaturesPlugin / Test / TestPartitionArgsUpdate.py
1 # Copyright (C) 2014-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 # Test that append a new element to the end of Partition attributes does not
21 # change the previous partition results selection..
22 # Based on the CEA report mail 04.12.2018, page 7
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 model.addParameter(Part_1_doc, "ep_base", "0.65")
31 model.addParameter(Part_1_doc, "ep_voiles", "0.1")
32 model.addParameter(Part_1_doc, "ep_poteau", "0.15")
33 model.addParameter(Part_1_doc, "h_ouverture", "0.95")
34 model.addParameter(Part_1_doc, "h_apres_ouverture", "0.6")
35 model.addParameter(Part_1_doc, "ep_dalles", "0.12")
36 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
37 SketchLine_1 = Sketch_1.addLine(0.275, 3.325, -0.375, 3.325)
38 SketchLine_2 = Sketch_1.addLine(-0.375, 3.325, -0.375, -0.325)
39 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
40 SketchLine_3 = Sketch_1.addLine(-0.375, -0.325, 4.275, -0.325)
41 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
42 SketchLine_4 = Sketch_1.addLine(4.275, -0.325, 4.275, 1.325)
43 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
44 SketchLine_5 = Sketch_1.addLine(4.275, 1.325, 3.625, 1.325)
45 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
46 SketchLine_6 = Sketch_1.addLine(3.625, 1.325, 3.625, 0.325)
47 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
48 SketchLine_7 = Sketch_1.addLine(3.625, 0.325, 0.275, 0.3250000000000001)
49 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
50 SketchLine_8 = Sketch_1.addLine(0.275, 0.3250000000000001, 0.275, 3.325)
51 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
52 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
53 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
54 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_5.result())
55 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_3.result())
56 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
57 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
58 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_8.result())
59 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
60 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_4.result())
61 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "ep_base")
62 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 3.65)
63 SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 4.65)
64 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_4.result(), 1.65)
65 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_3.result(), "ep_base", False)
66 SketchLine_9 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OX"))
67 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_9.result(), "0.275+ep_voiles/2", False)
68 SketchLine_10 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OY"))
69 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_10.result(), "0.325+ep_voiles/2", False)
70 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_1.result())
71 model.do()
72 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 0, 0.3)
73 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
74 SketchLine_11 = Sketch_2.addLine(2.26, -2.31, 1.64, -2.31)
75 SketchLine_12 = Sketch_2.addLine(1.64, -2.31, 1.64, -1.69)
76 SketchLine_13 = Sketch_2.addLine(1.64, -1.69, 2.26, -1.69)
77 SketchLine_14 = Sketch_2.addLine(2.26, -1.69, 2.26, -2.31)
78 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
79 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
80 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
81 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
82 SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
83 SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_12.result())
84 SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result())
85 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result())
86 SketchPoint_1 = Sketch_2.addPoint(1.925, -1.875)
87 SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_11.result(), 0.62)
88 SketchConstraintLength_5.setName("SketchConstraintLength_10")
89 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_11.result(), SketchLine_12.result())
90 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2", False)
91 SketchConstraintDistance_4.setName("SketchConstraintDistance_6")
92 SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.21+ep_poteau/2", False)
93 SketchConstraintDistance_5.setName("SketchConstraintDistance_7")
94 SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
95 SketchLine_15 = SketchProjection_1.createdFeature()
96 SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
97 SketchLine_16 = SketchProjection_2.createdFeature()
98 SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2", False)
99 SketchConstraintDistance_6.setName("SketchConstraintDistance_8")
100 SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2", False)
101 SketchConstraintDistance_7.setName("SketchConstraintDistance_9")
102 model.do()
103 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r")], model.selection(), 0, 0.02)
104 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f"))
105 SketchLine_17 = Sketch_3.addLine(0, 2.950000000000001, 0, 1.700000000000001)
106 SketchLine_17.setName("SketchLine_15")
107 SketchLine_17.result().setName("SketchLine_15")
108 SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OY"))
109 SketchLine_18.setName("SketchLine_16")
110 SketchLine_18.result().setName("SketchLine_16")
111 SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_17.startPoint(), SketchLine_18.result())
112 SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.result())
113 SketchLine_19 = Sketch_3.addLine(0, 1.2, 0, 0)
114 SketchLine_19.setName("SketchLine_17")
115 SketchLine_19.result().setName("SketchLine_17")
116 SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_19.startPoint(), SketchLine_18.result())
117 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.result())
118 SketchLine_20 = Sketch_3.addLine(0, 0, 0.95, 0)
119 SketchLine_20.setName("SketchLine_18")
120 SketchLine_20.result().setName("SketchLine_18")
121 SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OX"))
122 SketchLine_21.setName("SketchLine_19")
123 SketchLine_21.result().setName("SketchLine_19")
124 SketchLine_22 = Sketch_3.addLine(2.525000000000001, 0, 3.975000000000001, 0)
125 SketchLine_22.setName("SketchLine_20")
126 SketchLine_22.result().setName("SketchLine_20")
127 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
128 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
129 SketchLine_23 = Sketch_3.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
130 SketchLine_23.setName("SketchLine_21")
131 SketchLine_23.result().setName("SketchLine_21")
132 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
133 SketchLine_24 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"))
134 SketchLine_24.setName("SketchLine_22")
135 SketchLine_24.result().setName("SketchLine_22")
136 SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_17.result(), 1.25)
137 SketchConstraintLength_6.setName("SketchConstraintLength_5")
138 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.startPoint())
139 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_19.endPoint())
140 SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_19.result(), "1.25-ep_voiles/2")
141 SketchConstraintLength_7.setName("SketchConstraintLength_6")
142 SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_20.result(), "1-ep_voiles/2")
143 SketchConstraintLength_8.setName("SketchConstraintLength_7")
144 SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_22.result(), "1.5-ep_voiles/2")
145 SketchConstraintLength_9.setName("SketchConstraintLength_8")
146 SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_23.result())
147 SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
148 SketchLine_25.setName("SketchLine_23")
149 SketchLine_25.result().setName("SketchLine_23")
150 SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2", False)
151 SketchConstraintDistance_8.setName("SketchConstraintDistance_5")
152 SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_23.result(), "1-ep_voiles/2")
153 SketchConstraintLength_10.setName("SketchConstraintLength_9")
154 SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
155 SketchLine_26.setName("SketchLine_35")
156 SketchLine_26.result().setName("SketchLine_35")
157 SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 0.375, False)
158 SketchConstraintDistance_9.setName("SketchConstraintDistance_12")
159 model.do()
160 Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_15"), model.selection("EDGE", "Sketch_3/SketchLine_17"), model.selection("EDGE", "Sketch_3/SketchLine_18"), model.selection("EDGE", "Sketch_3/SketchLine_20"), model.selection("EDGE", "Sketch_3/SketchLine_21")]
161 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
162 Extrusion_3_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5")]
163 Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
164 Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
165 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
166 SketchLine_27 = Sketch_4.addLine(0, 2.950000000000001, 0, 0)
167 SketchLine_27.setName("SketchLine_26")
168 SketchLine_27.result().setName("SketchLine_26")
169 SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"))
170 SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_27.startPoint(), SketchPoint_2.result())
171 SketchPoint_3 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"))
172 SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_3.result())
173 SketchLine_28 = Sketch_4.addLine(0, 0, 3.975000000000001, 0)
174 SketchLine_28.setName("SketchLine_27")
175 SketchLine_28.result().setName("SketchLine_27")
176 SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
177 SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
178 SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_4.result())
179 SketchLine_29 = Sketch_4.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
180 SketchLine_29.setName("SketchLine_28")
181 SketchLine_29.result().setName("SketchLine_28")
182 SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
183 SketchPoint_5 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_5/Generated_Edge&Sketch_3/SketchLine_21_EndVertex]e[Extrusion_3_5/To_Edge]e"))
184 SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchPoint_5.result())
185 model.do()
186 Edge_2_objects = [model.selection("EDGE", "Sketch_4/SketchLine_26"), model.selection("EDGE", "Sketch_4/SketchLine_27"), model.selection("EDGE", "Sketch_4/SketchLine_28")]
187 Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
188 Extrusion_4_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3")]
189 Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
190 Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
191 Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
192 SketchLine_30 = Sketch_5.addLine(0, 2.950000000000001, 0, 0)
193 SketchLine_30.setName("SketchLine_29")
194 SketchLine_30.result().setName("SketchLine_29")
195 SketchPoint_6 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"))
196 SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchPoint_6.result())
197 SketchPoint_7 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"))
198 SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_7.result())
199 SketchLine_31 = Sketch_5.addLine(0, 0, 3.975000000000001, 0)
200 SketchLine_31.setName("SketchLine_30")
201 SketchLine_31.result().setName("SketchLine_30")
202 SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
203 SketchPoint_8 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
204 SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_8.result())
205 SketchLine_32 = Sketch_5.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
206 SketchLine_32.setName("SketchLine_31")
207 SketchLine_32.result().setName("SketchLine_31")
208 SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
209 SketchPoint_9 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_3/Generated_Edge&Sketch_4/SketchLine_28_EndVertex]e[Extrusion_4_3/To_Edge]e"))
210 SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchPoint_9.result())
211 SketchLine_33 = Sketch_5.addLine(3.975000000000001, 0.95, 0, 2.950000000000001)
212 SketchLine_33.setName("SketchLine_32")
213 SketchLine_33.result().setName("SketchLine_32")
214 SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
215 SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchLine_33.endPoint())
216 SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchPoint_6.coordinates(), SketchLine_33.endPoint())
217 SketchLine_34 = Sketch_5.addLine(1.85, 2.019182389937107, 1.85, 0)
218 SketchLine_34.setName("SketchLine_33")
219 SketchLine_34.result().setName("SketchLine_33")
220 SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_33.result())
221 SketchLine_35 = Sketch_5.addLine(2.075000000000001, 1.905974842767296, 2.075000000000001, 0)
222 SketchLine_35.setName("SketchLine_34")
223 SketchLine_35.result().setName("SketchLine_34")
224 SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchLine_35.startPoint(), SketchLine_33.result())
225 SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_35.endPoint(), SketchLine_31.result())
226 SketchConstraintCoincidence_40 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_31.result())
227 SketchConstraintVertical_8 = Sketch_5.setVertical(SketchLine_34.result())
228 SketchConstraintVertical_9 = Sketch_5.setVertical(SketchLine_35.result())
229 SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_30.result(), "1.8+ep_voiles/2", False)
230 SketchConstraintDistance_10.setName("SketchConstraintDistance_10")
231 SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_35.startPoint(), SketchLine_32.result(), "1.85+ep_voiles/2", False)
232 SketchConstraintDistance_11.setName("SketchConstraintDistance_11")
233 model.do()
234 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_29r-SketchLine_30f-SketchLine_33r-SketchLine_32f_wire")])
235 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f_wire")])
236 Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_34r-SketchLine_32f-SketchLine_33f_wire")])
237 Translation_1_objects = [model.selection("FACE", "Extrusion_4_3"), model.selection("FACE", "Extrusion_3_3"), model.selection("FACE", "Extrusion_4_2"), model.selection("FACE", "Extrusion_3_5"), model.selection("FACE", "Extrusion_3_4"), model.selection("FACE", "Extrusion_3_2"), model.selection("FACE", "Extrusion_4_1"), model.selection("FACE", "Extrusion_3_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_2_1")]
238 Translation_1 = model.addTranslation(Part_1_doc, Translation_1_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2")
239 Recover_1_objects = [Face_2.result(), Face_3.result(), Face_1.result(), Extrusion_3.result(), Extrusion_4.result(), Extrusion_3.results()[1], Extrusion_3.results()[3], Extrusion_3.results()[4], Extrusion_4.results()[1], Extrusion_3.results()[2], Extrusion_4.results()[2]]
240 Recover_1 = model.addRecover(Part_1_doc, Translation_1, Recover_1_objects)
241 Translation_2_objects = [model.selection("FACE", "Recover_1_2"), model.selection("FACE", "Recover_1_5"), model.selection("FACE", "Recover_1_3"), model.selection("FACE", "Recover_1_4"), model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_1_6"), model.selection("FACE", "Recover_1_8"), model.selection("FACE", "Recover_1_7"), model.selection("FACE", "Recover_1_11"), model.selection("FACE", "Recover_1_10"), model.selection("FACE", "Recover_1_9")]
242 Translation_2 = model.addTranslation(Part_1_doc, Translation_2_objects, model.selection("EDGE", "PartSet/OZ"), "2*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
243 Recover_2_objects = [Recover_1.results()[8], Recover_1.results()[9], Recover_1.results()[10], Recover_1.results()[6], Recover_1.results()[7], Recover_1.results()[5], Recover_1.result(), Recover_1.results()[3], Recover_1.results()[2], Recover_1.results()[4], Recover_1.results()[1]]
244 Recover_2 = model.addRecover(Part_1_doc, Translation_2, Recover_2_objects)
245 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_1")])
246 Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection("FACE", "Translation_2_11"), 0, model.selection(), 0)
247 Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Translation_1_3"), model.selection("FACE", "Translation_1_4"), model.selection("FACE", "Translation_1_5"), model.selection("FACE", "Translation_1_6"), model.selection("FACE", "Translation_1_7"), model.selection("FACE", "Translation_1_8"), model.selection("FACE", "Translation_1_9"), model.selection("FACE", "Translation_1_10"), model.selection("FACE", "Translation_1_11"), model.selection("FACE", "Translation_2_1"), model.selection("FACE", "Translation_2_2"), model.selection("FACE", "Translation_2_3"), model.selection("FACE", "Translation_2_4"), model.selection("FACE", "Translation_2_5"), model.selection("FACE", "Translation_2_6"), model.selection("FACE", "Translation_2_7"), model.selection("FACE", "Translation_2_8"), model.selection("FACE", "Translation_2_9"), model.selection("FACE", "Translation_2_10"), model.selection("FACE", "Translation_2_11"), model.selection("FACE", "Recover_2_1"), model.selection("FACE", "Recover_2_2"), model.selection("FACE", "Recover_2_3"), model.selection("FACE", "Recover_2_4"), model.selection("FACE", "Recover_2_5"), model.selection("FACE", "Recover_2_6"), model.selection("FACE", "Recover_2_7"), model.selection("FACE", "Recover_2_8"), model.selection("FACE", "Recover_2_9"), model.selection("FACE", "Recover_2_10"), model.selection("FACE", "Recover_2_11"), model.selection("EDGE", "Extrusion_5_1")]
248 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
249 model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc)
250 model.do()
251 # insert points and polyline before partition to add it as a Partition argument
252 Part_1_doc.setCurrentFeature(Extrusion_5.feature(), True)
253 Point_2 = model.addPoint(Part_1_doc, "0", "0", "3*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
254 Point_3 = model.addPoint(Part_1_doc, 0, 0, 5)
255 Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
256 model.do()
257 Part_1_doc.setCurrentFeature(Partition_1.feature(), True)
258 # append the polyline argument to the end of selection partition list
259 Partition_1_objects.append(model.selection("WIRE", "Polyline_1_1"))
260 Partition_1.setBase(Partition_1_objects)
261 model.end()
262
263 # check all groups are valid
264 from ModelAPI import *
265 aFactory = ModelAPI_Session.get().validators()
266 assert(Part_1_doc.size("Groups") == 3)
267 for i in range(Part_1_doc.size("Groups")):
268   GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
269   assert(aFactory.validate(GroupFeature))