1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 CEA/DEN, EDF R&D
7 # File : GEOM_Partition1.py
10 #%Make geometry (like CEA script (A1)) using Partition algorithm%
12 # import alveole_3D_01_GEOM
13 # reload(alveole_3D_01_GEOM)
15 # -- Rayon de la bariere
18 barier_radius = 5.6 / 2 # Rayon de la bariere
19 colis_radius = 1.0 / 2 # Rayon du colis
20 colis_step = 2.0 # Distance s
\89parant deux colis
21 cc_width = 0.11 # Epaisseur du complement de colisage
25 cc_radius = colis_radius + cc_width
27 colis_center = sqrt(2.0)*colis_step/2
41 pnt0 = geompy.MakeVertex(0.,0.,0.)
42 vecz = geompy.MakeVectorDXDYDZ(0.,0.,1.)
44 barier = geompy.MakeCylinder(
52 colis = geompy.MakeCylinder(pnt0, vecz, colis_radius, barier_height)
54 cc = geompy.MakeCylinder(pnt0, vecz, cc_radius, barier_height)
56 colis_cc = geompy.MakeCompound([colis, cc])
58 colis_cc = geompy.MakeTranslation(colis_cc, colis_center, 0.0, 0.0)
60 colis_cc_multi = geompy.MultiRotate1D(colis_cc, vecz, 4)
64 alveole = geompy.MakePartition([colis_cc_multi, barier])
66 geompy.addToStudy(alveole, "alveole before explode")
68 subshapes = geompy.SubShapeAll(alveole, geompy.ShapeType["SHAPE"])
70 ## there are 9 subshapes
72 comp1 = geompy.MakeCompound([subshapes[0], subshapes[1]]);
73 comp2 = geompy.MakeCompound([subshapes[2], subshapes[3]]);
74 comp3 = geompy.MakeCompound([subshapes[4], subshapes[5]]);
75 comp4 = geompy.MakeCompound([subshapes[6], subshapes[7]]);
78 compGOs.append(comp1);
79 compGOs.append(comp2);
80 compGOs.append(comp3);
81 compGOs.append(comp4);
82 comp = geompy.MakeCompound(compGOs);
84 alveole = geompy.MakeCompound([comp, subshapes[8]]);
86 geompy.addToStudy(alveole, "alveole")