1 #%Make geometry (like CEA script (A1)) using Partition algorithm%
3 # import alveole_3D_01_GEOM
4 # reload(alveole_3D_01_GEOM)
6 # -- Rayon de la bariere
9 barier_radius = 5.6 / 2 # Rayon de la bariere
10 colis_radius = 1.0 / 2 # Rayon du colis
11 colis_step = 2.0 # Distance s
\89parant deux colis
12 cc_width = 0.11 # Epaisseur du complement de colisage
16 cc_radius = colis_radius + cc_width
18 colis_center = sqrt(2.0)*colis_step/2
32 barier = geompy.MakeCylinder(
33 geom.MakePointStruct(0.,0.,0.),
34 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
40 colis = geompy.MakeCylinder(
41 geom.MakePointStruct(0.,0.,0.),
42 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
46 cc = geompy.MakeCylinder(
47 geom.MakePointStruct(0.,0.,0.),
48 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
52 colis_cc = geompy.MakeCompound(
53 [colis._get_Name(), cc._get_Name()])
55 colis_cc = geompy.MakeTranslation(
56 colis_cc, colis_center, 0.0, 0.0)
58 colis_cc_multi = geompy.MakeMultiRotation1D(
60 geom.MakeDirection(geom.MakePointStruct(0.,0.,1.)),
61 geom.MakePointStruct(0.,0.,0.),
66 alveole = geompy.Partition(
67 [colis_cc_multi._get_Name(), barier._get_Name()])
69 subshapes = geompy.SubShapeAll( alveole, geompy.ShapeType["SHAPE"] )
71 ## there are 9 subshapes
73 comp1 = geompy.MakeCompound( [ subshapes[0]._get_Name(), subshapes[1]._get_Name() ] );
74 comp2 = geompy.MakeCompound( [ subshapes[2]._get_Name(), subshapes[3]._get_Name() ] );
75 comp3 = geompy.MakeCompound( [ subshapes[4]._get_Name(), subshapes[5]._get_Name() ] );
76 comp4 = geompy.MakeCompound( [ subshapes[6]._get_Name(), subshapes[7]._get_Name() ] );
79 compIORs.append( comp1._get_Name() );
80 compIORs.append( comp2._get_Name() );
81 compIORs.append( comp3._get_Name() );
82 compIORs.append( comp4._get_Name() );
83 comp = geompy.MakeCompound( compIORs );
85 alveole = geompy.MakeCompound( [ comp._get_Name(), subshapes[8]._get_Name() ]);
87 geompy.addToStudy(alveole, "alveole")