Salome HOME
Updated copyright comment
[modules/hexablock.git] / doc / cas_test_python / BIELLE.py
1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2024  CEA, EDF
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 #===============================================
22 # By Karima DEBCHI YATAGHENE Nov 2009 at CS 
23 #===============================================
24
25
26 import os
27 import GEOM
28 import geompy
29 import smesh
30 import hexablock
31 import math
32 import SALOMEDS
33
34
35 STEP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/crank.stp")
36
37
38 #=============================
39 # CREATION DOCUMENT
40 #=============================
41
42 doc = hexablock.addDocument("Bielle")
43
44 #=============================
45 # CREATION DU MODELE
46 #=============================
47
48 # Pour la bielle on doit creer deux grilles cylindriques et prismer les quadrangles entre ces deux dernieres
49
50 #=============================
51 # PARAMETRES
52 #=============================
53
54 R = 40.0
55
56 r_grd = R
57 r_grd_t = R/2
58
59 r_pte = R
60 r_pte_t = R/2
61
62 l = 200.0
63 h = 0.019999999553*2
64 #h = 40.
65
66 # Taille du grand cylindre
67 dr_grd = R
68 da_grd = 360
69 dl_grd = h
70
71 nr_grd = 1
72 na_grd = 6
73 nl_grd = 1
74
75 # Taille du petit cylindre
76 dr_pte = R
77 da_pte = 360
78 dl_pte = h
79
80 nr_pte = 1
81 na_pte = 6
82 nl_pte = 1
83
84
85 #=============================
86 # Creation des vecteurs
87 #=============================
88
89 dx = doc.addVector(l, 0, 0)
90 dy = doc.addVector(0, l, 0)
91 dz = doc.addVector(0, 0, l)
92
93 #=================================================
94 # Creation des centres des grilles cylindriques
95 #=================================================
96
97 c_grd = doc.addVertex(0, 0, 0)
98 c_pte = doc.addVertex(2*l, 0, 0)
99 dx_prime = doc.addVectorVertices( c_grd, c_pte )
100
101 #=================================================
102 # Creation de la grande grille cylindrique
103 #=================================================
104
105 grille_cyl_grd = doc.makeCylindrical(c_grd, dx, dz, dr_grd, da_grd, dl_grd, nr_grd, na_grd, nl_grd, False)
106
107 # on obtient une liste qui contient 6 hexaedres eguaux
108
109 # 30 = pi/6
110 # 60 = pi/3
111 # 45 = pi/4
112 # 90 = pi/2
113 # 180 = pi
114
115 alpha_x = 2*R*math.cos(math.pi/3)
116 alpha_y = 2*R*math.sin(math.pi/3)
117
118 x1 = doc.findVertex( 2*R, 0, h )
119 x2 = doc.findVertex( alpha_x, alpha_y, 0 )
120 x3 = doc.findVertex( alpha_x, -alpha_y, 0 )
121 x4 = doc.findVertex( 2*R, 0, 0 )
122
123 quad_11 = doc.findQuad(x1, x2)
124 quad_12 = doc.findQuad(x1, x3)
125
126 quad_list = [ quad_11 , quad_12 ]
127
128 #=================================================
129 # Creation de la petite grille cylindrique
130 #=================================================
131
132 grille_cyl_pte = doc.makeTranslation( grille_cyl_grd , dx_prime )
133
134 # on obtient une liste qui contient 6 hexaedres eguaux
135
136 y1 = doc.findVertex( 2*l - 2*R , 0 , h )
137 y2 = doc.findVertex( 2*l - alpha_x , alpha_y , 0 )
138 y3 = doc.findVertex( 2*l - alpha_x , -alpha_y , 0 )
139 y4 = doc.findVertex( 2*l - 2*R , 0 , 0 )
140
141 quad_21 = doc.findQuad(y1, y2)
142 quad_22 = doc.findQuad(y1, y3)
143
144 #=================================================
145 # Assemblage des deux grilles cylindriques
146 #=================================================
147 model_biell_fin = doc.joinQuads( quad_list , quad_21 , x1 , y1 , x4 , y4 , 1 )
148
149
150 #===================================================================
151 # Recuperation des vertex du model hexa bielle pour l association
152 #===================================================================
153
154 # NB:
155 # h = haut
156 # b = bas
157 # g = grand
158 # p = petit
159 # t = trou
160
161 alpha_x = 2*R*math.cos(math.pi/3)
162 alpha_y = 2*R*math.sin(math.pi/3)
163
164 # Face du haut grand trou
165
166 ## RQ:On remplace la fonction findVertex par getVertexIJK
167
168 v_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 1 )
169 w_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 1 )
170 z_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 1 )
171
172 y_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 1 )
173 x_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 1 )
174 u_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 1 )
175
176 v_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 1 )
177 w_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 1 )
178 z_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 1 )
179
180 y_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 1 )
181 x_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 1 )
182 u_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 1 )
183
184
185 assert x_mod_h_g
186 assert y_mod_h_g
187 assert z_mod_h_g
188
189 assert u_mod_h_g
190 assert v_mod_h_g
191 assert w_mod_h_g
192
193 assert x_mod_h_g_t
194 assert y_mod_h_g_t
195 assert z_mod_h_g_t
196
197 assert u_mod_h_g_t
198 assert v_mod_h_g_t
199 assert w_mod_h_g_t #
200
201
202 # Face du haut petit trou
203
204 ## RQ:On remplace la fonction findVertex par getVertexIJK
205 v_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 1 )
206 w_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 1 )
207 z_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 1 )
208
209 y_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 1 )
210 x_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 1 )
211 u_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 1 )
212
213 v_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 1 )
214 w_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 1 )
215 z_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 1 )
216
217 y_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 1 )
218 x_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 1 )
219 u_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 1 )
220
221
222 assert x_mod_h_p
223 assert y_mod_h_p
224 assert z_mod_h_p
225
226 assert u_mod_h_p
227 assert v_mod_h_p
228 assert w_mod_h_p
229
230 assert x_mod_h_p_t
231 assert y_mod_h_p_t
232 assert z_mod_h_p_t
233
234 assert u_mod_h_p_t
235 assert v_mod_h_p_t
236 assert w_mod_h_p_t
237 #-----------
238
239 # Face du bas grand trou
240
241 ## RQ:On remplace la fonction findVertex par getVertexIJK
242
243 v_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 0 )
244 w_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 0 )
245 z_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 0 )
246
247 y_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 0 )
248 x_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 0 )
249 u_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 0 )
250
251 v_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 0 )
252 w_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 0 )
253 z_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 0 )
254
255 y_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 0 )
256 x_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 0 )
257 u_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 0 )
258
259 assert x_mod_b_g
260 assert y_mod_b_g
261 assert z_mod_b_g
262
263 assert u_mod_b_g
264 assert v_mod_b_g
265 assert w_mod_b_g
266
267 assert x_mod_b_g_t
268 assert y_mod_b_g_t
269 assert z_mod_b_g_t
270
271 assert u_mod_b_g_t
272 assert v_mod_b_g_t
273 assert w_mod_b_g_t
274
275
276 # Face du bas petit trou
277
278
279 ## RQ:On remplace la fonction findVertex par getVertexIJK
280
281 v_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 0 )
282 w_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 0 )
283 z_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 0 )
284
285 y_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 0 )
286 x_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 0 )
287 u_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 0 )
288
289 v_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 0 )
290 w_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 0 )
291 z_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 0 )
292
293 y_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 0 )
294 x_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 0 )
295 u_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 0 )
296
297 assert x_mod_b_p
298 assert y_mod_b_p
299 assert z_mod_b_p
300
301 assert u_mod_b_p
302 assert v_mod_b_p
303 assert w_mod_b_p
304
305 assert x_mod_b_p_t
306 assert y_mod_b_p_t
307 assert z_mod_b_p_t
308
309 assert u_mod_b_p_t
310 assert v_mod_b_p_t
311 assert w_mod_b_p_t
312 #-----------
313
314
315
316 #===================================================================
317 # Recuperation des points de la geometrie bielle pour l association
318 #===================================================================
319 # NB:
320 # h = haut
321 # b = bas
322 # g = grand
323 # p = petit
324 # t = trou
325
326 Bielle_geom = geompy.Import(STEP_PATH, "STEP")
327
328 geompy.addToStudy(Bielle_geom, "Bielle_geom")
329
330 Pt_A = geompy.MakeVertex(0, 0, h/2.)
331 Pt_B = geompy.MakeVertex(0, 0, -h/2.)
332
333 Face_haut = geompy.GetFaceNearPoint(Bielle_geom, Pt_A)
334 Face_bas = geompy.GetFaceNearPoint(Bielle_geom, Pt_B)
335
336
337 # Paramètre pour:
338 # -récupération des points.
339 # -et associations.
340 u_1 = 0.75#0.8
341 u_2 = 0.5
342 u_3 = 0.25#0.2
343
344
345
346 y_h_g = geompy.MakeVertexOnSurface(Face_haut, 1, 0.5)
347 y_b_g = geompy.MakeVertexWithRef(y_h_g, 0, 0, -h)
348 v_h_p = geompy.MakeVertexOnSurface(Face_haut, 0, 0.5)
349 v_b_p = geompy.MakeVertexWithRef(v_h_p, 0, 0, -h)
350
351
352 Edge_haut_grd = geompy.GetEdgeNearPoint(Bielle_geom, y_h_g)
353 Edge_haut_pte = geompy.GetEdgeNearPoint(Bielle_geom, v_h_p)
354 Edge_haut_grd_trou = geompy.GetEdgesByLength(Face_haut, 0.147, 0.148)
355 Edge_haut_pte_trou = geompy.GetEdgesByLength(Face_haut, 0.094, 0.095)
356 Edge_haut_droite = geompy.GetEdgesByLength(Face_haut, 0.136, 0.137)
357 Edge_haut_gauche = geompy.GetEdgesByLength(Face_haut, 0.131, 0.132)
358
359
360 #x_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 0)
361 x_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, u_3)
362 x_b_g = geompy.MakeVertexWithRef(x_h_g, 0, 0, -h)
363
364 #z_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 1.)
365 z_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, u_1)
366 z_b_g = geompy.MakeVertexWithRef(z_h_g, 0, 0, -h)
367
368 #w_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 0)
369 w_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, u_3)
370 w_b_p = geompy.MakeVertexWithRef(w_h_p, 0, 0, -h)
371
372 #u_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 1)
373 u_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, u_1)
374 u_b_p = geompy.MakeVertexWithRef(u_h_p, 0, 0, -h)
375
376
377 y_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0)
378 y_b_g_t = geompy.MakeVertexWithRef(y_h_g_t, 0, 0, -h)
379
380 z_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.2)
381 z_b_g_t = geompy.MakeVertexWithRef(z_h_g_t, 0, 0, -h)
382
383 #w_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.35)
384 w_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.40)
385 w_b_g_t = geompy.MakeVertexWithRef(w_h_g_t, 0, 0, -h)
386
387
388 v_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.5)
389 v_b_g_t = geompy.MakeVertexWithRef(v_h_g_t, 0, 0, -h)
390
391 #u_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.65)
392 u_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.6)
393 u_b_g_t = geompy.MakeVertexWithRef(u_h_g_t, 0, 0, -h)
394
395 x_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.8)
396 x_b_g_t = geompy.MakeVertexWithRef(x_h_g_t, 0, 0, -h)
397
398 y_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0)
399 y_b_p_t = geompy.MakeVertexWithRef(y_h_p_t, 0, 0, -h)
400
401 #z_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.2)
402 z_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.1)
403 z_b_p_t = geompy.MakeVertexWithRef(z_h_p_t, 0, 0, -h)
404
405 w_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.35)
406 w_b_p_t = geompy.MakeVertexWithRef(w_h_p_t, 0, 0, -h)
407
408 v_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.5)
409 v_b_p_t = geompy.MakeVertexWithRef(v_h_p_t, 0, 0, -h)
410
411 u_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.65)
412 u_b_p_t = geompy.MakeVertexWithRef(u_h_p_t, 0, 0, -h)
413
414
415
416 #x_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.8)
417 x_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.9)
418 x_b_p_t = geompy.MakeVertexWithRef(x_h_p_t, 0, 0, -h)
419
420 u_h_g = geompy.MakeVertexOnCurve(Edge_haut_droite, 1)
421 u_b_g = geompy.MakeVertexWithRef(u_h_g, 0, 0, -h)
422
423 x_h_p = geompy.MakeVertexOnCurve(Edge_haut_droite, 0)
424 x_b_p = geompy.MakeVertexWithRef(x_h_p, 0, 0, -h)
425
426
427 w_h_g = geompy.MakeVertexOnCurve(Edge_haut_gauche, 0)
428 w_b_g = geompy.MakeVertexWithRef(w_h_g, 0, 0, -h)
429
430
431 z_h_p = geompy.MakeVertexOnCurve(Edge_haut_gauche, 1)
432 z_b_p = geompy.MakeVertexWithRef(z_h_p, 0, 0, -h)
433
434
435 Edge_v_grd = geompy.MakeLineTwoPnt(u_h_g, w_h_g)
436 v_h_g = geompy.MakeVertexOnCurve(Edge_v_grd, 0.5)
437 v_b_g = geompy.MakeVertexWithRef(v_h_g, 0, 0, -h)
438
439 Edge_v_pte = geompy.MakeLineTwoPnt(x_h_p, z_h_p)
440
441 y_h_p = geompy.MakeVertexOnCurve(Edge_v_pte, 0.5)
442 y_b_p = geompy.MakeVertexWithRef(y_h_p, 0, 0, -h)
443
444
445
446
447
448
449
450
451 #=======================
452 # CREATION ASSOCIATION
453 #=======================
454
455 #===========================================
456 # association des sommets de la face du haut
457 #===========================================
458
459 # grand trou
460
461 x_mod_h_g.setAssociation( x_h_g )
462 y_mod_h_g.setAssociation( y_h_g )
463 z_mod_h_g.setAssociation( z_h_g )
464 u_mod_h_g.setAssociation( u_h_g )
465 v_mod_h_g.setAssociation( v_h_g )
466 w_mod_h_g.setAssociation( w_h_g )
467
468 x_mod_h_g_t.setAssociation( x_h_g_t )
469 y_mod_h_g_t.setAssociation( y_h_g_t )
470 z_mod_h_g_t.setAssociation( z_h_g_t )
471 u_mod_h_g_t.setAssociation( u_h_g_t )
472 v_mod_h_g_t.setAssociation( v_h_g_t )
473 w_mod_h_g_t.setAssociation( w_h_g_t )
474
475 # petit trou
476
477 x_mod_h_p.setAssociation( x_h_p )
478 y_mod_h_p.setAssociation( y_h_p )
479 z_mod_h_p.setAssociation( z_h_p )
480 u_mod_h_p.setAssociation( u_h_p )
481 v_mod_h_p.setAssociation( v_h_p )
482 w_mod_h_p.setAssociation( w_h_p )
483
484 x_mod_h_p_t.setAssociation( x_h_p_t )
485 y_mod_h_p_t.setAssociation( y_h_p_t )
486 z_mod_h_p_t.setAssociation( z_h_p_t )
487 u_mod_h_p_t.setAssociation( u_h_p_t )
488 v_mod_h_p_t.setAssociation( v_h_p_t )
489 w_mod_h_p_t.setAssociation( w_h_p_t )
490
491
492 #===========================================
493 # association des sommets de la face du bas
494 #===========================================
495
496 # grand trou
497
498 x_mod_b_g.setAssociation( x_b_g )
499 y_mod_b_g.setAssociation( y_b_g )
500 z_mod_b_g.setAssociation( z_b_g )
501 u_mod_b_g.setAssociation( u_b_g )
502 v_mod_b_g.setAssociation( v_b_g )
503 w_mod_b_g.setAssociation( w_b_g )
504
505 x_mod_b_g_t.setAssociation( x_b_g_t )
506 y_mod_b_g_t.setAssociation( y_b_g_t )
507 z_mod_b_g_t.setAssociation( z_b_g_t )
508 u_mod_b_g_t.setAssociation( u_b_g_t )
509 v_mod_b_g_t.setAssociation( v_b_g_t )
510 w_mod_b_g_t.setAssociation( w_b_g_t )
511
512 # petit trou
513
514 x_mod_b_p.setAssociation( x_b_p )
515 y_mod_b_p.setAssociation( y_b_p )
516 z_mod_b_p.setAssociation( z_b_p )
517 u_mod_b_p.setAssociation( u_b_p )
518 v_mod_b_p.setAssociation( v_b_p )
519 w_mod_b_p.setAssociation( w_b_p )
520
521 x_mod_b_p_t.setAssociation( x_b_p_t )
522 y_mod_b_p_t.setAssociation( y_b_p_t )
523 z_mod_b_p_t.setAssociation( z_b_p_t )
524 u_mod_b_p_t.setAssociation( u_b_p_t )
525 v_mod_b_p_t.setAssociation( v_b_p_t )
526 w_mod_b_p_t.setAssociation( w_b_p_t )
527
528
529
530
531 #=================================
532 # Creation association des edges
533 #=================================
534
535
536 All_Edges_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["EDGE"])
537
538 ##------------------
539 ## Arrondies du haut
540 ##------------------
541
542 #geometrie
543 Edge_Arr_grd_g_h = All_Edges_Bielle[20]
544 Edge_Arr_grd_d_h = All_Edges_Bielle[22]
545 Edge_Arr_pte_g_h = All_Edges_Bielle[8]
546 Edge_Arr_pte_d_h = All_Edges_Bielle[10]
547
548 #model
549 Edge_Arr_grd_g_h_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 1 )
550 Edge_Arr_grd_d_h_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 1 )
551 Edge_Arr_pte_g_h_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 1 )
552 Edge_Arr_pte_d_h_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 1 )
553
554
555
556 ##------------------
557 ## Arrondies du bas
558 ##------------------
559 # geometrie
560 Edge_Arr_grd_g_b = All_Edges_Bielle[19]
561 Edge_Arr_grd_d_b = All_Edges_Bielle[21]
562 Edge_Arr_pte_g_b = All_Edges_Bielle[7]
563 Edge_Arr_pte_d_b = All_Edges_Bielle[9]
564
565
566 #model
567 Edge_Arr_grd_g_b_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 0 )
568 Edge_Arr_grd_d_b_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 0 )
569 Edge_Arr_pte_g_b_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 0 )
570 Edge_Arr_pte_d_b_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 0 )
571
572
573
574 ##------------------
575 ## Grands rayons
576 ##------------------
577
578 # geometrie
579 Edge_Ray_grd_g_b = All_Edges_Bielle[27]
580 Edge_Ray_grd_g_h = All_Edges_Bielle[28]
581 Edge_Ray_grd_d_b = All_Edges_Bielle[0]
582 Edge_Ray_grd_d_h = All_Edges_Bielle[1]
583
584
585 #model
586 Edge_Grd_Ray_0_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 0 )
587 Edge_Grd_Ray_1_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 1 )
588 Edge_Grd_Ray_2_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 0 )
589 Edge_Grd_Ray_3_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 1 )
590 Edge_Grd_Ray_4_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 0 )
591 Edge_Grd_Ray_5_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 1 )
592 Edge_Grd_Ray_6_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 0 )
593 Edge_Grd_Ray_7_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 1 )
594
595
596
597
598 ##------------------
599 ## ASSOCIATIONS : arrondies du haut, arrondies du bas et grands rayons 
600 ##------------------
601
602
603 #arrondies du haut
604 Edge_Arr_grd_g_h_mod.addAssociation( Edge_Arr_grd_g_h, 0., 1. )
605 Edge_Arr_grd_g_h_mod.addAssociation( Edge_Ray_grd_g_h, u_1, 1. )#Edge_haut_grd
606
607
608 Edge_Arr_grd_d_h_mod.addAssociation( Edge_Arr_grd_d_h, 0., 1. )
609 Edge_Arr_grd_d_h_mod.addAssociation( Edge_Ray_grd_g_h, 0., u_3 )
610
611
612 Edge_Arr_pte_g_h_mod.addAssociation( Edge_Arr_pte_g_h, 0., 1. )
613 Edge_Arr_pte_g_h_mod.addAssociation( Edge_Ray_grd_d_h, 0., u_3 )
614
615
616 Edge_Arr_pte_d_h_mod.addAssociation( Edge_Arr_pte_d_h, 0., 1. )
617 Edge_Arr_pte_d_h_mod.addAssociation( Edge_Ray_grd_d_h, u_1, 1. )
618
619
620 #arrondies du bas
621 Edge_Arr_grd_g_b_mod.addAssociation( Edge_Arr_grd_g_b, 0., 1. )
622 Edge_Arr_grd_g_b_mod.addAssociation( Edge_Ray_grd_g_b, u_1, 1. )
623
624
625 Edge_Arr_grd_d_b_mod.addAssociation( Edge_Arr_grd_d_b, 0., 1. )
626 Edge_Arr_grd_d_b_mod.addAssociation( Edge_Ray_grd_g_b, 0., u_3 )
627
628
629 Edge_Arr_pte_g_b_mod.addAssociation( Edge_Arr_pte_g_b, 0., 1. )
630 Edge_Arr_pte_g_b_mod.addAssociation( Edge_Ray_grd_d_b, 0., u_3 )
631
632
633 Edge_Arr_pte_d_b_mod.addAssociation( Edge_Arr_pte_d_b, 0., 1. )
634 Edge_Arr_pte_d_b_mod.addAssociation( Edge_Ray_grd_d_b, u_1, 1. )
635
636
637 #grands rayon
638 Edge_Grd_Ray_0_mod.addAssociation( Edge_Ray_grd_d_b, u_3, u_2 )
639 Edge_Grd_Ray_1_mod.addAssociation( Edge_Ray_grd_d_h, u_3, u_2 )
640 Edge_Grd_Ray_2_mod.addAssociation( Edge_Ray_grd_d_b, u_2, u_1 )
641 Edge_Grd_Ray_3_mod.addAssociation( Edge_Ray_grd_d_h, u_2, u_1 )
642
643 Edge_Grd_Ray_4_mod.addAssociation( Edge_Ray_grd_g_b, u_2, u_1 )
644 Edge_Grd_Ray_5_mod.addAssociation( Edge_Ray_grd_g_h, u_2, u_1 )
645 Edge_Grd_Ray_6_mod.addAssociation( Edge_Ray_grd_g_b, u_3, u_2 )
646 Edge_Grd_Ray_7_mod.addAssociation( Edge_Ray_grd_g_h, u_3, u_2 )
647
648
649
650
651 # recuperer les rayons des trous de la bielle de la geometrie
652 Edge_Trou_grd_h = All_Edges_Bielle[26]
653 Edge_Trou_grd_b = All_Edges_Bielle[25]
654 Edge_Trou_pte_h = All_Edges_Bielle[3]
655 Edge_Trou_pte_b = All_Edges_Bielle[2]
656
657
658 Partition_Trou_grd_haut = geompy.MakePartition([ Edge_Trou_grd_h ], [ z_h_g_t , w_h_g_t , v_h_g_t , u_h_g_t , x_h_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
659 All_Edge_Partition_Trou_grd_haut = geompy.SubShapeAllSorted(Partition_Trou_grd_haut, geompy.ShapeType["EDGE"])
660
661 Edge_Trou_grd_h_0 = All_Edge_Partition_Trou_grd_haut[0]
662 Edge_Trou_grd_h_1 = All_Edge_Partition_Trou_grd_haut[1]
663 Edge_Trou_grd_h_2 = All_Edge_Partition_Trou_grd_haut[2]
664 Edge_Trou_grd_h_3 = All_Edge_Partition_Trou_grd_haut[3]
665 Edge_Trou_grd_h_4 = All_Edge_Partition_Trou_grd_haut[4]
666 Edge_Trou_grd_h_5 = All_Edge_Partition_Trou_grd_haut[5]
667
668
669 Edge_Trou_grd_h_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 1 )
670 Edge_Trou_grd_h_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 1 )
671 Edge_Trou_grd_h_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 1 )
672 Edge_Trou_grd_h_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 1 )
673 Edge_Trou_grd_h_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 1 )
674 Edge_Trou_grd_h_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 1 )
675
676
677 Edge_Trou_grd_h_0_mod.addAssociation( Edge_Trou_grd_h_0, 0., 1. )
678 Edge_Trou_grd_h_1_mod.addAssociation( Edge_Trou_grd_h_1, 0., 1. )
679 Edge_Trou_grd_h_2_mod.addAssociation( Edge_Trou_grd_h_2, 0., 1. )
680 Edge_Trou_grd_h_4_mod.addAssociation( Edge_Trou_grd_h_4, 0., 1. )
681 Edge_Trou_grd_h_5_mod.addAssociation( Edge_Trou_grd_h_5, 0., 1. )
682 Edge_Trou_grd_h_3_mod.addAssociation( Edge_Trou_grd_h_3, 0., 1. )
683
684
685 Partition_Trou_grd_bas = geompy.MakePartition([ Edge_Trou_grd_b ], [ z_b_g_t , w_b_g_t , v_b_g_t , u_b_g_t , x_b_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
686 All_Edge_Partition_Trou_grd_bas = geompy.SubShapeAllSorted(Partition_Trou_grd_bas, geompy.ShapeType["EDGE"])
687
688 Edge_Trou_grd_b_0 = All_Edge_Partition_Trou_grd_bas[0]
689 Edge_Trou_grd_b_1 = All_Edge_Partition_Trou_grd_bas[1]
690 Edge_Trou_grd_b_2 = All_Edge_Partition_Trou_grd_bas[2]
691 Edge_Trou_grd_b_3 = All_Edge_Partition_Trou_grd_bas[3]
692 Edge_Trou_grd_b_4 = All_Edge_Partition_Trou_grd_bas[4]
693 Edge_Trou_grd_b_5 = All_Edge_Partition_Trou_grd_bas[5]
694
695
696 Edge_Trou_grd_b_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 0 )
697 Edge_Trou_grd_b_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 0 )
698 Edge_Trou_grd_b_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 0 )
699 Edge_Trou_grd_b_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 0 )
700 Edge_Trou_grd_b_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 0 )
701 Edge_Trou_grd_b_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 0 )
702
703
704 Edge_Trou_grd_b_0_mod.addAssociation( Edge_Trou_grd_b_0, 0., 1. )
705 Edge_Trou_grd_b_1_mod.addAssociation( Edge_Trou_grd_b_1, 0., 1. )
706 Edge_Trou_grd_b_2_mod.addAssociation( Edge_Trou_grd_b_2, 0., 1. )
707 Edge_Trou_grd_b_3_mod.addAssociation( Edge_Trou_grd_b_3, 0., 1. )
708 Edge_Trou_grd_b_4_mod.addAssociation( Edge_Trou_grd_b_4, 0., 1. )
709 Edge_Trou_grd_b_5_mod.addAssociation( Edge_Trou_grd_b_5, 0., 1. )
710
711
712
713 Partition_Trou_pte_haut = geompy.MakePartition([ Edge_Trou_pte_h ], [ z_h_p_t , w_h_p_t , v_h_p_t , u_h_p_t , x_h_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
714 All_Edge_Partition_Trou_pte_haut = geompy.SubShapeAllSorted(Partition_Trou_pte_haut, geompy.ShapeType["EDGE"])
715
716 Edge_Trou_pte_h_0 = All_Edge_Partition_Trou_pte_haut[0]
717 Edge_Trou_pte_h_1 = All_Edge_Partition_Trou_pte_haut[1]
718 Edge_Trou_pte_h_2 = All_Edge_Partition_Trou_pte_haut[2]
719 Edge_Trou_pte_h_3 = All_Edge_Partition_Trou_pte_haut[3]
720 Edge_Trou_pte_h_4 = All_Edge_Partition_Trou_pte_haut[4]
721 Edge_Trou_pte_h_5 = All_Edge_Partition_Trou_pte_haut[5]
722
723
724 Edge_Trou_pte_h_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 1 )
725 Edge_Trou_pte_h_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 1 )
726 Edge_Trou_pte_h_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 1 )
727 Edge_Trou_pte_h_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 1 )
728 Edge_Trou_pte_h_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 1 )
729 Edge_Trou_pte_h_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 1 )
730
731
732 Edge_Trou_pte_h_0_mod.addAssociation( Edge_Trou_pte_h_0, 0., 1. )
733 Edge_Trou_pte_h_1_mod.addAssociation( Edge_Trou_pte_h_1, 0., 1. )
734 Edge_Trou_pte_h_2_mod.addAssociation( Edge_Trou_pte_h_2, 0., 1. )
735 Edge_Trou_pte_h_3_mod.addAssociation( Edge_Trou_pte_h_3, 0., 1. )
736 Edge_Trou_pte_h_4_mod.addAssociation( Edge_Trou_pte_h_4, 0., 1. )
737 Edge_Trou_pte_h_5_mod.addAssociation( Edge_Trou_pte_h_5, 0., 1. )
738
739
740 Partition_Trou_pte_bas = geompy.MakePartition([ Edge_Trou_pte_b ], [ z_b_p_t , w_b_p_t , v_b_p_t , u_b_p_t , x_b_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
741 All_Edge_Partition_Trou_pte_bas = geompy.SubShapeAllSorted(Partition_Trou_pte_bas, geompy.ShapeType["EDGE"])
742
743
744 Edge_Trou_pte_b_0 = All_Edge_Partition_Trou_pte_bas[0]
745 Edge_Trou_pte_b_1 = All_Edge_Partition_Trou_pte_bas[1]
746 Edge_Trou_pte_b_2 = All_Edge_Partition_Trou_pte_bas[2]
747 Edge_Trou_pte_b_3 = All_Edge_Partition_Trou_pte_bas[3]
748 Edge_Trou_pte_b_4 = All_Edge_Partition_Trou_pte_bas[4]
749 Edge_Trou_pte_b_5 = All_Edge_Partition_Trou_pte_bas[5]
750
751
752 Edge_Trou_pte_b_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 0 )
753 Edge_Trou_pte_b_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 0 )
754 Edge_Trou_pte_b_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 0 )
755 Edge_Trou_pte_b_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 0 )
756 Edge_Trou_pte_b_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 0 )
757 Edge_Trou_pte_b_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 0 )
758
759 Edge_Trou_pte_b_0_mod.addAssociation( Edge_Trou_pte_b_0, 0., 1. )
760 Edge_Trou_pte_b_1_mod.addAssociation( Edge_Trou_pte_b_1, 0., 1. )
761 Edge_Trou_pte_b_2_mod.addAssociation( Edge_Trou_pte_b_2, 0., 1. )
762 Edge_Trou_pte_b_3_mod.addAssociation( Edge_Trou_pte_b_3, 0., 1. )
763 Edge_Trou_pte_b_4_mod.addAssociation( Edge_Trou_pte_b_4, 0., 1. )
764 Edge_Trou_pte_b_5_mod.addAssociation( Edge_Trou_pte_b_5, 0., 1. )
765
766
767
768 #====================================
769 # CREATION DES FACES DES ARRONDIES
770 #====================================
771 All_Face_Arron_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["FACE"])
772
773 Face_Arron_1 = All_Face_Arron_Bielle[2]
774 Face_Arron_2 = All_Face_Arron_Bielle[3]
775 Face_Arron_3 = All_Face_Arron_Bielle[8]
776 Face_Arron_4 = All_Face_Arron_Bielle[9]
777
778 Quad_Arron_1 = grille_cyl_pte.getQuadJK( 1 , 1 , 0 )
779 Quad_Arron_2 = grille_cyl_pte.getQuadJK( 1 , 4 , 0 )
780 Quad_Arron_3 = grille_cyl_grd.getQuadJK( 1 , 1 , 0 )
781 Quad_Arron_4 = grille_cyl_grd.getQuadJK( 1 , 4 , 0 )
782
783
784
785 #=================================================
786 # VERTEX, EDGES, FACES DANS L'ARBRE D'ETUDE SALOME
787 #=================================================
788
789 geompy.addToStudy( y_h_g , "y_h_g" )
790 geompy.addToStudy( y_b_g , "y_b_g" )
791 geompy.addToStudy( v_h_p , "v_h_p" )
792 geompy.addToStudy( v_b_p , "v_b_p" )
793 geompy.addToStudy( x_h_g , "x_h_g" )
794 geompy.addToStudy( x_b_g , "x_b_g" )
795 geompy.addToStudy( z_h_g , "z_h_g" )
796 geompy.addToStudy( z_b_g , "z_b_g" )
797 geompy.addToStudy( w_h_p , "w_h_p" )
798 geompy.addToStudy( w_b_p , "w_b_p" )
799 geompy.addToStudy( u_h_p , "u_h_p" )
800 geompy.addToStudy( u_b_p , "u_b_p" )
801 geompy.addToStudy(y_h_g_t, "y_h_g_t")
802 geompy.addToStudy(y_b_g_t, "y_b_g_t")
803 geompy.addToStudy(z_h_g_t, "z_h_g_t")
804 geompy.addToStudy(z_b_g_t, "z_b_g_t")
805 geompy.addToStudy(w_h_g_t, "w_h_g_t")
806 geompy.addToStudy(w_b_g_t, "w_b_g_t")
807 geompy.addToStudy(v_h_g_t, "v_h_g_t")
808 geompy.addToStudy(v_b_g_t, "v_b_g_t")
809 geompy.addToStudy(u_h_g_t, "u_h_g_t")
810 geompy.addToStudy(u_b_g_t, "u_b_g_t")
811 geompy.addToStudy(x_h_g_t, "x_h_g_t")
812 geompy.addToStudy(x_b_g_t, "x_b_g_t")
813 geompy.addToStudy(y_h_p_t, "y_h_p_t")
814 geompy.addToStudy(y_b_p_t, "y_b_p_t")
815 geompy.addToStudy(z_h_p_t, "z_h_p_t")
816 geompy.addToStudy(z_b_p_t, "z_b_p_t")
817 geompy.addToStudy(w_h_p_t, "w_h_p_t")
818 geompy.addToStudy(w_b_p_t, "w_b_p_t")
819 geompy.addToStudy(v_h_p_t, "v_h_p_t")
820 geompy.addToStudy(v_b_p_t, "v_b_p_t")
821 geompy.addToStudy(u_h_p_t, "u_h_p_t")
822 geompy.addToStudy(u_b_p_t, "u_b_p_t")
823 geompy.addToStudy(x_b_p_t, "x_b_p_t")
824 geompy.addToStudy(u_h_g, "u_h_g")
825 geompy.addToStudy(u_b_g, "u_b_g")
826 geompy.addToStudy(x_h_p, "x_h_p")
827 geompy.addToStudy(x_b_p, "x_b_p")
828 geompy.addToStudy(w_h_g, "w_h_g")
829 geompy.addToStudy(w_b_g, "w_b_g")
830 geompy.addToStudy(z_h_p, "z_h_p")
831 geompy.addToStudy(z_b_p, "z_b_p")
832 geompy.addToStudy(v_h_g, "v_h_g")
833 geompy.addToStudy(v_b_g, "v_b_g")
834 geompy.addToStudy(y_h_p, "y_h_p")
835 geompy.addToStudy(y_b_p, "y_b_p")
836
837
838 geompy.addToStudy( Edge_Trou_grd_h , "Edge_Trou_grd_h" )
839 geompy.addToStudy( Edge_Trou_grd_b , "Edge_Trou_grd_b" )
840 geompy.addToStudy( Edge_Trou_pte_h , "Edge_Trou_pte_h" )
841 geompy.addToStudy( Edge_Trou_pte_b , "Edge_Trou_pte_b" )
842 geompy.addToStudy( Edge_Trou_grd_h_0 , "Edge_Trou_grd_h_0" )
843 geompy.addToStudy( Edge_Trou_grd_h_2 , "Edge_Trou_grd_h_2" )
844 geompy.addToStudy( Edge_Trou_grd_h_4 , "Edge_Trou_grd_h_4" )
845 geompy.addToStudy( Edge_Trou_grd_h_5 , "Edge_Trou_grd_h_5" )
846 geompy.addToStudy( Edge_Trou_grd_h_3 , "Edge_Trou_grd_h_3" )
847 geompy.addToStudy( Edge_Trou_grd_h_1 , "Edge_Trou_grd_h_1" )
848 geompy.addToStudy( Edge_Trou_grd_b_0 , "Edge_Trou_grd_b_0" )
849 geompy.addToStudy( Edge_Trou_grd_b_2 , "Edge_Trou_grd_b_2" )
850 geompy.addToStudy( Edge_Trou_grd_b_4 , "Edge_Trou_grd_b_4" )
851 geompy.addToStudy( Edge_Trou_grd_b_5 , "Edge_Trou_grd_b_5" )
852 geompy.addToStudy( Edge_Trou_grd_b_3 , "Edge_Trou_grd_b_3" )
853 geompy.addToStudy( Edge_Trou_grd_b_1 , "Edge_Trou_grd_b_1" )
854 geompy.addToStudy( Edge_Trou_pte_h_0 , "Edge_Trou_pte_h_0" )
855 geompy.addToStudy( Edge_Trou_pte_h_2 , "Edge_Trou_pte_h_2" )
856 geompy.addToStudy( Edge_Trou_pte_h_4 , "Edge_Trou_pte_h_4" )
857 geompy.addToStudy( Edge_Trou_pte_h_5 , "Edge_Trou_pte_h_5" )
858 geompy.addToStudy( Edge_Trou_pte_h_3 , "Edge_Trou_pte_h_3" )
859 geompy.addToStudy( Edge_Trou_pte_h_1 , "Edge_Trou_pte_h_1" )
860 geompy.addToStudy( Edge_Trou_pte_b_0 , "Edge_Trou_pte_b_0" )
861 geompy.addToStudy( Edge_Trou_pte_b_2 , "Edge_Trou_pte_b_2" )
862 geompy.addToStudy( Edge_Trou_pte_b_4 , "Edge_Trou_pte_b_4" )
863 geompy.addToStudy( Edge_Trou_pte_b_5 , "Edge_Trou_pte_b_5" )
864 geompy.addToStudy( Edge_Trou_pte_b_3 , "Edge_Trou_pte_b_3" )
865 geompy.addToStudy( Edge_Trou_pte_b_1 , "Edge_Trou_pte_b_1" )
866
867 geompy.addToStudy( Edge_Arr_grd_g_h , "Edge_Arr_grd_g_h" )
868 geompy.addToStudy( Edge_Arr_grd_d_h , "Edge_Arr_grd_d_h" )
869 geompy.addToStudy( Edge_Arr_pte_g_h , "Edge_Arr_pte_g_h" )
870 geompy.addToStudy( Edge_Arr_pte_d_h , "Edge_Arr_pte_d_h" )
871
872 geompy.addToStudy( Edge_Arr_grd_g_b , "Edge_Arr_grd_g_b" )
873 geompy.addToStudy( Edge_Arr_grd_d_b , "Edge_Arr_grd_d_b" )
874 geompy.addToStudy( Edge_Arr_pte_g_b , "Edge_Arr_pte_g_b" )
875 geompy.addToStudy( Edge_Arr_pte_d_b , "Edge_Arr_pte_d_b" )
876
877 geompy.addToStudy( Edge_Ray_grd_g_h , "Edge_Ray_grd_g_h" )
878 geompy.addToStudy( Edge_Ray_grd_d_h , "Edge_Ray_grd_d_h" )
879 geompy.addToStudy( Edge_Ray_grd_g_b , "Edge_Ray_grd_g_b" )
880 geompy.addToStudy( Edge_Ray_grd_d_b , "Edge_Ray_grd_d_b" )
881
882
883 geompy.addToStudy(Face_Arron_1, "Face_Arron_1")
884 geompy.addToStudy(Face_Arron_2, "Face_Arron_2")
885 geompy.addToStudy(Face_Arron_3, "Face_Arron_3")
886 geompy.addToStudy(Face_Arron_4, "Face_Arron_4")
887
888
889 geompy.addToStudy( Partition_Trou_grd_haut , "Partition_Trou_grd_haut" )
890 geompy.addToStudy( Partition_Trou_grd_bas ,  "Partition_Trou_grd_bas" )
891 geompy.addToStudy( Partition_Trou_pte_haut , "Partition_Trou_pte_haut" )
892 geompy.addToStudy( Partition_Trou_pte_bas ,  "Partition_Trou_pte_bas" )
893
894
895
896 #====================================
897 # CREATION MAILLAGE
898 #====================================
899
900
901 #=================================================
902 # Definir les groupes d elements pour le maillage
903 #=================================================
904
905 # On definit 3 groupes de mailles
906
907 # groupe d edges (arretes)
908
909 Edge_grp = doc.addEdgeGroup("Edge_grp")
910 Nbr_Edg = doc.countEdge()
911 #print Nbr_Edg
912 for i in range(Nbr_Edg):
913     Edge_i = doc.getEdge(i)
914     Edge_grp.addElement(Edge_i)
915
916
917 # groupe de quads (faces)
918 Quad_grp = doc.addQuadGroup("Quad_grp")
919 Nbr_Qad = doc.countQuad()
920 #print Nbr_Qad
921 for i in range(Nbr_Qad):
922     Quad_i = doc.getQuad(i)
923     Quad_grp.addElement(Quad_i)
924
925 # groupe d hexas (solids)
926 Hexa_grp = doc.addHexaGroup("Hexa_grp")
927 Nbr_Hex = doc.countHexa()
928 #print Nbr_Hex
929 for i in range(Nbr_Hex):
930     Hexa_i = doc.getHexa(i)
931     Hexa_grp.addElement(Hexa_i)
932
933
934
935 # groupe de noeuds de vertex pour tout le modele 
936 Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
937 Nbr_Vx = doc.countVertex()
938 #print Nbr_Vx
939
940 for i in range(Nbr_Vx):
941     Vertex_i = doc.getVertex(i)
942     Vertex_Nod_Grp.addElement(Vertex_i)
943
944 #====================================
945 # Definir une loi de discretisation
946 #====================================
947 # definir une loi: le choix de la loi reste aux utilisateurs
948 Law = doc.addLaw( "Uniform" , 4 )
949
950 #n = doc.countLaw()
951 #print n
952
953 # chercher les propagations du modele
954 N_Propa = doc.countPropagation()
955
956 for j in range(N_Propa):
957     Propa = doc.getPropagation(j)
958     Propa.setLaw( Law )# appliquer la loi de discretisation sur tout le modele et generer le maillage
959
960 #====================================
961 # Générer des maillages
962 #====================================
963
964 print(" --- MAILLAGE HEXAHEDRIQUE --- ")
965 mesh_hexas = hexablock.mesh(doc, "Bielle:hexas")
966
967 print(("Nombre d hexaedres:"   , mesh_hexas.NbHexas()))
968 print(("Nombre de quadrangles:", mesh_hexas.NbQuadrangles()))
969 print(("Nombre de segments:"   , mesh_hexas.NbEdges()))
970 print(("Nombre de noeuds:"     , mesh_hexas.NbNodes()))
971
972 print(" --- MAILLAGE QUADRANGULAIRE --- ")
973 mesh_quads = hexablock.mesh(doc, "Bielle:quads", 2)
974
975 print(("Nombre d hexaedres:"   , mesh_quads.NbHexas()))
976 print(("Nombre de quadrangles:", mesh_quads.NbQuadrangles()))
977 print(("Nombre de segments:"   , mesh_quads.NbEdges()))
978 print(("Nombre de noeuds:"     , mesh_quads.NbNodes()))
979
980 print(" --- MAILLAGE 1D --- ")
981 mesh_edges = hexablock.mesh(doc, "Bielle:edges", 1)
982
983 print(("Nombre d hexaedres:"   , mesh_edges.NbHexas()))
984 print(("Nombre de quadrangles:", mesh_edges.NbQuadrangles()))
985 print(("Nombre de segments:"   , mesh_edges.NbEdges()))
986 print(("Nombre de noeuds:"     , mesh_edges.NbNodes()))
987
988 print(" --- MAILLAGE des sommets --- ")
989 mesh_nodes = hexablock.mesh(doc, "Bielle:nodes", 0)
990
991 print(("Nombre d hexaedres:"   , mesh_nodes.NbHexas()))
992 print(("Nombre de quadrangles:", mesh_nodes.NbQuadrangles()))
993 print(("Nombre de segments:"   , mesh_nodes.NbEdges()))
994 print(("Nombre de noeuds:"     , mesh_nodes.NbNodes()))