Back to index

salome-geom  6.5.0
GEOM_Partition2.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_Partition2.py
00026 #  Module : GEOM
00027 # import callovo_01_GEOM
00028 # reload(callovo_01_GEOM)
00029 # --------------------------------------------
00030 # Geometrie avec une galerie perpendiculaire
00031 # --------------------------------------------
00032 #
00033 import geompy
00034 geom = geompy.geom
00035 
00036 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
00037 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
00038 
00039 # -- colis
00040 
00041 colis_xmin = 05.76
00042 colis_xmax = 19.83
00043 colis_radius = 0.3
00044 
00045 colis = geompy.MakeCylinder(
00046     geompy.MakeVertex(colis_xmin,0.,0.),
00047     vecx,
00048     colis_radius,
00049     colis_xmax-colis_xmin)
00050 
00051 # -- bo
00052 
00053 bo_xmin = 04.83
00054 bo_xmax = colis_xmax
00055 bo_radius = 1.23
00056 
00057 bo = geompy.MakeCylinder(
00058     geompy.MakeVertex(bo_xmin,0.,0.),
00059     vecx,
00060     bo_radius,
00061     bo_xmax-bo_xmin)
00062 
00063 
00064 # -- rupture alveole
00065 
00066 alvRup_xmin = 04.46
00067 alvRup_xmax = colis_xmax
00068 alvRup_radius = 1.6
00069 
00070 alvRup = geompy.MakeCylinder(
00071     geompy.MakeVertex(alvRup_xmin,0.,0.),
00072     vecx,
00073     alvRup_radius,
00074     alvRup_xmax-alvRup_xmin)
00075 
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 # galerie
00090 
00091 galerie_xmax = 25.0
00092 galerie_radius = 3.0
00093 box_y = 30.0
00094 
00095 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
00096 
00097 galerie = geompy.MakeCylinder(
00098     pnt_galerie_xmax,
00099     vecy,
00100     galerie_radius,
00101     box_y)
00102 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
00103 
00104 # -- box
00105 
00106 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
00107 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
00108 
00109 
00110 # -- rupture galerie
00111 
00112 galRup_xmax = galerie_xmax
00113 galRup_radius = 3.9
00114 
00115 galRup = geompy.MakeCylinder(
00116     pnt_galerie_xmax,
00117     vecy,
00118     galRup_radius,
00119     box_y)
00120 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
00121 
00122 # -- endommagement galerie
00123 
00124 galEnd_xmax = galerie_xmax
00125 galEnd_radius = 4.6
00126 
00127 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
00128 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
00129 
00130 # -- endommagement alveole
00131 
00132 alvEnd_xmin = 03.6
00133 alvEnd_xmax = galerie_xmax
00134 alvEnd_radius = 2.46
00135 
00136 alvEnd = geompy.MakeCylinder(
00137     geompy.MakeVertex(alvEnd_xmin,0.,0.),
00138     vecx,
00139     alvEnd_radius,
00140     alvEnd_xmax-alvEnd_xmin)
00141 
00142 # remove internal parts of galEnd intersecting alvEnd
00143 
00144 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
00145 
00146 GOList =  [colis]
00147 GOList += [bo]
00148 GOList += [alvRup]
00149 #GOList += [galerie ]
00150 GOList += [galRup]
00151 GOList += [galEnd_alvEnd]
00152 
00153 # --
00154 
00155 # remove section parts outside bo and inside bouchon
00156 
00157 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
00158 
00159 geompy.addToStudy(callovo, "callovo perp. 2")