Salome HOME
Revert test name.
[modules/shaper.git] / src / FeaturesPlugin / Test / Test2394.py
1 # -*- coding: utf-8 -*-
2
3 ## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
4 ##
5 ## This library is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU Lesser General Public
7 ## License as published by the Free Software Foundation; either
8 ## version 2.1 of the License, or (at your option) any later version.
9 ##
10 ## This library is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 ## Lesser General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU Lesser General Public
16 ## License along with this library; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ##
19 ## See http:##www.salome-platform.org/ or
20 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 ##
22
23 from GeomAPI import *
24 from SketchAPI import *
25
26 from salome.shaper import model
27
28 model.begin()
29 partSet = model.moduleDocument()
30 Part_1 = model.addPart(partSet)
31 Part_1_doc = Part_1.document()
32
33 model.addParameter(Part_1_doc, "R", "58")
34 model.addParameter(Part_1_doc, "cote_cube", "R/2")
35 model.addParameter(Part_1_doc, "theta", "54")
36 model.addParameter(Part_1_doc, "phi", "36")
37 model.addParameter(Part_1_doc, "pi", "3.141592653589793")
38 model.addParameter(Part_1_doc, "x", "R*sin(phi/180*pi)*cos(theta/180*pi)")
39 model.addParameter(Part_1_doc, "y", "R*sin(phi/180*pi)*sin(theta/180*pi)")
40 model.addParameter(Part_1_doc, "z", "R*cos(phi/180*pi)")
41 model.addParameter(Part_1_doc, "haut_ext_tuyau", "5")
42 model.addParameter(Part_1_doc, "haut_int_tuyau", "14")
43 Param_Diam = model.addParameter(Part_1_doc, "diam_tuyau", "10")
44
45 Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 90, 0)
46 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
47 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
48 SketchPoint_1 = SketchProjection_1.createdFeature()
49 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
50 SketchLine_1 = SketchProjection_2.createdFeature()
51 SketchArc_1 = Sketch_1.addArc(0, 0, 58, 0, 0, -58, True)
52 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
53 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
54 SketchLine_2 = Sketch_1.addLine(0, -58, 0, 0)
55 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.startPoint())
56 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_2.endPoint())
57 SketchLine_3 = Sketch_1.addLine(0, 0, 58, 0)
58 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
59 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.endPoint())
60 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
61 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "R")
62 Revolution_1.setNestedSketch(Sketch_1)
63
64 Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 0, "cote_cube")
65 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_2"))
66 SketchLine_4 = Sketch_2.addLine(29, 0, 0, 0)
67 SketchLine_5 = Sketch_2.addLine(0, 0, 0, 29)
68 SketchLine_6 = Sketch_2.addLine(0, 29, 29, 29)
69 SketchLine_7 = Sketch_2.addLine(29, 29, 29, 0)
70 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_4.startPoint())
71 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
72 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
73 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
74 SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_4.result())
75 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_5.result())
76 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_6.result())
77 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_7.result())
78 SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_6.result(), "cote_cube")
79 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_6.result(), SketchLine_7.result())
80 SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/To_Face_1"), False)
81 SketchLine_8 = SketchProjection_3.createdFeature()
82 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_8.result())
83 SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/From_Face_1"), False)
84 SketchLine_9 = SketchProjection_4.createdFeature()
85 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.result())
86 Extrusion_1.setNestedSketch(Sketch_2)
87
88 Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
89
90 Point_2 = model.addPoint(Part_1_doc, "x", "y", "-z")
91 Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Fill_1_1_2/Modified_Face_3&Fill_1_1_2/Modified_Face_2&Fill_1_1_2/Modified_Face_1"))
92 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Point_1"), True)
93 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "haut_ext_tuyau", True)
94 Plane_5.result().setName("Plane_2 arrivee tuyau")
95 Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), 45)
96 Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), 45)
97 Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"), "90+45")
98
99 Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_1")], [model.selection("FACE", "Plane_5")])
100 Fill_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_2_1_2")], [model.selection("FACE", "Plane_3")])
101 Fill_4 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_3_1_2")], [model.selection("FACE", "Plane_4")])
102 Fill_4.result().setColor(102, 51, 51)
103 Fill_4.result().subResult(0).setColor(153, 153, 76)
104 Fill_4.result().subResult(1).setColor(0, 204, 204)
105 Fill_4.result().subResult(2).setColor(51, 51, 102)
106 Fill_4.result().subResult(3).setColor(102, 204, 102)
107 Fill_4.result().subResult(4).setColor(204, 204, 0)
108
109 Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Fill_4_1_4"), model.selection("SOLID", "Fill_4_1_2")])
110
111 Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("FACE", "Plane_2 arrivee tuyau"))
112
113 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2 arrivee tuyau"))
114 SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Point_2"), False)
115 SketchPoint_2 = SketchProjection_5.createdFeature()
116 SketchCircle_1 = Sketch_3.addCircle(0, 0, 10)
117 SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchPoint_2.result(), SketchCircle_1.center())
118 SketchConstraintRadius_1 = Sketch_3.setRadius(SketchCircle_1.results()[1], "diam_tuyau")
119 SketchLine_10 = Sketch_3.addLine(-5, 5, 5, 5)
120 SketchLine_11 = Sketch_3.addLine(5, 5, 5, -5)
121 SketchLine_12 = Sketch_3.addLine(5, -5, -5, -5)
122 SketchLine_13 = Sketch_3.addLine(-5, -5, -5, 5)
123 SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_10.startPoint())
124 SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
125 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
126 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
127 SketchConstraintHorizontal_3 = Sketch_3.setHorizontal(SketchLine_10.result())
128 SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_11.result())
129 SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_12.result())
130 SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_13.result())
131 SketchConstraintEqual_2 = Sketch_3.setEqual(SketchLine_10.result(), SketchLine_13.result())
132 SketchLine_14 = Sketch_3.addLine(5, 5, 7.071067811865479, 7.071067811865475)
133 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_10.endPoint(), SketchLine_14.startPoint())
134 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchCircle_1.results()[1])
135 SketchLine_15 = Sketch_3.addLine(-5, -5, -7.071067811865472, -7.071067811865476)
136 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_15.startPoint())
137 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_15.endPoint(), SketchCircle_1.results()[1])
138 SketchConstraintCollinear_1 = Sketch_3.setCollinear(SketchLine_14.result(), SketchLine_15.result())
139 SketchLine_16 = Sketch_3.addLine(7.071067811865478, -7.071067811865476, 5, -5)
140 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchCircle_1.results()[1])
141 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_16.endPoint())
142 SketchLine_17 = Sketch_3.addLine(-5, 5, -7.071067811865472, 7.071067811865476)
143 SketchConstraintCoincidence_24 = Sketch_3.setCoincident(SketchLine_10.startPoint(), SketchLine_17.startPoint())
144 SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchCircle_1.results()[1])
145 SketchConstraintCollinear_2 = Sketch_3.setCollinear(SketchLine_17.result(), SketchLine_16.result())
146 SketchConstraintEqual_3 = Sketch_3.setEqual(SketchLine_14.result(), SketchLine_15.result())
147 SketchConstraintEqual_4 = Sketch_3.setEqual(SketchLine_17.result(), SketchLine_16.result())
148 SketchConstraintLength_3 = Sketch_3.setLength(SketchLine_10.result(), "diam_tuyau")
149 model.do()
150
151 Extrusion_2_objects = [model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_11f-SketchLine_14r-SketchLine_16r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_10f-SketchLine_14f-SketchLine_17r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_13f-SketchLine_15r-SketchLine_17f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_12f-SketchLine_15f-SketchLine_16f")]
152 Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), 10, 0)
153 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), "haut_int_tuyau", 0)
154
155 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_3"))
156 SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), False)
157 SketchPoint_3 = SketchProjection_6.createdFeature()
158 SketchProjection_7 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), False)
159 SketchPoint_4 = SketchProjection_7.createdFeature()
160 SketchArc_2 = Sketch_4.addArc(0, 0, -7.071067811865476, -7.071067811865472, 7.071067811865476, 7.071067811865472, True)
161 SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchPoint_3.result(), SketchArc_2.startPoint())
162 SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchPoint_4.result(), SketchArc_2.results()[1])
163 SketchLine_18 = Sketch_4.addLine(7.071067811865476, 7.071067811865472, -7.071067811865476, -7.071067811865472)
164 SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchLine_18.startPoint())
165 SketchConstraintCoincidence_29 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_18.endPoint())
166 SketchProjection_8 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), False)
167 SketchPoint_5 = SketchProjection_8.createdFeature()
168 SketchConstraintCoincidence_30 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchAPI_Point(SketchPoint_5).coordinates())
169 model.do()
170
171 Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_18"), 0, 180)
172
173 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
174 Cut_1.result().setName("demi-sphere")
175
176 Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/From_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_10&Extrusion_2_1/To_Face_4"))
177 Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_12&Extrusion_2_1/Generated_Face_11&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/From_Face_1"))
178 Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/From_Face_3"))
179 Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/From_Face_4"))
180
181 Recover_1 = model.addRecover(Part_1_doc, Cut_1, [Extrusion_3.result()])
182
183 Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape4"), model.selection("EDGE", "Recover_1_1/Shape4&Recover_1_1/Shape6"), "90+45")
184 Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape1"), model.selection("EDGE", "Recover_1_1/Shape1&Recover_1_1/Shape6"), "90+45")
185 Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape2"), model.selection("EDGE", "Recover_1_1/Shape2&Recover_1_1/Shape6"), "90+45")
186 Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape6"), model.selection("EDGE", "Recover_1_1/Shape3&Recover_1_1/Shape6"), 45)
187
188 Fill_5_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")]
189 Fill_5 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Fill_5_objects_2)
190
191 Union_2_objects = [model.selection("SOLID", "Fill_5_1_14"), model.selection("SOLID", "Fill_5_1_15"), model.selection("SOLID", "Fill_5_1_16")]
192 Union_2 = model.addUnion(Part_1_doc, Union_2_objects)
193 Union_3_objects = [model.selection("SOLID", "Fill_5_1_8/Fill_5_1_8"), model.selection("SOLID", "Fill_5_1_4/Fill_5_1_4"), model.selection("SOLID", "Fill_5_1_9/Fill_5_1_9"), model.selection("SOLID", "Fill_5_1_11/Fill_5_1_11")]
194 Union_3 = model.addUnion(Part_1_doc, Union_3_objects)
195 Union_4_objects = [model.selection("SOLID", "Fill_5_1_6/Fill_5_1_6"), model.selection("SOLID", "Fill_5_1_10/Fill_5_1_10"), model.selection("SOLID", "Fill_5_1_13/Fill_5_1_13")]
196 Union_4 = model.addUnion(Part_1_doc, Union_4_objects)
197 Union_5_objects = [model.selection("SOLID", "Fill_5_1_2/Fill_5_1_2"), model.selection("SOLID", "Fill_5_1_1/Fill_5_1_1"), model.selection("SOLID", "Fill_5_1_3/Fill_5_1_3")]
198 Union_5 = model.addUnion(Part_1_doc, Union_5_objects)
199 Union_6_objects = [model.selection("SOLID", "Fill_5_1_5/Fill_5_1_5"), model.selection("SOLID", "Fill_5_1_7/Fill_5_1_7"), model.selection("SOLID", "Fill_5_1_12/Fill_5_1_12")]
200 Union_6 = model.addUnion(Part_1_doc, Union_6_objects)
201 Union_6.result().setColor(0, 0, 204)
202 Union_6.result().subResult(0).setColor(204, 102, 102)
203 Union_6.result().subResult(1).setColor(127, 254, 127)
204 Union_6.result().subResult(2).setColor(102, 51, 102)
205 Union_6.result().subResult(3).setColor(76, 76, 153)
206 Union_6.result().subResult(4).setColor(0, 0, 254)
207
208 Partition_1_objects = [model.selection("SOLID", "Recover_1_1"), model.selection("COMPSOLID", "Union_1_1"), model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "demi-sphere")]
209 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
210 Partition_1.result().setColor(102, 0, 0)
211 Partition_1.result().subResult(0).setColor(255, 255, 0)
212 Partition_1.result().subResult(1).setColor(0, 254, 0)
213 Partition_1.result().subResult(2).setColor(0, 255, 255)
214 Partition_1.result().subResult(3).setColor(255, 85, 0)
215 Partition_1.result().subResult(4).setColor(153, 0, 0)
216 Partition_1.result().subResult(5).setColor(254, 0, 254)
217 Partition_1.result().subResult(6).setColor(127, 127, 254)
218 Partition_1.result().subResult(7).setColor(102, 204, 102)
219 Partition_1.result().subResult(8).setColor(127, 254, 127)
220 Partition_1.result().subResult(9).setColor(153, 153, 76)
221 Partition_1.result().subResult(10).setColor(204, 102, 102)
222 Partition_1.result().subResult(11).setColor(127, 254, 254)
223 Partition_1.result().subResult(12).setColor(255, 255, 0)
224 Partition_1.result().subResult(13).setColor(102, 51, 102)
225 Partition_1.result().subResult(14).setColor(102, 204, 204)
226 Partition_1.result().subResult(15).setColor(254, 127, 254)
227 Partition_1.result().subResult(16).setColor(153, 153, 0)
228 Partition_1.result().subResult(17).setColor(153, 153, 0)
229 Partition_1.result().subResult(18).setColor(204, 0, 204)
230
231 Folder_1 = model.addFolder(Part_1_doc, Revolution_1, Union_1)
232 Folder_2 = model.addFolder(Part_1_doc, Point_3, Union_6)
233 model.do()
234
235 # check the result
236 model.testNbResults(Partition_1, 1)
237 model.testNbSubResults(Partition_1, [19])
238 model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [19])
239 model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [199])
240 model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [814])
241 model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1628])
242 model.testResultsVolumes(Partition_1, [103867.289635450288187712430953979])
243
244 # change parameter and check validity of the result
245 Param_Diam.setValue(8)
246 model.do()
247
248 model.testNbResults(Partition_1, 1)
249 model.testNbSubResults(Partition_1, [19])
250 model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [19])
251 model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [191])
252 model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [744])
253 model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1488])
254 model.testResultsVolumes(Partition_1, [103221.354557478349306620657444])
255
256 model.end()
257
258 #assert(model.checkPythonDump())