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