2 # -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
5 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
6 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
25 # File : GEOM_Partition2.py
27 # import callovo_01_GEOM
28 # reload(callovo_01_GEOM)
29 # --------------------------------------------
30 # Geometrie avec une galerie perpendiculaire
31 # --------------------------------------------
36 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
37 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
45 colis = geompy.MakeCylinder(
46 geompy.MakeVertex(colis_xmin,0.,0.),
49 colis_xmax-colis_xmin)
57 bo = geompy.MakeCylinder(
58 geompy.MakeVertex(bo_xmin,0.,0.),
67 alvRup_xmax = colis_xmax
70 alvRup = geompy.MakeCylinder(
71 geompy.MakeVertex(alvRup_xmin,0.,0.),
74 alvRup_xmax-alvRup_xmin)
79 bouchon_xmin = colis_xmax
81 bouchon_radius = alvRup_radius
83 bouchon = geompy.MakeCylinder(
84 geompy.MakeVertex(bouchon_xmin,0.,0.),
87 bouchon_xmax-bouchon_xmin)
95 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
97 galerie = geompy.MakeCylinder(
102 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
106 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
107 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
112 galRup_xmax = galerie_xmax
115 galRup = geompy.MakeCylinder(
120 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
122 # -- endommagement galerie
124 galEnd_xmax = galerie_xmax
127 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
128 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
130 # -- endommagement alveole
133 alvEnd_xmax = galerie_xmax
136 alvEnd = geompy.MakeCylinder(
137 geompy.MakeVertex(alvEnd_xmin,0.,0.),
140 alvEnd_xmax-alvEnd_xmin)
142 # remove internal parts of galEnd intersecting alvEnd
144 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
149 #GOList += [galerie ]
151 GOList += [galEnd_alvEnd]
155 # remove section parts outside bo and inside bouchon
157 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
159 geompy.addToStudy(callovo, "callovo perp. 2")