Salome HOME
Fix crash of BugRevolution.py import: apply the same patch, as on V2_2_0_maintainance
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition4.py
1 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
2 #
3 #  Copyright (C) 2003  CEA/DEN, EDF R&D
4 #
5 #
6 #
7 #  File   : GEOM_Partition4.py
8 #  Module : GEOM
9
10 #%Make geometry (like CEA script (A3)) using Partition algorithm%
11 # import couplex2_01_GEOM
12 # reload(couplex2_01_GEOM)
13
14 # Dimensions de alveolus
15 # Parall\89pip\88de rectangle de taille alDx, alDy, alDz
16
17 alDx   = 2.5
18 alDy   = 20.0
19 alDz   = 2.5
20 alSepx = 18.0
21
22 # Dimensions de backfill
23 # Parall\89pip\88de rectangle de taille baDx, baDy, baDz
24
25 baDx = 27.0
26 baDy = 4.8
27 baDz = 4.8
28
29 # Dimensions de geological medium
30
31 gmDx = baDx
32 gmDy = 49.6
33 gmDz = 100.0
34
35 # --
36
37 import geompy
38 geom = geompy.geom
39
40 # -- Construction de backfill
41
42 backA = geompy.MakeBox(0.0, 0.0, 0.0, baDx, baDy, baDz)
43 back = geompy.MakeTranslation(backA, -baDx/2, -baDy/2, -baDz/2)
44
45 # -- Construction de alveolus
46
47 import math
48
49 alveA = geompy.MakeBox(0.0, 0.0, 0.0, alDx, alDy, alDz)
50 alveB = geompy.MakeTranslation(alveA, -alDx/2, baDy/2, -alDz/2)
51 axis  = geompy.MakeVectorDXDYDZ(1.0, 0.0, 0.0)
52 alve1 = geompy.MakeRotation(alveB, axis, math.pi)
53 alve2 = geompy.MakeTranslation(alveB, +alSepx/2, 0.0, 0.0)
54 alve3 = geompy.MakeTranslation(alveB, -alSepx/2, 0.0, 0.0)
55 GOlist = []
56 GOlist.append(alve1)
57 GOlist.append(alve2)
58 GOlist.append(alve3)
59 alve = geompy.MakeCompound(GOlist)
60
61 # -- Construction de geological medium
62
63 geolA = geompy.MakeBox(0.0, 0.0, 0.0, gmDx, gmDy, gmDz)
64 geol = geompy.MakeTranslation(geolA, -gmDx/2, -gmDy/2, -gmDz/2)
65
66 geol = geompy.MakePartition([alve, geol, back])
67
68 subshapes = geompy.SubShapeAll(geol, geompy.ShapeType["SHAPE"])
69
70 GOlist = []
71 GOlist.append(subshapes[0])
72 GOlist.append(subshapes[1])
73 GOlist.append(subshapes[2])
74 alve = geompy.MakeCompound(GOlist)
75
76 geol = subshapes[3]
77 back = subshapes[4]
78
79 # --
80
81 geol = geompy.MakeCompound([geol, back, alve])
82
83 geompy.addToStudy(geol, "couplex2 2")