Salome HOME
Moving to GUI module
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition4.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_Partition4.py
24 #  Module : GEOM
25 # import couplex2_01_GEOM
26 # reload(couplex2_01_GEOM)
27 # Dimensions de alveolus
28 # Parall\89pip\88de rectangle de taille alDx, alDy, alDz
29 #
30 alDx   = 2.5
31 alDy   = 20.0
32 alDz   = 2.5
33 alSepx = 18.0
34
35 # Dimensions de backfill
36 # Parall\89pip\88de rectangle de taille baDx, baDy, baDz
37
38 baDx = 27.0
39 baDy = 4.8
40 baDz = 4.8
41
42 # Dimensions de geological medium
43
44 gmDx = baDx
45 gmDy = 49.6
46 gmDz = 100.0
47
48 # --
49
50 import geompy
51 geom = geompy.geom
52
53 # -- Construction de backfill
54
55 backA = geompy.MakeBox(0.0, 0.0, 0.0, baDx, baDy, baDz)
56 back = geompy.MakeTranslation(backA, -baDx/2, -baDy/2, -baDz/2)
57
58 # -- Construction de alveolus
59
60 import math
61
62 alveA = geompy.MakeBox(0.0, 0.0, 0.0, alDx, alDy, alDz)
63 alveB = geompy.MakeTranslation(alveA, -alDx/2, baDy/2, -alDz/2)
64 axis  = geompy.MakeVectorDXDYDZ(1.0, 0.0, 0.0)
65 alve1 = geompy.MakeRotation(alveB, axis, math.pi)
66 alve2 = geompy.MakeTranslation(alveB, +alSepx/2, 0.0, 0.0)
67 alve3 = geompy.MakeTranslation(alveB, -alSepx/2, 0.0, 0.0)
68 GOlist = []
69 GOlist.append(alve1)
70 GOlist.append(alve2)
71 GOlist.append(alve3)
72 alve = geompy.MakeCompound(GOlist)
73
74 # -- Construction de geological medium
75
76 geolA = geompy.MakeBox(0.0, 0.0, 0.0, gmDx, gmDy, gmDz)
77 geol = geompy.MakeTranslation(geolA, -gmDx/2, -gmDy/2, -gmDz/2)
78
79 geol = geompy.MakePartition([alve, geol, back])
80
81 subshapes = geompy.SubShapeAll(geol, geompy.ShapeType["SHAPE"])
82
83 GOlist = []
84 GOlist.append(subshapes[0])
85 GOlist.append(subshapes[1])
86 GOlist.append(subshapes[2])
87 alve = geompy.MakeCompound(GOlist)
88
89 geol = subshapes[3]
90 back = subshapes[4]
91
92 # --
93
94 geol = geompy.MakeCompound([geol, back, alve])
95
96 geompy.addToStudy(geol, "couplex2 2")