1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # 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 # --------------------------------------------
37 from salome.geom import geomBuilder
38 geompy = geomBuilder.New(salome.myStudy)
40 vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
41 vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
49 colis = geompy.MakeCylinder(
50 geompy.MakeVertex(colis_xmin,0.,0.),
53 colis_xmax-colis_xmin)
61 bo = geompy.MakeCylinder(
62 geompy.MakeVertex(bo_xmin,0.,0.),
71 alvRup_xmax = colis_xmax
74 alvRup = geompy.MakeCylinder(
75 geompy.MakeVertex(alvRup_xmin,0.,0.),
78 alvRup_xmax-alvRup_xmin)
83 bouchon_xmin = colis_xmax
85 bouchon_radius = alvRup_radius
87 bouchon = geompy.MakeCylinder(
88 geompy.MakeVertex(bouchon_xmin,0.,0.),
91 bouchon_xmax-bouchon_xmin)
99 pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
101 galerie = geompy.MakeCylinder(
106 galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
110 box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
111 box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
116 galRup_xmax = galerie_xmax
119 galRup = geompy.MakeCylinder(
124 galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
126 # -- endommagement galerie
128 galEnd_xmax = galerie_xmax
131 galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
132 galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
134 # -- endommagement alveole
137 alvEnd_xmax = galerie_xmax
140 alvEnd = geompy.MakeCylinder(
141 geompy.MakeVertex(alvEnd_xmin,0.,0.),
144 alvEnd_xmax-alvEnd_xmin)
146 # remove internal parts of galEnd intersecting alvEnd
148 galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
153 #GOList += [galerie ]
155 GOList += [galEnd_alvEnd]
159 # remove section parts outside bo and inside bouchon
161 callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
163 geompy.addToStudy(callovo, "callovo perp. 2")