1 #%Make geometry (like CEA script (A2)) using Partition algorithm%
2 # import callovo_01_GEOM
3 # reload(callovo_01_GEOM)
6 # --------------------------------------------
7 # Geometrie avec une galerie perpendiculaire
8 # --------------------------------------------
19 colis = geompy.MakeCylinder(
20 geom.MakePointStruct(colis_xmin,0.,0.),
21 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
23 colis_xmax-colis_xmin)
31 bo = geompy.MakeCylinder(
32 geom.MakePointStruct(bo_xmin,0.,0.),
33 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
41 alvRup_xmax = colis_xmax
44 alvRup = geompy.MakeCylinder(
45 geom.MakePointStruct(alvRup_xmin,0.,0.),
46 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
48 alvRup_xmax-alvRup_xmin)
53 bouchon_xmin = colis_xmax
55 bouchon_radius = alvRup_radius
57 bouchon = geompy.MakeCylinder(
58 geom.MakePointStruct(bouchon_xmin,0.,0.),
59 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
61 bouchon_xmax-bouchon_xmin)
69 galerie = geompy.MakeCylinder(
70 geom.MakePointStruct(galerie_xmax,0.,0.),
71 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
74 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
78 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
79 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
84 galRup_xmax = galerie_xmax
87 galRup = geompy.MakeCylinder(
88 geom.MakePointStruct(galerie_xmax,0.,0.),
89 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
92 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
94 # -- endommagement galerie
96 galEnd_xmax = galerie_xmax
99 galEnd = geompy.MakeCylinder(
100 geom.MakePointStruct(galerie_xmax,0.,0.),
101 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
104 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
106 # -- endommagement alveole
109 alvEnd_xmax = galerie_xmax
112 alvEnd = geompy.MakeCylinder(
113 geom.MakePointStruct(alvEnd_xmin,0.,0.),
114 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
116 alvEnd_xmax-alvEnd_xmin)
118 # remove internal parts of galEnd intersecting alvEnd
120 galEnd_alvEnd = geompy.Partition(
121 [ alvEnd._get_Name() ] , [], [], [ galEnd._get_Name() ] )
123 iorL = [ colis._get_Name() ]
124 iorL += [ bo._get_Name() ]
125 iorL += [ alvRup._get_Name() ]
126 #iorL += [ galerie._get_Name() ]
127 iorL += [ galRup._get_Name() ]
128 iorL += [ galEnd_alvEnd._get_Name() ]
132 # remove section parts outside bo and inside bouchon
134 callovo = geompy.Partition(
135 iorL, [], [ box._get_Name() ], [galerie._get_Name(), bouchon._get_Name()] )
139 geompy.addToStudy(callovo, "callovo perp. 2")