Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / Test / Test17000.py
1 # Copyright (C) 2019-2023  CEA, EDF
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 salome.shaper import model
22
23 model.begin()
24 partSet = model.moduleDocument()
25 Part_1 = model.addPart(partSet)
26 Part_1_doc = Part_1.document()
27 model.addParameter(Part_1_doc, "ep_base", "0.65")
28 model.addParameter(Part_1_doc, "ep_voiles", "0.1")
29 model.addParameter(Part_1_doc, "ep_poteau", "0.15")
30 model.addParameter(Part_1_doc, "h_ouverture", "0.95")
31 model.addParameter(Part_1_doc, "h_apres_ouverture", "0.6")
32 model.addParameter(Part_1_doc, "ep_dalles", "0.12")
33 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
34 SketchLine_1 = Sketch_1.addLine(-0.375, 3.325, 0.275, 3.325)
35 SketchLine_2 = Sketch_1.addLine(0.275, 3.325, 0.275, 0.325)
36 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
37 SketchLine_3 = Sketch_1.addLine(0.275, 0.325, 3.625, 0.325)
38 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
39 SketchLine_4 = Sketch_1.addLine(3.625, 0.325, 3.625, 1.325)
40 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
41 SketchLine_5 = Sketch_1.addLine(3.625, 1.325, 4.275, 1.325)
42 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
43 SketchLine_6 = Sketch_1.addLine(4.275, 1.325, 4.275, -0.325)
44 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
45 SketchLine_7 = Sketch_1.addLine(4.275, -0.325, -0.375, -0.325)
46 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
47 SketchLine_8 = Sketch_1.addLine(-0.375, -0.325, -0.375, 3.325)
48 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
49 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
50 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_8.result())
51 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_2.result())
52 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_4.result())
53 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_6.result())
54 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
55 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
56 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_7.result())
57 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_8.result(), 3.65)
58 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), "ep_base")
59 SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_6.result(), 1.65)
60 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_5.result())
61 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_7.result(), 4.65)
62 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_5.result())
63 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_7.result(), "ep_base", True)
64 SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
65 SketchLine_9 = SketchProjection_1.createdFeature()
66 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_9.result(), "0.275+ep_voiles/2", True)
67 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
68 SketchLine_10 = SketchProjection_2.createdFeature()
69 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_8.endPoint(), SketchLine_10.result(), "0.325+ep_voiles/2", True)
70 model.do()
71 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 0, 0.3)
72 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
73 SketchLine_11 = Sketch_2.addLine(2.26, -2.31, 1.64, -2.31)
74 SketchLine_12 = Sketch_2.addLine(1.64, -2.31, 1.64, -1.69)
75 SketchLine_13 = Sketch_2.addLine(1.64, -1.69, 2.26, -1.69)
76 SketchLine_14 = Sketch_2.addLine(2.26, -1.69, 2.26, -2.31)
77 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
78 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
79 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
80 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
81 SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
82 SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_12.result())
83 SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result())
84 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result())
85 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_11.result(), SketchLine_12.result())
86 SketchPoint_1 = Sketch_2.addPoint(1.925, -1.875)
87 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.210+ep_poteau/2", True)
88 SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2", True)
89 SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_11.result(), 0.62)
90 SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
91 SketchLine_15 = SketchProjection_3.createdFeature()
92 SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
93 SketchLine_16 = SketchProjection_4.createdFeature()
94 SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2", True)
95 SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2", True)
96 model.do()
97 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)
98 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
99 SketchLine_17 = Sketch_3.addLine(0, 2.95, 0, 1.7)
100 SketchProjection_5 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OY"), False)
101 SketchLine_18 = SketchProjection_5.createdFeature()
102 SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_17.startPoint(), SketchLine_18.result())
103 SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.result())
104 SketchLine_19 = Sketch_3.addLine(0, 1.2, 0, 0)
105 SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_19.startPoint(), SketchLine_18.result())
106 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_18).startPoint(), SketchLine_19.endPoint())
107 SketchLine_20 = Sketch_3.addLine(0, 0, 0.95, 0)
108 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_18).startPoint(), SketchLine_20.startPoint())
109 SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
110 SketchLine_21 = SketchProjection_6.createdFeature()
111 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_21.result())
112 SketchLine_22 = Sketch_3.addLine(2.525, 0, 3.975, 0)
113 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
114 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
115 SketchLine_23 = Sketch_3.addLine(3.975, 0, 3.975, 0.95)
116 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
117 SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_23.result())
118 SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_23.result(), "1-ep_voiles/2")
119 SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_22.result(), "1.5-ep_voiles/2")
120 SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_20.result(), "1-ep_voiles/2")
121 SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_19.result(), "1.25-ep_voiles/2")
122 SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_17.result(), 1.25)
123 SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"), False)
124 SketchLine_24 = SketchProjection_7.createdFeature()
125 SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_24.result(), 0.375, True)
126 SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_6"), False)
127 SketchLine_25 = SketchProjection_8.createdFeature()
128 SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2", True)
129 model.do()
130 Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_17"), model.selection("EDGE", "Sketch_3/SketchLine_19"), model.selection("EDGE", "Sketch_3/SketchLine_20"), model.selection("EDGE", "Sketch_3/SketchLine_22"), model.selection("EDGE", "Sketch_3/SketchLine_23")]
131 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
132 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Edge_1")], model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
133 Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1_1/Generated_Edge&Sketch_3/SketchLine_17_StartVertex]e[Extrusion_3_1_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_1_3/Generated_Edge&Sketch_3/SketchLine_20_StartVertex]e[Extrusion_3_1_3/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_1_4/Generated_Edge&Sketch_3/SketchLine_22_EndVertex]e[Extrusion_3_1_4/To_Edge]e"))
134 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
135 SketchLine_26 = Sketch_4.addLine(0, 2.95, 0, 0)
136 SketchProjection_9 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_3_1_1/Generated_Edge&Sketch_3/SketchLine_17_StartVertex]e[Extrusion_3_1_1/To_Edge]e"), False)
137 SketchPoint_2 = SketchProjection_9.createdFeature()
138 SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_26.startPoint(), SketchPoint_2.result())
139 SketchProjection_10 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_3_1_3/Generated_Edge&Sketch_3/SketchLine_20_StartVertex]e[Extrusion_3_1_3/To_Edge]e"), False)
140 SketchPoint_3 = SketchProjection_10.createdFeature()
141 SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_26.endPoint(), SketchPoint_3.result())
142 SketchLine_27 = Sketch_4.addLine(0, 0, 3.975, 0)
143 SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_26.endPoint(), SketchLine_27.startPoint())
144 SketchProjection_11 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_3_1_4/Generated_Edge&Sketch_3/SketchLine_22_EndVertex]e[Extrusion_3_1_4/To_Edge]e"), False)
145 SketchPoint_4 = SketchProjection_11.createdFeature()
146 SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_4.result())
147 SketchLine_28 = Sketch_4.addLine(3.975, 0, 3.975, 0.95)
148 SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
149 SketchProjection_12 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_3_1_5/Generated_Edge&Sketch_3/SketchLine_23_EndVertex]e[Extrusion_3_1_5/To_Edge]e"), False)
150 SketchPoint_5 = SketchProjection_12.createdFeature()
151 SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_5.result())
152 model.do()
153 Edge_2_objects = [model.selection("EDGE", "Sketch_4/SketchLine_26"), model.selection("EDGE", "Sketch_4/SketchLine_27"), model.selection("EDGE", "Sketch_4/SketchLine_28")]
154 Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
155 Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Edge_2")], model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
156 Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_4_1_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_1_2/To_Edge]e"))
157 Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
158 SketchLine_29 = Sketch_5.addLine(0, 2.95, 0, 0)
159 SketchProjection_13 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_4_1_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1_1/To_Edge]e"), False)
160 SketchPoint_6 = SketchProjection_13.createdFeature()
161 SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchLine_29.startPoint(), SketchPoint_6.result())
162 SketchProjection_14 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_4_1_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1_1/To_Edge]e"), False)
163 SketchPoint_7 = SketchProjection_14.createdFeature()
164 SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_29.endPoint(), SketchPoint_7.result())
165 SketchLine_30 = Sketch_5.addLine(0, 0, 3.975, 0)
166 SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_29.endPoint(), SketchLine_30.startPoint())
167 SketchProjection_15 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_4_1_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_1_2/To_Edge]e"), False)
168 SketchPoint_8 = SketchProjection_15.createdFeature()
169 SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_8.result())
170 SketchLine_31 = Sketch_5.addLine(3.975, 0, 3.975, 0.95)
171 SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
172 SketchProjection_16 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_4_1_3/Generated_Edge&Sketch_4/SketchLine_28_EndVertex]e[Extrusion_4_1_3/To_Edge]e"), False)
173 SketchPoint_9 = SketchProjection_16.createdFeature()
174 SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_9.result())
175 SketchLine_32 = Sketch_5.addLine(3.975, 0.95, 0, 2.95)
176 SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
177 SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_29.startPoint(), SketchLine_32.endPoint())
178 SketchLine_33 = Sketch_5.addLine(1.85, 2.019182389937107, 1.85, 0)
179 SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchLine_33.startPoint(), SketchLine_32.result())
180 SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_33.endPoint(), SketchLine_30.result())
181 SketchLine_34 = Sketch_5.addLine(2.075, 1.905974842767296, 2.075, 0)
182 SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_32.result())
183 SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_30.result())
184 SketchConstraintVertical_8 = Sketch_5.setVertical(SketchLine_33.result())
185 SketchConstraintVertical_9 = Sketch_5.setVertical(SketchLine_34.result())
186 SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_33.startPoint(), SketchLine_29.result(), 1.85, True)
187 SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_31.result(), 1.9, True)
188 model.do()
189 Face_1_objects = [model.selection("FACE", "Sketch_5/Face-SketchLine_29r-SketchLine_30f-SketchLine_33r-SketchLine_32f"), model.selection("FACE", "Sketch_5/Face-SketchLine_30f-SketchLine_34r-SketchLine_32f-SketchLine_33f"), model.selection("FACE", "Sketch_5/Face-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f")]
190 Face_1 = model.addFace(Part_1_doc, Face_1_objects)
191 LinearCopy_1_objects = [model.selection("COMPOUND", "Extrusion_3_1"), model.selection("COMPOUND", "Extrusion_4_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2"), model.selection("FACE", "Face_1_3")]
192 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, LinearCopy_1_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2", 3)
193 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_1")])
194 Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection("FACE", "LinearCopy_1_3_3"), 0, model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r"), 0)
195 Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("EDGE", "Extrusion_5_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_1_2"), model.selection("COMPOUND", "LinearCopy_1_3"), model.selection("COMPOUND", "LinearCopy_1_4"), model.selection("COMPOUND", "LinearCopy_1_5")]
196 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
197 Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2")])
198 Group_1.setName("base")
199 Group_1.result().setName("base")
200 Group_1.result().setColor(170, 0, 0)
201 Group_2_objects = [model.selection("EDGE", "Partition_1_1_2/Modified_Edge&Sketch_2/SketchPoint_1"), model.selection("EDGE", "Partition_1_1_3"), model.selection("EDGE", "Partition_1_1_4"), model.selection("EDGE", "Partition_1_1_5")]
202 Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
203 Group_2.setName("poteau")
204 Group_2.result().setName("poteau")
205 Group_2.result().setColor(0, 170, 0)
206 Group_3_objects = [model.selection("FACE", "Partition_1_1_38"), model.selection("FACE", "Partition_1_1_32"), model.selection("FACE", "Partition_1_1_37"), model.selection("FACE", "Partition_1_1_31"), model.selection("FACE", "Partition_1_1_36"), model.selection("FACE", "Partition_1_1_30")]
207 Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
208 Group_3.setName("dalles")
209 Group_3.result().setName("dalles")
210 Group_3.result().setColor(97, 97, 116)
211 Group_4_objects = [model.selection("FACE", "Partition_1_1_29"), model.selection("FACE", "Partition_1_1_20"), model.selection("FACE", "Partition_1_1_26"), model.selection("FACE", "Partition_1_1_15"), model.selection("FACE", "Partition_1_1_23"), model.selection("FACE", "Partition_1_1_10"), model.selection("FACE", "Partition_1_1_7"), model.selection("FACE", "Partition_1_1_21"), model.selection("FACE", "Partition_1_1_6"), model.selection("FACE", "Partition_1_1_12"), model.selection("FACE", "Partition_1_1_24"), model.selection("FACE", "Partition_1_1_11"), model.selection("FACE", "Partition_1_1_17"), model.selection("FACE", "Partition_1_1_27"), model.selection("FACE", "Partition_1_1_16"), model.selection("FACE", "Partition_1_1_28"), model.selection("FACE", "Partition_1_1_18"), model.selection("FACE", "Partition_1_1_19"), model.selection("FACE", "Partition_1_1_25"), model.selection("FACE", "Partition_1_1_13"), model.selection("FACE", "Partition_1_1_14"), model.selection("FACE", "Partition_1_1_22"), model.selection("FACE", "Partition_1_1_8"), model.selection("FACE", "Partition_1_1_9")]
212 Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
213 Group_4.setName("voiles")
214 Group_4.result().setName("voiles")
215 Group_5_objects = [model.selection("FACE", "Partition_1_1_35"), model.selection("FACE", "Partition_1_1_34"), model.selection("FACE", "Partition_1_1_33")]
216 Group_5 = model.addGroup(Part_1_doc, Group_5_objects)
217 Group_5.setName("poutre_centrale")
218 Group_5.result().setName("poutre_centrale")
219 Group_5.result().setColor(0, 85, 255)
220 Group_6_objects = [model.selection("EDGE", "Partition_1_1_38/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_35/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_32/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_37/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_34/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_31/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_36/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_33/Modified_Edge&Sketch_5/SketchLine_32"), model.selection("EDGE", "Partition_1_1_30/Modified_Edge&Sketch_5/SketchLine_32")]
221 Group_6 = model.addGroup(Part_1_doc, Group_6_objects)
222 Group_6.setName("poutres_transversales")
223 Group_6.result().setName("poutres_transversales")
224 model.do()
225 model.end()
226
227 from GeomAPI import GeomAPI_Shape
228
229 model.testNbResults(Partition_1, 1)
230 model.testNbSubResults(Partition_1, [38])
231 model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [2])
232 model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [49])
233 model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [247])
234 model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [499])
235
236 import math
237 from GeomAlgoAPI import *
238 aResultArea = GeomAlgoAPI_ShapeTools.area(Partition_1.results()[0].resultSubShapePair()[0].shape())
239 anExpectedArea = 70.18465
240 assert(math.fabs(aResultArea-anExpectedArea)/anExpectedArea<1e-7)
241
242 assert(Partition_1.feature().error() == '')
243 for gr in [Group_1, Group_2, Group_3, Group_4, Group_5, Group_6]:
244   assert(gr.feature().error() == ''), "The group {0} is in error: {1}".format(gr.name(), gr.feature().error())
245
246 assert(model.checkPythonDump())