1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
22 # File : GEOM_Partition4.py
25 #%Make geometry (like CEA script (A3)) using Partition algorithm%
26 # import couplex2_01_GEOM
27 # reload(couplex2_01_GEOM)
29 # Dimensions de alveolus
30 # Parall
\89pip
\88de rectangle de taille alDx, alDy, alDz
37 # Dimensions de backfill
38 # Parall
\89pip
\88de rectangle de taille baDx, baDy, baDz
44 # Dimensions de geological medium
55 # -- Construction de backfill
57 backA = geompy.MakeBox(0.0, 0.0, 0.0, baDx, baDy, baDz)
58 back = geompy.MakeTranslation(backA, -baDx/2, -baDy/2, -baDz/2)
60 # -- Construction de alveolus
64 alveA = geompy.MakeBox(0.0, 0.0, 0.0, alDx, alDy, alDz)
65 alveB = geompy.MakeTranslation(alveA, -alDx/2, baDy/2, -alDz/2)
66 axis = geompy.MakeVectorDXDYDZ(1.0, 0.0, 0.0)
67 alve1 = geompy.MakeRotation(alveB, axis, math.pi)
68 alve2 = geompy.MakeTranslation(alveB, +alSepx/2, 0.0, 0.0)
69 alve3 = geompy.MakeTranslation(alveB, -alSepx/2, 0.0, 0.0)
74 alve = geompy.MakeCompound(GOlist)
76 # -- Construction de geological medium
78 geolA = geompy.MakeBox(0.0, 0.0, 0.0, gmDx, gmDy, gmDz)
79 geol = geompy.MakeTranslation(geolA, -gmDx/2, -gmDy/2, -gmDz/2)
81 geol = geompy.MakePartition([alve, geol, back])
83 subshapes = geompy.SubShapeAll(geol, geompy.ShapeType["SHAPE"])
86 GOlist.append(subshapes[0])
87 GOlist.append(subshapes[1])
88 GOlist.append(subshapes[2])
89 alve = geompy.MakeCompound(GOlist)
96 geol = geompy.MakeCompound([geol, back, alve])
98 geompy.addToStudy(geol, "couplex2 2")