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