1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
22 # File : GEOM_Partition2.py
25 #%Make geometry (like CEA script (A2)) using Partition algorithm%
26 # import callovo_01_GEOM
27 # reload(callovo_01_GEOM)
30 # --------------------------------------------
31 # Geometrie avec une galerie perpendiculaire
32 # --------------------------------------------
37 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
38 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
46 colis = geompy.MakeCylinder(
47 geompy.MakeVertex(colis_xmin,0.,0.),
50 colis_xmax-colis_xmin)
58 bo = geompy.MakeCylinder(
59 geompy.MakeVertex(bo_xmin,0.,0.),
68 alvRup_xmax = colis_xmax
71 alvRup = geompy.MakeCylinder(
72 geompy.MakeVertex(alvRup_xmin,0.,0.),
75 alvRup_xmax-alvRup_xmin)
80 bouchon_xmin = colis_xmax
82 bouchon_radius = alvRup_radius
84 bouchon = geompy.MakeCylinder(
85 geompy.MakeVertex(bouchon_xmin,0.,0.),
88 bouchon_xmax-bouchon_xmin)
96 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
98 galerie = geompy.MakeCylinder(
103 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
107 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
108 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
113 galRup_xmax = galerie_xmax
116 galRup = geompy.MakeCylinder(
121 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
123 # -- endommagement galerie
125 galEnd_xmax = galerie_xmax
128 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
129 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
131 # -- endommagement alveole
134 alvEnd_xmax = galerie_xmax
137 alvEnd = geompy.MakeCylinder(
138 geompy.MakeVertex(alvEnd_xmin,0.,0.),
141 alvEnd_xmax-alvEnd_xmin)
143 # remove internal parts of galEnd intersecting alvEnd
145 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
150 #GOList += [galerie ]
152 GOList += [galEnd_alvEnd]
156 # remove section parts outside bo and inside bouchon
158 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
160 geompy.addToStudy(callovo, "callovo perp. 2")