Salome HOME
IPAL21297: errors for Netgen_1D_2D
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition3.py
1 #  -*- coding: iso-8859-1 -*-
2 #  Copyright (C) 2007-2008  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.
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 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
24 #  File   : GEOM_Partition3.py
25 #  Module : GEOM
26 # import callovo_01_GEOM
27 # reload(callovo_01_GEOM)
28 #
29 import geompy
30 geom = geompy.geom
31
32 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
33
34 # -- colis
35
36 colis_xmin = 05.76
37 colis_xmax = 19.83
38 colis_radius = 0.3
39
40 colis = geompy.MakeCylinder(
41     geompy.MakeVertex(colis_xmin,0.,0.),
42     vecx,
43     colis_radius,
44     colis_xmax-colis_xmin)
45
46 GOList = [colis]
47
48 # -- bo
49
50 bo_xmin = 04.83
51 bo_xmax = colis_xmax
52 bo_radius = 1.23
53
54 bo = geompy.MakeCylinder(
55     geompy.MakeVertex(bo_xmin,0.,0.),
56     vecx,
57     bo_radius,
58     bo_xmax-bo_xmin)
59
60 GOList.append(bo)
61
62 # -- rupture alveole
63
64 alvRup_xmin = 04.46
65 alvRup_xmax = colis_xmax
66 alvRup_radius = 1.6
67
68 alvRup = geompy.MakeCylinder(
69     geompy.MakeVertex(alvRup_xmin,0.,0.),
70     vecx,
71     alvRup_radius,
72     alvRup_xmax-alvRup_xmin)
73
74 GOList.append(alvRup)
75
76 # bouchon
77
78 bouchon_xmin = colis_xmax
79 bouchon_xmax = 22.83
80 bouchon_radius = alvRup_radius
81
82 bouchon = geompy.MakeCylinder(
83     geompy.MakeVertex(bouchon_xmin,0.,0.),
84     vecx,
85     bouchon_radius,
86     bouchon_xmax-bouchon_xmin)
87
88 #GOList.append(bouchon)
89
90 # -- endommagement alveole
91
92 alvEnd_xmin = 03.6
93 alvEnd_xmax = 20.66
94 alvEnd_radius = 2.46
95
96 alvEnd = geompy.MakeCylinder(
97     geompy.MakeVertex(alvEnd_xmin,0.,0.),
98     vecx,
99     alvEnd_radius,
100     alvEnd_xmax-alvEnd_xmin)
101
102 GOList.append(alvEnd)
103
104 # galerie
105
106 galerie_xmin = bouchon_xmax
107 galerie_xmax = 25.0
108 galerie_radius = 2.17
109
110 galerie = geompy.MakeCylinder(
111     geompy.MakeVertex(galerie_xmin,0.,0.),
112     vecx,
113     galerie_radius,
114     galerie_xmax-galerie_xmin)
115
116 GOList.append(galerie)
117
118 # -- rupture galerie
119
120 galRup_xmin = 22.18
121 galRup_xmax = galerie_xmax
122 galRup_radius = 2.82
123
124 galRup = geompy.MakeCylinder(
125     geompy.MakeVertex(galRup_xmin,0.,0.),
126     vecx,
127     galRup_radius,
128     galRup_xmax-galRup_xmin)
129
130 GOList.append(galRup)
131
132 # -- endom. galerie
133
134 galEnd_xmin = alvEnd_xmax
135 galEnd_xmax = galerie_xmax
136 galEnd_radius = 4.34
137
138 galEnd = geompy.MakeCylinder(
139     geompy.MakeVertex(galEnd_xmin,0.,0.),
140     vecx,
141     galEnd_radius,
142     galEnd_xmax-galEnd_xmin)
143
144 GOList.append(galEnd)
145
146 # --
147
148 box_y = 30.0
149 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
150 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
151
152 GOList.append(box)
153
154 # --
155
156 callovo = geompy.MakePartition(GOList, [], [], [bouchon])
157 geompy.addToStudy(callovo, "callovo 2")