Salome HOME
Add tests.
[modules/shaper.git] / test.API / SHAPER / Transformations / TestTranslation_3.py
1 """
2 Test case for Translation feature. 
3 Written on High API.
4 """
5 from salome.shaper import model
6
7 model.begin()
8 partSet = model.moduleDocument()
9 Part_1 = model.addPart(partSet)
10 Part_1_doc = Part_1.document()
11
12 # Boxes
13 Box_1 = model.addBox(Part_1_doc, 10, 20, 10)
14
15 ####################
16 # Sketches
17 # Sketch contenant un triangle
18 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
19 SketchLine_1 = Sketch_1.addLine(105.8795836373178, 106.9780351893485, -55.30451701345322, -118.6797057217308)
20 SketchLine_2 = Sketch_1.addLine(-55.30451701345322, -118.6797057217308, -134.9484255703047, 86.11891628160174)
21 SketchLine_3 = Sketch_1.addLine(-134.9484255703047, 86.11891628160174, 105.8795836373178, 106.9780351893485)
22 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
23 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
24 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
25
26 # Sketch contenant un cercle et une ligne droite ne coupant pas le cercle, tous deux contenus dans l'une des faces de la box 1
27 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
28 SketchCircle_1 = Sketch_2.addCircle(3.625538020086079, 17.57352941176471, 2.190441696184978)
29 SketchLine_4 = Sketch_2.addLine(2.442711482557598, 6.454964041059345, 8.035432938365913, 18.18483116518828)
30
31 # Sketch contenant une ligne droite
32 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
33 SketchLine_5 = Sketch_3.addLine(-42.70592498087446, -19.7671890801643, 76.68536514422158, 72.47712556405142)
34
35 # Sketch contenant 2 lignes droites independantes
36 Sketch_4 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
37 SketchLine_6 = Sketch_4.addLine(64.56241032998567, 126.9727403156384, -187.948350071736, -65.2797704447633)
38 SketchLine_7 = Sketch_4.addLine(147.7761836441895, 78.19225251076045, 2.869440459110503, -194.4045911047346)
39
40 # Sketch contenant un triangle et une ligne droite sans contact avec le triangle
41 Sketch_5 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
42 SketchLine_8 = Sketch_5.addLine(43.04160688665702, 82.49641319942614, -63.12769010043041, -3.586800573888105)
43 SketchLine_9 = Sketch_5.addLine(-63.12769010043041, -3.586800573888105, 60.25824964132004, -45.19368723098994)
44 SketchLine_10 = Sketch_5.addLine(60.25824964132004, -45.19368723098994, 43.04160688665702, 82.49641319942614)
45 SketchConstraintCoincidence_4 = Sketch_5.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
46 SketchConstraintCoincidence_5 = Sketch_5.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
47 SketchConstraintCoincidence_6 = Sketch_5.setCoincident(SketchLine_8.startPoint(), SketchLine_10.endPoint())
48 SketchLine_11 = Sketch_5.addLine(-129.0707731585723, -64.87131938806517, -62.80680259595319, 54.77196079444149)
49
50 # Sketch contenant deux triangles ayant un cote en commun
51 Sketch_6 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
52 SketchLine_12 = Sketch_6.addLine(31.56384505021527, 81.06169296987088, -80.3443328550933, -15.06456241033)
53 SketchLine_13 = Sketch_6.addLine(-80.3443328550933, -15.06456241033, 58.82352941176466, -35.15064562410331)
54 SketchLine_14 = Sketch_6.addLine(58.82352941176466, -35.15064562410331, 31.56384505021527, 81.06169296987088)
55 SketchLine_15 = Sketch_6.addLine(31.56384505021527, 81.06169296987088, 159.2539454806312, 40.88952654232425)
56 SketchLine_16 = Sketch_6.addLine(159.2539454806312, 40.88952654232425, 58.82352941176466, -35.15064562410331)
57 SketchConstraintCoincidence_7 = Sketch_6.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
58 SketchConstraintCoincidence_8 = Sketch_6.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
59 SketchConstraintCoincidence_9 = Sketch_6.setCoincident(SketchLine_12.startPoint(), SketchLine_14.endPoint())
60 SketchConstraintCoincidence_10 = Sketch_6.setCoincident(SketchLine_12.startPoint(), SketchLine_15.startPoint())
61 SketchConstraintCoincidence_11 = Sketch_6.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
62 SketchConstraintCoincidence_12 = Sketch_6.setCoincident(SketchLine_13.endPoint(), SketchLine_16.endPoint())
63
64 # Sketch contenant deux triangles ayant un cote en commun et une ligne droite ne coupant aucun des 2 triangles
65 Sketch_7 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
66 SketchLine_17 = Sketch_7.addLine(17.21664275466276, 98.27833572453372, -144.906743185079, -46.6284074605452)
67 SketchLine_18 = Sketch_7.addLine(-144.906743185079, -46.6284074605452, 143.4720229555236, -105.4519368723099)
68 SketchLine_19 = Sketch_7.addLine(143.4720229555236, -105.4519368723099, 17.21664275466276, 98.27833572453372)
69 SketchLine_20 = Sketch_7.addLine(17.21664275466276, 98.27833572453372, 272.5968436154949, 99.71305595408899)
70 SketchLine_21 = Sketch_7.addLine(272.5968436154949, 99.71305595408899, 143.4720229555236, -105.4519368723099)
71 SketchConstraintCoincidence_13 = Sketch_7.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
72 SketchConstraintCoincidence_14 = Sketch_7.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
73 SketchConstraintCoincidence_15 = Sketch_7.setCoincident(SketchLine_17.startPoint(), SketchLine_19.endPoint())
74 SketchConstraintCoincidence_16 = Sketch_7.setCoincident(SketchLine_17.startPoint(), SketchLine_20.startPoint())
75 SketchConstraintCoincidence_17 = Sketch_7.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
76 SketchConstraintCoincidence_18 = Sketch_7.setCoincident(SketchLine_18.endPoint(), SketchLine_21.endPoint())
77 SketchLine_22 = Sketch_7.addLine(-190.8177905308465, 62.41032998565277, -307.0301291248207, -188.6657101865136)
78
79 # Sketch contenant un cercle
80 Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
81 SketchCircle_2 = Sketch_8.addCircle(5.043472022955523, 6.180989956958394, 2.65480068754944)
82
83 model.do()
84
85 # Extrusions
86 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
87 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_8/Wire-SketchCircle_2_2f")], model.selection(), 15, 0)
88
89 # Edges
90 Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
91 Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
92 Edge_3 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
93 Edge_4 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
94 Edge_5 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
95 Edge_6 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
96 Edge_7 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
97 Edge_8 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_6")])
98 Edge_9 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
99 Edge_10 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
100 Edge_11 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_5/Edge-SketchLine_11")])
101 Edge_12 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_7/Edge-SketchLine_22")])
102
103 # Axis
104 Axis_1 = model.addAxis(Part_1_doc, 10, 10, 10)
105
106 # Vertex
107 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
108 Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
109 Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
110 Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
111 Vertex_5 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
112 Vertex_6 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
113 Vertex_7 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
114 Vertex_8 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
115 Vertex_9 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
116
117 # Wires
118 Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
119 Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
120 Wire_3 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
121 Wire_4 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
122 Wire_5 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
123 Wire_6 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
124 Wire_7 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
125 Wire_8 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
126 Wire_9 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
127
128 # Faces
129 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
130 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
131 Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
132 Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
133 Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
134 Face_6 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
135 Face_7 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
136 Face_8 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
137 Face_9 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
138 Face_10 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_12f-SketchLine_13f-SketchLine_14f")])
139 Face_11 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r")])
140 Face_12 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_17f-SketchLine_18f-SketchLine_19f")])
141 Face_13 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_19r-SketchLine_20r-SketchLine_21r")])
142
143 # Shells
144 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
145 Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
146 Shell_3 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
147 Shell_4 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
148 Shell_5 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
149 Shell_6 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
150 Shell_7 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
151 Shell_8 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
152 Shell_9 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
153
154 # Parameters
155 model.addParameter(Part_1_doc, "d", "15")
156
157 # Translations
158 Translation_45 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
159 Translation_46 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
160 Translation_47 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
161 Translation_48 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_4_1")], model.selection("EDGE", "InvalidName"), 15)
162 Translation_49 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
163 Translation_50 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_6_1")], model.selection("EDGE", "Sketch_3/Edge-SketchLine_5"), 15)
164 Translation_51 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_7_1")], model.selection("EDGE", "Edge_2_1"), 15)
165 Translation_52 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
166 Translation_53 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_9_1")], model.selection("EDGE", "Axis_1"), 15)
167 Translation_54 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_2_1")], model.selection("EDGE", "PartSet/OX"), 15)
168 Translation_55 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_3_1")], model.selection("EDGE", "PartSet/OX"), 0)
169 Translation_56 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_4_1")], model.selection("EDGE", "PartSet/OX"), -15)
170 Translation_57 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_5_1")], model.selection("EDGE", "InvalidName"), 15)
171 Translation_58 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_6_1")], model.selection("EDGE", "PartSet/OY"), "d")
172 Translation_59 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_7_1")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_6"), 15)
173 Translation_60 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_8_1")], model.selection("EDGE", "Edge_9_1"), 15)
174 Translation_61 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_9_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
175 Translation_62 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_10_1")], model.selection("EDGE", "Axis_1"), 15)
176 Translation_63 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
177 Translation_64 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
178 Translation_65 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
179 Translation_66 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_4_1")], model.selection("EDGE", "InvalidName"), 15)
180 Translation_67 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_5_1")], model.selection("EDGE", "PartSet/OY"), "d")
181 Translation_68 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
182 Translation_69 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
183 Translation_70 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
184 Translation_71 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_9_1")], model.selection("EDGE", "Axis_1"), 15)
185 Translation_72 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
186 Translation_73 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
187 Translation_74 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
188 Translation_75 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_4_1")], model.selection("EDGE", "InvalidName"), -15)
189 Translation_76 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
190 Translation_77 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
191 Translation_78 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
192 Translation_79 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
193 Translation_80 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_9_1")], model.selection("EDGE", "Axis_1"), 15)
194 Translation_81 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
195 Translation_82 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
196 Translation_83 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
197 Translation_84 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_4_1")], model.selection("EDGE", "InvalidName"), 15)
198 Translation_85 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
199 Translation_86 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_6_1")], model.selection("EDGE", "Sketch_7/Edge-SketchLine_22"), 15)
200 Translation_87 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_7_1")], model.selection("EDGE", "Edge_12_1"), 15)
201 Translation_88 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
202 Translation_89 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_9_1")], model.selection("EDGE", "Axis_1"), 15)
203 Translation_90 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_2_1")], model.selection("EDGE", "PartSet/OY"), 15)
204 model.do()
205 model.end()
206
207 # Checks
208 from GeomAPI import GeomAPI_Shape
209
210 model.testNbResults(Translation_45, 1)
211 model.testNbSubResults(Translation_45, [0])
212 model.testNbSubShapes(Translation_45, GeomAPI_Shape.COMPSOLID, [0])
213 model.testNbSubShapes(Translation_45, GeomAPI_Shape.SOLID, [0])
214 model.testNbSubShapes(Translation_45, GeomAPI_Shape.FACE, [0])
215 model.testNbSubShapes(Translation_45, GeomAPI_Shape.VERTEX, [1])
216 model.testHaveNamingFaces(Translation_45, model, Part_1_doc)
217
218 model.testNbResults(Translation_46, 1)
219 model.testNbSubResults(Translation_46, [0])
220 model.testNbSubShapes(Translation_46, GeomAPI_Shape.COMPSOLID, [0])
221 model.testNbSubShapes(Translation_46, GeomAPI_Shape.SOLID, [0])
222 model.testNbSubShapes(Translation_46, GeomAPI_Shape.FACE, [0])
223 model.testNbSubShapes(Translation_46, GeomAPI_Shape.VERTEX, [1])
224 model.testHaveNamingFaces(Translation_46, model, Part_1_doc)
225
226 model.testNbResults(Translation_47, 1)
227 model.testNbSubResults(Translation_47, [0])
228 model.testNbSubShapes(Translation_47, GeomAPI_Shape.COMPSOLID, [0])
229 model.testNbSubShapes(Translation_47, GeomAPI_Shape.SOLID, [0])
230 model.testNbSubShapes(Translation_47, GeomAPI_Shape.FACE, [0])
231 model.testNbSubShapes(Translation_47, GeomAPI_Shape.VERTEX, [1])
232 model.testHaveNamingFaces(Translation_47, model, Part_1_doc)
233
234 model.testNbResults(Translation_49, 1)
235 model.testNbSubResults(Translation_49, [0])
236 model.testNbSubShapes(Translation_49, GeomAPI_Shape.COMPSOLID, [0])
237 model.testNbSubShapes(Translation_49, GeomAPI_Shape.SOLID, [0])
238 model.testNbSubShapes(Translation_49, GeomAPI_Shape.FACE, [0])
239 model.testNbSubShapes(Translation_49, GeomAPI_Shape.VERTEX, [1])
240 model.testHaveNamingFaces(Translation_49, model, Part_1_doc)
241
242 model.testNbResults(Translation_50, 1)
243 model.testNbSubResults(Translation_50, [0])
244 model.testNbSubShapes(Translation_50, GeomAPI_Shape.COMPSOLID, [0])
245 model.testNbSubShapes(Translation_50, GeomAPI_Shape.SOLID, [0])
246 model.testNbSubShapes(Translation_50, GeomAPI_Shape.FACE, [0])
247 model.testNbSubShapes(Translation_50, GeomAPI_Shape.VERTEX, [1])
248 model.testHaveNamingFaces(Translation_50, model, Part_1_doc)
249
250 model.testNbResults(Translation_51, 1)
251 model.testNbSubResults(Translation_51, [0])
252 model.testNbSubShapes(Translation_51, GeomAPI_Shape.COMPSOLID, [0])
253 model.testNbSubShapes(Translation_51, GeomAPI_Shape.SOLID, [0])
254 model.testNbSubShapes(Translation_51, GeomAPI_Shape.FACE, [0])
255 model.testNbSubShapes(Translation_51, GeomAPI_Shape.VERTEX, [1])
256 model.testHaveNamingFaces(Translation_51, model, Part_1_doc)
257
258 model.testNbResults(Translation_52, 1)
259 model.testNbSubResults(Translation_52, [0])
260 model.testNbSubShapes(Translation_52, GeomAPI_Shape.COMPSOLID, [0])
261 model.testNbSubShapes(Translation_52, GeomAPI_Shape.SOLID, [0])
262 model.testNbSubShapes(Translation_52, GeomAPI_Shape.FACE, [0])
263 model.testNbSubShapes(Translation_52, GeomAPI_Shape.VERTEX, [1])
264 model.testHaveNamingFaces(Translation_52, model, Part_1_doc)
265
266 model.testNbResults(Translation_53, 1)
267 model.testNbSubResults(Translation_53, [0])
268 model.testNbSubShapes(Translation_53, GeomAPI_Shape.COMPSOLID, [0])
269 model.testNbSubShapes(Translation_53, GeomAPI_Shape.SOLID, [0])
270 model.testNbSubShapes(Translation_53, GeomAPI_Shape.FACE, [0])
271 model.testNbSubShapes(Translation_53, GeomAPI_Shape.VERTEX, [1])
272 model.testHaveNamingFaces(Translation_53, model, Part_1_doc)
273
274 model.testNbResults(Translation_54, 1)
275 model.testNbSubResults(Translation_54, [0])
276 model.testNbSubShapes(Translation_54, GeomAPI_Shape.SOLID, [0])
277 model.testNbSubShapes(Translation_54, GeomAPI_Shape.FACE, [0])
278 model.testNbSubShapes(Translation_54, GeomAPI_Shape.EDGE, [1])
279 model.testHaveNamingFaces(Translation_54, model, Part_1_doc)
280
281 model.testNbResults(Translation_55, 1)
282 model.testNbSubResults(Translation_55, [0])
283 model.testNbSubShapes(Translation_55, GeomAPI_Shape.SOLID, [0])
284 model.testNbSubShapes(Translation_55, GeomAPI_Shape.FACE, [0])
285 model.testNbSubShapes(Translation_55, GeomAPI_Shape.EDGE, [1])
286 model.testHaveNamingFaces(Translation_55, model, Part_1_doc)
287
288 model.testNbResults(Translation_56, 1)
289 model.testNbSubResults(Translation_56, [0])
290 model.testNbSubShapes(Translation_56, GeomAPI_Shape.SOLID, [0])
291 model.testNbSubShapes(Translation_56, GeomAPI_Shape.FACE, [0])
292 model.testNbSubShapes(Translation_56, GeomAPI_Shape.EDGE, [1])
293 model.testHaveNamingFaces(Translation_56, model, Part_1_doc)
294
295 model.testNbResults(Translation_58, 1)
296 model.testNbSubResults(Translation_58, [0])
297 model.testNbSubShapes(Translation_58, GeomAPI_Shape.SOLID, [0])
298 model.testNbSubShapes(Translation_58, GeomAPI_Shape.FACE, [0])
299 model.testNbSubShapes(Translation_58, GeomAPI_Shape.EDGE, [1])
300 model.testHaveNamingFaces(Translation_58, model, Part_1_doc)
301
302 model.testNbResults(Translation_59, 1)
303 model.testNbSubResults(Translation_59, [0])
304 model.testNbSubShapes(Translation_59, GeomAPI_Shape.SOLID, [0])
305 model.testNbSubShapes(Translation_59, GeomAPI_Shape.FACE, [0])
306 model.testNbSubShapes(Translation_59, GeomAPI_Shape.EDGE, [1])
307 model.testHaveNamingFaces(Translation_59, model, Part_1_doc)
308
309 model.testNbResults(Translation_60, 1)
310 model.testNbSubResults(Translation_60, [0])
311 model.testNbSubShapes(Translation_60, GeomAPI_Shape.SOLID, [0])
312 model.testNbSubShapes(Translation_60, GeomAPI_Shape.FACE, [0])
313 model.testNbSubShapes(Translation_60, GeomAPI_Shape.EDGE, [1])
314 model.testHaveNamingFaces(Translation_60, model, Part_1_doc)
315
316 model.testNbResults(Translation_61, 1)
317 model.testNbSubResults(Translation_61, [0])
318 model.testNbSubShapes(Translation_61, GeomAPI_Shape.SOLID, [0])
319 model.testNbSubShapes(Translation_61, GeomAPI_Shape.FACE, [0])
320 model.testNbSubShapes(Translation_61, GeomAPI_Shape.EDGE, [1])
321 model.testHaveNamingFaces(Translation_61, model, Part_1_doc)
322
323 model.testNbResults(Translation_62, 1)
324 model.testNbSubResults(Translation_62, [0])
325 model.testNbSubShapes(Translation_62, GeomAPI_Shape.SOLID, [0])
326 model.testNbSubShapes(Translation_62, GeomAPI_Shape.FACE, [0])
327 model.testNbSubShapes(Translation_62, GeomAPI_Shape.EDGE, [1])
328 model.testHaveNamingFaces(Translation_62, model, Part_1_doc)
329
330 model.testNbResults(Translation_63, 1)
331 model.testNbSubResults(Translation_63, [0])
332 model.testNbSubShapes(Translation_63, GeomAPI_Shape.SOLID, [0])
333 model.testNbSubShapes(Translation_63, GeomAPI_Shape.FACE, [0])
334 model.testNbSubShapes(Translation_63, GeomAPI_Shape.WIRE, [1])
335 model.testHaveNamingFaces(Translation_63, model, Part_1_doc)
336
337 model.testNbResults(Translation_64, 1)
338 model.testNbSubResults(Translation_64, [0])
339 model.testNbSubShapes(Translation_64, GeomAPI_Shape.SOLID, [0])
340 model.testNbSubShapes(Translation_64, GeomAPI_Shape.FACE, [0])
341 model.testNbSubShapes(Translation_64, GeomAPI_Shape.WIRE, [1])
342 model.testHaveNamingFaces(Translation_64, model, Part_1_doc)
343
344 model.testNbResults(Translation_65, 1)
345 model.testNbSubResults(Translation_65, [0])
346 model.testNbSubShapes(Translation_65, GeomAPI_Shape.SOLID, [0])
347 model.testNbSubShapes(Translation_65, GeomAPI_Shape.FACE, [0])
348 model.testNbSubShapes(Translation_65, GeomAPI_Shape.WIRE, [1])
349 model.testHaveNamingFaces(Translation_65, model, Part_1_doc)
350
351 model.testNbResults(Translation_67, 1)
352 model.testNbSubResults(Translation_67, [0])
353 model.testNbSubShapes(Translation_67, GeomAPI_Shape.SOLID, [0])
354 model.testNbSubShapes(Translation_67, GeomAPI_Shape.FACE, [0])
355 model.testNbSubShapes(Translation_67, GeomAPI_Shape.WIRE, [1])
356 model.testHaveNamingFaces(Translation_67, model, Part_1_doc)
357
358 model.testNbResults(Translation_68, 1)
359 model.testNbSubResults(Translation_68, [0])
360 model.testNbSubShapes(Translation_68, GeomAPI_Shape.SOLID, [0])
361 model.testNbSubShapes(Translation_68, GeomAPI_Shape.FACE, [0])
362 model.testNbSubShapes(Translation_68, GeomAPI_Shape.WIRE, [1])
363 model.testHaveNamingFaces(Translation_68, model, Part_1_doc)
364
365 model.testNbResults(Translation_69, 1)
366 model.testNbSubResults(Translation_69, [0])
367 model.testNbSubShapes(Translation_69, GeomAPI_Shape.SOLID, [0])
368 model.testNbSubShapes(Translation_69, GeomAPI_Shape.FACE, [0])
369 model.testNbSubShapes(Translation_69, GeomAPI_Shape.WIRE, [1])
370 model.testHaveNamingFaces(Translation_69, model, Part_1_doc)
371
372 model.testNbResults(Translation_70, 1)
373 model.testNbSubResults(Translation_70, [0])
374 model.testNbSubShapes(Translation_70, GeomAPI_Shape.SOLID, [0])
375 model.testNbSubShapes(Translation_70, GeomAPI_Shape.FACE, [0])
376 model.testNbSubShapes(Translation_70, GeomAPI_Shape.WIRE, [1])
377 model.testHaveNamingFaces(Translation_70, model, Part_1_doc)
378
379 model.testNbResults(Translation_71, 1)
380 model.testNbSubResults(Translation_71, [0])
381 model.testNbSubShapes(Translation_71, GeomAPI_Shape.SOLID, [0])
382 model.testNbSubShapes(Translation_71, GeomAPI_Shape.FACE, [0])
383 model.testNbSubShapes(Translation_71, GeomAPI_Shape.WIRE, [1])
384 model.testHaveNamingFaces(Translation_71, model, Part_1_doc)
385
386 model.testNbResults(Translation_72, 1)
387 model.testNbSubResults(Translation_72, [0])
388 model.testNbSubShapes(Translation_72, GeomAPI_Shape.SOLID, [0])
389 model.testNbSubShapes(Translation_72, GeomAPI_Shape.FACE, [1])
390 model.testHaveNamingFaces(Translation_72, model, Part_1_doc)
391
392 model.testNbResults(Translation_73, 1)
393 model.testNbSubResults(Translation_73, [0])
394 model.testNbSubShapes(Translation_73, GeomAPI_Shape.SOLID, [0])
395 model.testNbSubShapes(Translation_73, GeomAPI_Shape.FACE, [1])
396 model.testHaveNamingFaces(Translation_73, model, Part_1_doc)
397
398 model.testNbResults(Translation_74, 1)
399 model.testNbSubResults(Translation_74, [0])
400 model.testNbSubShapes(Translation_74, GeomAPI_Shape.SOLID, [0])
401 model.testNbSubShapes(Translation_74, GeomAPI_Shape.FACE, [1])
402 model.testHaveNamingFaces(Translation_74, model, Part_1_doc)
403
404 model.testNbResults(Translation_76, 1)
405 model.testNbSubResults(Translation_76, [0])
406 model.testNbSubShapes(Translation_76, GeomAPI_Shape.SOLID, [0])
407 model.testNbSubShapes(Translation_76, GeomAPI_Shape.FACE, [1])
408 model.testHaveNamingFaces(Translation_76, model, Part_1_doc)
409
410 model.testNbResults(Translation_77, 1)
411 model.testNbSubResults(Translation_77, [0])
412 model.testNbSubShapes(Translation_77, GeomAPI_Shape.SOLID, [0])
413 model.testNbSubShapes(Translation_77, GeomAPI_Shape.FACE, [1])
414 model.testHaveNamingFaces(Translation_77, model, Part_1_doc)
415
416 model.testNbResults(Translation_78, 1)
417 model.testNbSubResults(Translation_78, [0])
418 model.testNbSubShapes(Translation_78, GeomAPI_Shape.SOLID, [0])
419 model.testNbSubShapes(Translation_78, GeomAPI_Shape.FACE, [1])
420 model.testHaveNamingFaces(Translation_78, model, Part_1_doc)
421
422 model.testNbResults(Translation_79, 1)
423 model.testNbSubResults(Translation_79, [0])
424 model.testNbSubShapes(Translation_79, GeomAPI_Shape.SOLID, [0])
425 model.testNbSubShapes(Translation_79, GeomAPI_Shape.FACE, [1])
426 model.testHaveNamingFaces(Translation_79, model, Part_1_doc)
427
428 model.testNbResults(Translation_80, 1)
429 model.testNbSubResults(Translation_80, [0])
430 model.testNbSubShapes(Translation_80, GeomAPI_Shape.SOLID, [0])
431 model.testNbSubShapes(Translation_80, GeomAPI_Shape.FACE, [1])
432 model.testHaveNamingFaces(Translation_80, model, Part_1_doc)
433
434 model.testNbResults(Translation_81, 1)
435 model.testNbSubResults(Translation_81, [0])
436 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SOLID, [0])
437 model.testNbSubShapes(Translation_81, GeomAPI_Shape.FACE, [2])
438 model.testNbSubShapes(Translation_81, GeomAPI_Shape.SHELL, [1])
439
440 model.testNbResults(Translation_82, 1)
441 model.testNbSubResults(Translation_82, [0])
442 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SOLID, [0])
443 model.testNbSubShapes(Translation_82, GeomAPI_Shape.FACE, [2])
444 model.testNbSubShapes(Translation_82, GeomAPI_Shape.SHELL, [1])
445
446 model.testNbResults(Translation_83, 1)
447 model.testNbSubResults(Translation_83, [0])
448 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SOLID, [0])
449 model.testNbSubShapes(Translation_83, GeomAPI_Shape.FACE, [2])
450 model.testNbSubShapes(Translation_83, GeomAPI_Shape.SHELL, [1])
451
452 model.testNbResults(Translation_85, 1)
453 model.testNbSubResults(Translation_85, [0])
454 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SOLID, [0])
455 model.testNbSubShapes(Translation_85, GeomAPI_Shape.FACE, [2])
456 model.testNbSubShapes(Translation_85, GeomAPI_Shape.SHELL, [1])
457
458 model.testNbResults(Translation_86, 1)
459 model.testNbSubResults(Translation_86, [0])
460 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SOLID, [0])
461 model.testNbSubShapes(Translation_86, GeomAPI_Shape.FACE, [2])
462 model.testNbSubShapes(Translation_86, GeomAPI_Shape.SHELL, [1])
463
464 model.testNbResults(Translation_87, 1)
465 model.testNbSubResults(Translation_87, [0])
466 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SOLID, [0])
467 model.testNbSubShapes(Translation_87, GeomAPI_Shape.FACE, [2])
468 model.testNbSubShapes(Translation_87, GeomAPI_Shape.SHELL, [1])
469
470 model.testNbResults(Translation_88, 1)
471 model.testNbSubResults(Translation_88, [0])
472 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SOLID, [0])
473 model.testNbSubShapes(Translation_88, GeomAPI_Shape.FACE, [2])
474 model.testNbSubShapes(Translation_88, GeomAPI_Shape.SHELL, [1])
475
476 model.testNbResults(Translation_89, 1)
477 model.testNbSubResults(Translation_89, [0])
478 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SOLID, [0])
479 model.testNbSubShapes(Translation_89, GeomAPI_Shape.FACE, [2])
480 model.testNbSubShapes(Translation_89, GeomAPI_Shape.SHELL, [1])
481
482 model.testNbResults(Translation_90, 2)
483 model.testNbSubResults(Translation_90, [0, 0])
484 model.testNbSubShapes(Translation_90, GeomAPI_Shape.SOLID, [1, 1])
485 model.testNbSubShapes(Translation_90, GeomAPI_Shape.FACE, [6, 3])
486 model.testHaveNamingFaces(Translation_90, model, Part_1_doc)
487
488
489 model.testNbResults(Translation_48, 0)
490 assert(Translation_48.feature().error() == 'Attribute "axis_object" is not initialized.')
491
492 model.testNbResults(Translation_57, 0)
493 assert(Translation_57.feature().error() == 'Attribute "axis_object" is not initialized.')
494
495 model.testNbResults(Translation_66, 0)
496 assert(Translation_66.feature().error() == 'Attribute "axis_object" is not initialized.')
497
498 model.testNbResults(Translation_75, 0)
499 assert(Translation_75.feature().error() == 'Attribute "axis_object" is not initialized.')
500
501 model.testNbResults(Translation_84, 0)
502 assert(Translation_84.feature().error() == 'Attribute "axis_object" is not initialized.')