Salome HOME
IPAL8796: delete the files in tmp dir after import
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition2.py
1 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
2 #
3 #  Copyright (C) 2003  CEA/DEN, EDF R&D
4 #
5 #
6 #
7 #  File   : GEOM_Partition2.py
8 #  Module : GEOM
9
10 #%Make geometry (like CEA script (A2)) using Partition algorithm%
11 # import callovo_01_GEOM
12 # reload(callovo_01_GEOM)
13
14
15 # --------------------------------------------
16 # Geometrie avec une galerie perpendiculaire
17 # --------------------------------------------
18
19 import geompy
20 geom = geompy.geom
21
22 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
23 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
24
25 # -- colis
26
27 colis_xmin = 05.76
28 colis_xmax = 19.83
29 colis_radius = 0.3
30
31 colis = geompy.MakeCylinder(
32     geompy.MakeVertex(colis_xmin,0.,0.),
33     vecx,
34     colis_radius,
35     colis_xmax-colis_xmin)
36
37 # -- bo
38
39 bo_xmin = 04.83
40 bo_xmax = colis_xmax
41 bo_radius = 1.23
42
43 bo = geompy.MakeCylinder(
44     geompy.MakeVertex(bo_xmin,0.,0.),
45     vecx,
46     bo_radius,
47     bo_xmax-bo_xmin)
48
49
50 # -- rupture alveole
51
52 alvRup_xmin = 04.46
53 alvRup_xmax = colis_xmax
54 alvRup_radius = 1.6
55
56 alvRup = geompy.MakeCylinder(
57     geompy.MakeVertex(alvRup_xmin,0.,0.),
58     vecx,
59     alvRup_radius,
60     alvRup_xmax-alvRup_xmin)
61
62
63 # bouchon
64
65 bouchon_xmin = colis_xmax
66 bouchon_xmax = 22.83
67 bouchon_radius = alvRup_radius
68
69 bouchon = geompy.MakeCylinder(
70     geompy.MakeVertex(bouchon_xmin,0.,0.),
71     vecx,
72     bouchon_radius,
73     bouchon_xmax-bouchon_xmin)
74
75 # galerie
76
77 galerie_xmax = 25.0
78 galerie_radius = 3.0
79 box_y = 30.0
80
81 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
82
83 galerie = geompy.MakeCylinder(
84     pnt_galerie_xmax,
85     vecy,
86     galerie_radius,
87     box_y)
88 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
89
90 # -- box
91
92 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
93 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
94
95
96 # -- rupture galerie
97
98 galRup_xmax = galerie_xmax
99 galRup_radius = 3.9
100
101 galRup = geompy.MakeCylinder(
102     pnt_galerie_xmax,
103     vecy,
104     galRup_radius,
105     box_y)
106 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
107
108 # -- endommagement galerie
109
110 galEnd_xmax = galerie_xmax
111 galEnd_radius = 4.6
112
113 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
114 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
115
116 # -- endommagement alveole
117
118 alvEnd_xmin = 03.6
119 alvEnd_xmax = galerie_xmax
120 alvEnd_radius = 2.46
121
122 alvEnd = geompy.MakeCylinder(
123     geompy.MakeVertex(alvEnd_xmin,0.,0.),
124     vecx,
125     alvEnd_radius,
126     alvEnd_xmax-alvEnd_xmin)
127
128 # remove internal parts of galEnd intersecting alvEnd
129
130 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
131
132 GOList =  [colis]
133 GOList += [bo]
134 GOList += [alvRup]
135 #GOList += [galerie ]
136 GOList += [galRup]
137 GOList += [galEnd_alvEnd]
138
139 # --
140
141 # remove section parts outside bo and inside bouchon
142
143 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
144
145 geompy.addToStudy(callovo, "callovo perp. 2")