Salome HOME
bba0114672cdfe9be5bbc8cfd0dc556f3499821d
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition3.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 #  GEOM GEOM_SWIG : binding of C++ implementation with Python
25 #  File   : GEOM_Partition3.py
26 #  Module : GEOM
27 # import callovo_01_GEOM
28 # reload(callovo_01_GEOM)
29 #
30 import salome
31 salome.salome_init()
32 import GEOM
33 from salome.geom import geomBuilder
34 geompy = geomBuilder.New()
35
36 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
37
38 # -- colis
39
40 colis_xmin = 05.76
41 colis_xmax = 19.83
42 colis_radius = 0.3
43
44 colis = geompy.MakeCylinder(
45     geompy.MakeVertex(colis_xmin,0.,0.),
46     vecx,
47     colis_radius,
48     colis_xmax-colis_xmin)
49
50 GOList = [colis]
51
52 # -- bo
53
54 bo_xmin = 04.83
55 bo_xmax = colis_xmax
56 bo_radius = 1.23
57
58 bo = geompy.MakeCylinder(
59     geompy.MakeVertex(bo_xmin,0.,0.),
60     vecx,
61     bo_radius,
62     bo_xmax-bo_xmin)
63
64 GOList.append(bo)
65
66 # -- rupture alveole
67
68 alvRup_xmin = 04.46
69 alvRup_xmax = colis_xmax
70 alvRup_radius = 1.6
71
72 alvRup = geompy.MakeCylinder(
73     geompy.MakeVertex(alvRup_xmin,0.,0.),
74     vecx,
75     alvRup_radius,
76     alvRup_xmax-alvRup_xmin)
77
78 GOList.append(alvRup)
79
80 # bouchon
81
82 bouchon_xmin = colis_xmax
83 bouchon_xmax = 22.83
84 bouchon_radius = alvRup_radius
85
86 bouchon = geompy.MakeCylinder(
87     geompy.MakeVertex(bouchon_xmin,0.,0.),
88     vecx,
89     bouchon_radius,
90     bouchon_xmax-bouchon_xmin)
91
92 #GOList.append(bouchon)
93
94 # -- endommagement alveole
95
96 alvEnd_xmin = 03.6
97 alvEnd_xmax = 20.66
98 alvEnd_radius = 2.46
99
100 alvEnd = geompy.MakeCylinder(
101     geompy.MakeVertex(alvEnd_xmin,0.,0.),
102     vecx,
103     alvEnd_radius,
104     alvEnd_xmax-alvEnd_xmin)
105
106 GOList.append(alvEnd)
107
108 # galerie
109
110 galerie_xmin = bouchon_xmax
111 galerie_xmax = 25.0
112 galerie_radius = 2.17
113
114 galerie = geompy.MakeCylinder(
115     geompy.MakeVertex(galerie_xmin,0.,0.),
116     vecx,
117     galerie_radius,
118     galerie_xmax-galerie_xmin)
119
120 GOList.append(galerie)
121
122 # -- rupture galerie
123
124 galRup_xmin = 22.18
125 galRup_xmax = galerie_xmax
126 galRup_radius = 2.82
127
128 galRup = geompy.MakeCylinder(
129     geompy.MakeVertex(galRup_xmin,0.,0.),
130     vecx,
131     galRup_radius,
132     galRup_xmax-galRup_xmin)
133
134 GOList.append(galRup)
135
136 # -- endom. galerie
137
138 galEnd_xmin = alvEnd_xmax
139 galEnd_xmax = galerie_xmax
140 galEnd_radius = 4.34
141
142 galEnd = geompy.MakeCylinder(
143     geompy.MakeVertex(galEnd_xmin,0.,0.),
144     vecx,
145     galEnd_radius,
146     galEnd_xmax-galEnd_xmin)
147
148 GOList.append(galEnd)
149
150 # --
151
152 box_y = 30.0
153 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
154 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
155
156 GOList.append(box)
157
158 # --
159
160 callovo = geompy.MakePartition(GOList, [], [], [bouchon])
161 geompy.addToStudy(callovo, "callovo 2")