Salome HOME
Remove "MAC" ends of lines
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition2.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2011  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_Partition2.py
26 #  Module : GEOM
27 # import callovo_01_GEOM
28 # reload(callovo_01_GEOM)
29 # --------------------------------------------
30 # Geometrie avec une galerie perpendiculaire
31 # --------------------------------------------
32 #
33 import geompy
34 geom = geompy.geom
35
36 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
37 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
38
39 # -- colis
40
41 colis_xmin = 05.76
42 colis_xmax = 19.83
43 colis_radius = 0.3
44
45 colis = geompy.MakeCylinder(
46     geompy.MakeVertex(colis_xmin,0.,0.),
47     vecx,
48     colis_radius,
49     colis_xmax-colis_xmin)
50
51 # -- bo
52
53 bo_xmin = 04.83
54 bo_xmax = colis_xmax
55 bo_radius = 1.23
56
57 bo = geompy.MakeCylinder(
58     geompy.MakeVertex(bo_xmin,0.,0.),
59     vecx,
60     bo_radius,
61     bo_xmax-bo_xmin)
62
63
64 # -- rupture alveole
65
66 alvRup_xmin = 04.46
67 alvRup_xmax = colis_xmax
68 alvRup_radius = 1.6
69
70 alvRup = geompy.MakeCylinder(
71     geompy.MakeVertex(alvRup_xmin,0.,0.),
72     vecx,
73     alvRup_radius,
74     alvRup_xmax-alvRup_xmin)
75
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 # galerie
90
91 galerie_xmax = 25.0
92 galerie_radius = 3.0
93 box_y = 30.0
94
95 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
96
97 galerie = geompy.MakeCylinder(
98     pnt_galerie_xmax,
99     vecy,
100     galerie_radius,
101     box_y)
102 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
103
104 # -- box
105
106 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
107 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
108
109
110 # -- rupture galerie
111
112 galRup_xmax = galerie_xmax
113 galRup_radius = 3.9
114
115 galRup = geompy.MakeCylinder(
116     pnt_galerie_xmax,
117     vecy,
118     galRup_radius,
119     box_y)
120 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
121
122 # -- endommagement galerie
123
124 galEnd_xmax = galerie_xmax
125 galEnd_radius = 4.6
126
127 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
128 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
129
130 # -- endommagement alveole
131
132 alvEnd_xmin = 03.6
133 alvEnd_xmax = galerie_xmax
134 alvEnd_radius = 2.46
135
136 alvEnd = geompy.MakeCylinder(
137     geompy.MakeVertex(alvEnd_xmin,0.,0.),
138     vecx,
139     alvEnd_radius,
140     alvEnd_xmax-alvEnd_xmin)
141
142 # remove internal parts of galEnd intersecting alvEnd
143
144 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
145
146 GOList =  [colis]
147 GOList += [bo]
148 GOList += [alvRup]
149 #GOList += [galerie ]
150 GOList += [galRup]
151 GOList += [galEnd_alvEnd]
152
153 # --
154
155 # remove section parts outside bo and inside bouchon
156
157 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
158
159 geompy.addToStudy(callovo, "callovo perp. 2")