1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
23 # File : GEOM_Partition2.py
25 # import callovo_01_GEOM
26 # reload(callovo_01_GEOM)
27 # --------------------------------------------
28 # Geometrie avec une galerie perpendiculaire
29 # --------------------------------------------
34 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
35 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
43 colis = geompy.MakeCylinder(
44 geompy.MakeVertex(colis_xmin,0.,0.),
47 colis_xmax-colis_xmin)
55 bo = geompy.MakeCylinder(
56 geompy.MakeVertex(bo_xmin,0.,0.),
65 alvRup_xmax = colis_xmax
68 alvRup = geompy.MakeCylinder(
69 geompy.MakeVertex(alvRup_xmin,0.,0.),
72 alvRup_xmax-alvRup_xmin)
77 bouchon_xmin = colis_xmax
79 bouchon_radius = alvRup_radius
81 bouchon = geompy.MakeCylinder(
82 geompy.MakeVertex(bouchon_xmin,0.,0.),
85 bouchon_xmax-bouchon_xmin)
93 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
95 galerie = geompy.MakeCylinder(
100 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
104 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
105 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
110 galRup_xmax = galerie_xmax
113 galRup = geompy.MakeCylinder(
118 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
120 # -- endommagement galerie
122 galEnd_xmax = galerie_xmax
125 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
126 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
128 # -- endommagement alveole
131 alvEnd_xmax = galerie_xmax
134 alvEnd = geompy.MakeCylinder(
135 geompy.MakeVertex(alvEnd_xmin,0.,0.),
138 alvEnd_xmax-alvEnd_xmin)
140 # remove internal parts of galEnd intersecting alvEnd
142 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
147 #GOList += [galerie ]
149 GOList += [galEnd_alvEnd]
153 # remove section parts outside bo and inside bouchon
155 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
157 geompy.addToStudy(callovo, "callovo perp. 2")