2012-08-09 13:58:02 +06:00
|
|
|
|
# -*- coding: iso-8859-1 -*-
|
2014-02-18 12:44:41 +06:00
|
|
|
|
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
|
2009-02-13 17:16:39 +05:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
|
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2006-06-01 17:32:40 +06:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
2014-02-18 12:44:41 +06:00
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
2003-07-09 20:33:44 +06:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
# Lesser General Public License for more details.
|
2003-07-09 20:33:44 +06:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2003-07-09 20:33:44 +06:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2006-06-01 17:32:40 +06:00
|
|
|
|
#
|
2012-08-09 13:58:02 +06:00
|
|
|
|
|
2006-06-01 17:32:40 +06:00
|
|
|
|
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
|
2003-07-09 20:33:44 +06:00
|
|
|
|
# File : GEOM_Partition5.py
|
|
|
|
|
# Module : GEOM
|
2003-05-12 21:24:23 +06:00
|
|
|
|
# import gallery_01_GEOM
|
|
|
|
|
# reload(gallery_01_GEOM)
|
|
|
|
|
# -- Import geompy pour piloter GEOM par script
|
2009-02-13 17:16:39 +05:00
|
|
|
|
#
|
2013-04-04 13:06:43 +06:00
|
|
|
|
import salome
|
|
|
|
|
salome.salome_init()
|
|
|
|
|
import GEOM
|
|
|
|
|
from salome.geom import geomBuilder
|
|
|
|
|
geompy = geomBuilder.New(salome.myStudy)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Dimensions de la boite enti<74>re
|
|
|
|
|
|
|
|
|
|
LX, LY, LZ = 300.0, 150.0, 150.0
|
2004-12-01 15:39:14 +05:00
|
|
|
|
p0 = geompy.MakeVertex(0.,0.,0.)
|
|
|
|
|
vy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- D<>finition du plan de sym<79>trie (O,Ox,Oz)
|
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
symPlane = geompy.MakePlane(p0, vy, 10.0)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- bo
|
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
bo = geompy.MakeBoxDXDYDZ(LX, LY, LZ)
|
|
|
|
|
bo = geompy.MakeTranslation(bo, 0.0, -LY/2, -LZ/2)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Galerie principale
|
|
|
|
|
|
|
|
|
|
gal_diam = 80.0
|
|
|
|
|
gal_lony = LY
|
|
|
|
|
gal_x = LX-20.0-gal_diam/2
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
|
|
gal = geompy.MakeCylinder(p0, vy, gal_diam/2, gal_lony)
|
|
|
|
|
gal = geompy.MakeTranslation(gal, gal_x, -gal_lony/2, 0.0)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Galerie perpendiculaire
|
|
|
|
|
# -- Dimensions de la galerie perpendiculaire
|
|
|
|
|
# -- La longueur est compt<70>e <20> partir du centre
|
|
|
|
|
# -- de la galerie principale
|
|
|
|
|
|
|
|
|
|
gpe_long, gpe_diam = 200.0, 60.0
|
|
|
|
|
gpe_x = gal_x
|
|
|
|
|
gpe = geompy.MakeCylinder(
|
2004-12-01 15:39:14 +05:00
|
|
|
|
p0,
|
|
|
|
|
geompy.MakeVectorDXDYDZ(-1.,0.,0.),
|
2003-05-12 21:24:23 +06:00
|
|
|
|
gpe_diam/2,gpe_long)
|
2004-12-01 15:39:14 +05:00
|
|
|
|
gpe = geompy.MakeTranslation(gpe, gpe_x, 0, 0)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Dimensions d'une alveole
|
|
|
|
|
# -- Construction d'une alv<6C>ole
|
|
|
|
|
|
|
|
|
|
alv_long, alv_diam = 60.0, 18.0
|
2004-12-01 15:39:14 +05:00
|
|
|
|
alv01 = geompy.MakeCylinder(p0, vy, alv_diam/2, alv_long)
|
|
|
|
|
alv02 = geompy.MakeMirrorByPlane(alv01, symPlane)
|
|
|
|
|
alv0 = geompy.MakeCompound([alv01, alv02])
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Construction des alv<6C>oles
|
|
|
|
|
|
|
|
|
|
alv_del, alv_sep = 40.0, 35.0
|
2004-12-01 15:39:14 +05:00
|
|
|
|
alv1 = geompy.MakeTranslation(alv0, gal_x-gal_diam/2-alv_sep, 0.0, 0.0)
|
|
|
|
|
alv2 = geompy.MakeTranslation(alv1, -alv_del, 0.0, 0.0 )
|
|
|
|
|
alv3 = geompy.MakeTranslation(alv2, -alv_del, 0.0, 0.0 )
|
|
|
|
|
alv = geompy.MakeCompound([alv1, alv2, alv3])
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
# -- Remplissage de la BO
|
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
gallery = geompy.MakePartition([alv, bo], [], [], [gal, gpe])
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
subshapes = geompy.SubShapeAll(gallery, geompy.ShapeType["SHAPE"])
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
alvGOs = []
|
|
|
|
|
alvGOs.append(subshapes[0])
|
|
|
|
|
alvGOs.append(subshapes[1])
|
|
|
|
|
alvGOs.append(subshapes[2])
|
|
|
|
|
alvGOs.append(subshapes[3])
|
|
|
|
|
alvGOs.append(subshapes[4])
|
|
|
|
|
alvGOs.append(subshapes[5])
|
|
|
|
|
alvcomp = geompy.MakeCompound(alvGOs)
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
boGO = subshapes[6]
|
|
|
|
|
galGO = subshapes[7]
|
|
|
|
|
gpeGO = subshapes[8]
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
|
gallery = geompy.MakeCompound([boGO, alvcomp, gpeGO, galGO])
|
2003-05-12 21:24:23 +06:00
|
|
|
|
|
|
|
|
|
geompy.addToStudy(gallery,"Gallery 2")
|