Salome HOME
2f1d4730496d8c6593bf2a4a924bf5543e3f1c7d
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition2.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_Partition2.py
25 #  Module : GEOM
26 # import callovo_01_GEOM
27 # reload(callovo_01_GEOM)
28 # --------------------------------------------
29 # Geometrie avec une galerie perpendiculaire
30 # --------------------------------------------
31 #
32 import geompy
33 geom = geompy.geom
34
35 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
36 vecy = geompy.MakeVectorDXDYDZ(0.,1.,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 # -- bo
51
52 bo_xmin = 04.83
53 bo_xmax = colis_xmax
54 bo_radius = 1.23
55
56 bo = geompy.MakeCylinder(
57     geompy.MakeVertex(bo_xmin,0.,0.),
58     vecx,
59     bo_radius,
60     bo_xmax-bo_xmin)
61
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
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 # galerie
89
90 galerie_xmax = 25.0
91 galerie_radius = 3.0
92 box_y = 30.0
93
94 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
95
96 galerie = geompy.MakeCylinder(
97     pnt_galerie_xmax,
98     vecy,
99     galerie_radius,
100     box_y)
101 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
102
103 # -- box
104
105 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
106 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
107
108
109 # -- rupture galerie
110
111 galRup_xmax = galerie_xmax
112 galRup_radius = 3.9
113
114 galRup = geompy.MakeCylinder(
115     pnt_galerie_xmax,
116     vecy,
117     galRup_radius,
118     box_y)
119 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
120
121 # -- endommagement galerie
122
123 galEnd_xmax = galerie_xmax
124 galEnd_radius = 4.6
125
126 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
127 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
128
129 # -- endommagement alveole
130
131 alvEnd_xmin = 03.6
132 alvEnd_xmax = galerie_xmax
133 alvEnd_radius = 2.46
134
135 alvEnd = geompy.MakeCylinder(
136     geompy.MakeVertex(alvEnd_xmin,0.,0.),
137     vecx,
138     alvEnd_radius,
139     alvEnd_xmax-alvEnd_xmin)
140
141 # remove internal parts of galEnd intersecting alvEnd
142
143 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
144
145 GOList =  [colis]
146 GOList += [bo]
147 GOList += [alvRup]
148 #GOList += [galerie ]
149 GOList += [galRup]
150 GOList += [galEnd_alvEnd]
151
152 # --
153
154 # remove section parts outside bo and inside bouchon
155
156 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
157
158 geompy.addToStudy(callovo, "callovo perp. 2")