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 barier = geompy.MakeCylinder(
42 geom.MakePointStruct(0.,0.,0.),
43 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
49 colis = geompy.MakeCylinder(
50 geom.MakePointStruct(0.,0.,0.),
51 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
55 cc = geompy.MakeCylinder(
56 geom.MakePointStruct(0.,0.,0.),
57 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
61 colis_cc = geompy.MakeCompound(
62 [colis._get_Name(), cc._get_Name()])
64 colis_cc = geompy.MakeTranslation(
65 colis_cc, colis_center, 0.0, 0.0)
67 colis_cc_multi = geompy.MakeMultiRotation1D(
69 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
70 geom.MakePointStruct(0.,0.,0.),
75 alveole = geompy.Partition(
76 [colis_cc_multi._get_Name(), barier._get_Name()])
78 subshapes = geompy.SubShapeAll( alveole, geompy.ShapeType["SHAPE"] )
80 ## there are 9 subshapes
82 comp1 = geompy.MakeCompound( [ subshapes[0]._get_Name(), subshapes[1]._get_Name() ] );
83 comp2 = geompy.MakeCompound( [ subshapes[2]._get_Name(), subshapes[3]._get_Name() ] );
84 comp3 = geompy.MakeCompound( [ subshapes[4]._get_Name(), subshapes[5]._get_Name() ] );
85 comp4 = geompy.MakeCompound( [ subshapes[6]._get_Name(), subshapes[7]._get_Name() ] );
88 compIORs.append( comp1._get_Name() );
89 compIORs.append( comp2._get_Name() );
90 compIORs.append( comp3._get_Name() );
91 compIORs.append( comp4._get_Name() );
92 comp = geompy.MakeCompound( compIORs );
94 alveole = geompy.MakeCompound( [ comp._get_Name(), subshapes[8]._get_Name() ]);
96 geompy.addToStudy(alveole, "alveole")