Back to index

salome-geom  6.5.0
GEOM_Partition3.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_Partition3.py
00026 #  Module : GEOM
00027 # import callovo_01_GEOM
00028 # reload(callovo_01_GEOM)
00029 #
00030 import geompy
00031 geom = geompy.geom
00032 
00033 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
00034 
00035 # -- colis
00036 
00037 colis_xmin = 05.76
00038 colis_xmax = 19.83
00039 colis_radius = 0.3
00040 
00041 colis = geompy.MakeCylinder(
00042     geompy.MakeVertex(colis_xmin,0.,0.),
00043     vecx,
00044     colis_radius,
00045     colis_xmax-colis_xmin)
00046 
00047 GOList = [colis]
00048 
00049 # -- bo
00050 
00051 bo_xmin = 04.83
00052 bo_xmax = colis_xmax
00053 bo_radius = 1.23
00054 
00055 bo = geompy.MakeCylinder(
00056     geompy.MakeVertex(bo_xmin,0.,0.),
00057     vecx,
00058     bo_radius,
00059     bo_xmax-bo_xmin)
00060 
00061 GOList.append(bo)
00062 
00063 # -- rupture alveole
00064 
00065 alvRup_xmin = 04.46
00066 alvRup_xmax = colis_xmax
00067 alvRup_radius = 1.6
00068 
00069 alvRup = geompy.MakeCylinder(
00070     geompy.MakeVertex(alvRup_xmin,0.,0.),
00071     vecx,
00072     alvRup_radius,
00073     alvRup_xmax-alvRup_xmin)
00074 
00075 GOList.append(alvRup)
00076 
00077 # bouchon
00078 
00079 bouchon_xmin = colis_xmax
00080 bouchon_xmax = 22.83
00081 bouchon_radius = alvRup_radius
00082 
00083 bouchon = geompy.MakeCylinder(
00084     geompy.MakeVertex(bouchon_xmin,0.,0.),
00085     vecx,
00086     bouchon_radius,
00087     bouchon_xmax-bouchon_xmin)
00088 
00089 #GOList.append(bouchon)
00090 
00091 # -- endommagement alveole
00092 
00093 alvEnd_xmin = 03.6
00094 alvEnd_xmax = 20.66
00095 alvEnd_radius = 2.46
00096 
00097 alvEnd = geompy.MakeCylinder(
00098     geompy.MakeVertex(alvEnd_xmin,0.,0.),
00099     vecx,
00100     alvEnd_radius,
00101     alvEnd_xmax-alvEnd_xmin)
00102 
00103 GOList.append(alvEnd)
00104 
00105 # galerie
00106 
00107 galerie_xmin = bouchon_xmax
00108 galerie_xmax = 25.0
00109 galerie_radius = 2.17
00110 
00111 galerie = geompy.MakeCylinder(
00112     geompy.MakeVertex(galerie_xmin,0.,0.),
00113     vecx,
00114     galerie_radius,
00115     galerie_xmax-galerie_xmin)
00116 
00117 GOList.append(galerie)
00118 
00119 # -- rupture galerie
00120 
00121 galRup_xmin = 22.18
00122 galRup_xmax = galerie_xmax
00123 galRup_radius = 2.82
00124 
00125 galRup = geompy.MakeCylinder(
00126     geompy.MakeVertex(galRup_xmin,0.,0.),
00127     vecx,
00128     galRup_radius,
00129     galRup_xmax-galRup_xmin)
00130 
00131 GOList.append(galRup)
00132 
00133 # -- endom. galerie
00134 
00135 galEnd_xmin = alvEnd_xmax
00136 galEnd_xmax = galerie_xmax
00137 galEnd_radius = 4.34
00138 
00139 galEnd = geompy.MakeCylinder(
00140     geompy.MakeVertex(galEnd_xmin,0.,0.),
00141     vecx,
00142     galEnd_radius,
00143     galEnd_xmax-galEnd_xmin)
00144 
00145 GOList.append(galEnd)
00146 
00147 # --
00148 
00149 box_y = 30.0
00150 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
00151 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
00152 
00153 GOList.append(box)
00154 
00155 # --
00156 
00157 callovo = geompy.MakePartition(GOList, [], [], [bouchon])
00158 geompy.addToStudy(callovo, "callovo 2")