Back to index

salome-geom  6.5.0
GEOM_Partition4.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
00025 #  File   : GEOM_Partition4.py
00026 #  Module : GEOM
00027 # import couplex2_01_GEOM
00028 # reload(couplex2_01_GEOM)
00029 # Dimensions de alveolus
00030 # Parall‰pipˆde rectangle de taille alDx, alDy, alDz
00031 #
00032 alDx   = 2.5
00033 alDy   = 20.0
00034 alDz   = 2.5
00035 alSepx = 18.0
00036 
00037 # Dimensions de backfill
00038 # Parall‰pipˆde rectangle de taille baDx, baDy, baDz
00039 
00040 baDx = 27.0
00041 baDy = 4.8
00042 baDz = 4.8
00043 
00044 # Dimensions de geological medium
00045 
00046 gmDx = baDx
00047 gmDy = 49.6
00048 gmDz = 100.0
00049 
00050 # --
00051 
00052 import geompy
00053 geom = geompy.geom
00054 
00055 # -- Construction de backfill
00056 
00057 backA = geompy.MakeBox(0.0, 0.0, 0.0, baDx, baDy, baDz)
00058 back = geompy.MakeTranslation(backA, -baDx/2, -baDy/2, -baDz/2)
00059 
00060 # -- Construction de alveolus
00061 
00062 import math
00063 
00064 alveA = geompy.MakeBox(0.0, 0.0, 0.0, alDx, alDy, alDz)
00065 alveB = geompy.MakeTranslation(alveA, -alDx/2, baDy/2, -alDz/2)
00066 axis  = geompy.MakeVectorDXDYDZ(1.0, 0.0, 0.0)
00067 alve1 = geompy.MakeRotation(alveB, axis, math.pi)
00068 alve2 = geompy.MakeTranslation(alveB, +alSepx/2, 0.0, 0.0)
00069 alve3 = geompy.MakeTranslation(alveB, -alSepx/2, 0.0, 0.0)
00070 GOlist = []
00071 GOlist.append(alve1)
00072 GOlist.append(alve2)
00073 GOlist.append(alve3)
00074 alve = geompy.MakeCompound(GOlist)
00075 
00076 # -- Construction de geological medium
00077 
00078 geolA = geompy.MakeBox(0.0, 0.0, 0.0, gmDx, gmDy, gmDz)
00079 geol = geompy.MakeTranslation(geolA, -gmDx/2, -gmDy/2, -gmDz/2)
00080 
00081 geol = geompy.MakePartition([alve, geol, back])
00082 
00083 subshapes = geompy.SubShapeAll(geol, geompy.ShapeType["SHAPE"])
00084 
00085 GOlist = []
00086 GOlist.append(subshapes[0])
00087 GOlist.append(subshapes[1])
00088 GOlist.append(subshapes[2])
00089 alve = geompy.MakeCompound(GOlist)
00090 
00091 geol = subshapes[3]
00092 back = subshapes[4]
00093 
00094 # --
00095 
00096 geol = geompy.MakeCompound([geol, back, alve])
00097 
00098 geompy.addToStudy(geol, "couplex2 2")