1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 CEA/DEN, EDF R&D
7 # File : GEOM_Partition2.py
10 #%Make geometry (like CEA script (A2)) using Partition algorithm%
11 # import callovo_01_GEOM
12 # reload(callovo_01_GEOM)
15 # --------------------------------------------
16 # Geometrie avec une galerie perpendiculaire
17 # --------------------------------------------
28 colis = geompy.MakeCylinder(
29 geom.MakePointStruct(colis_xmin,0.,0.),
30 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
32 colis_xmax-colis_xmin)
40 bo = geompy.MakeCylinder(
41 geom.MakePointStruct(bo_xmin,0.,0.),
42 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
50 alvRup_xmax = colis_xmax
53 alvRup = geompy.MakeCylinder(
54 geom.MakePointStruct(alvRup_xmin,0.,0.),
55 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
57 alvRup_xmax-alvRup_xmin)
62 bouchon_xmin = colis_xmax
64 bouchon_radius = alvRup_radius
66 bouchon = geompy.MakeCylinder(
67 geom.MakePointStruct(bouchon_xmin,0.,0.),
68 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
70 bouchon_xmax-bouchon_xmin)
78 galerie = geompy.MakeCylinder(
79 geom.MakePointStruct(galerie_xmax,0.,0.),
80 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
83 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
87 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
88 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
93 galRup_xmax = galerie_xmax
96 galRup = geompy.MakeCylinder(
97 geom.MakePointStruct(galerie_xmax,0.,0.),
98 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
101 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
103 # -- endommagement galerie
105 galEnd_xmax = galerie_xmax
108 galEnd = geompy.MakeCylinder(
109 geom.MakePointStruct(galerie_xmax,0.,0.),
110 geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
113 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
115 # -- endommagement alveole
118 alvEnd_xmax = galerie_xmax
121 alvEnd = geompy.MakeCylinder(
122 geom.MakePointStruct(alvEnd_xmin,0.,0.),
123 geom.MakeDirection(geom.MakePointStruct(1.,0.,0.)),
125 alvEnd_xmax-alvEnd_xmin)
127 # remove internal parts of galEnd intersecting alvEnd
129 galEnd_alvEnd = geompy.Partition(
130 [ alvEnd._get_Name() ] , [], [], [ galEnd._get_Name() ] )
132 iorL = [ colis._get_Name() ]
133 iorL += [ bo._get_Name() ]
134 iorL += [ alvRup._get_Name() ]
135 #iorL += [ galerie._get_Name() ]
136 iorL += [ galRup._get_Name() ]
137 iorL += [ galEnd_alvEnd._get_Name() ]
141 # remove section parts outside bo and inside bouchon
143 callovo = geompy.Partition(
144 iorL, [], [ box._get_Name() ], [galerie._get_Name(), bouchon._get_Name()] )
148 geompy.addToStudy(callovo, "callovo perp. 2")