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