Salome HOME
IPAL21297: errors for Netgen_1D_2D
[modules/geom.git] / src / GEOM_SWIG / GEOM_Partition5.py
1 #  -*- coding: iso-8859-1 -*-
2 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
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.
11 #
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.
16 #
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
20 #
21 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
24 #  File   : GEOM_Partition5.py
25 #  Module : GEOM
26 # import gallery_01_GEOM
27 # reload(gallery_01_GEOM)
28 # -- Import geompy pour piloter GEOM par script
29 #
30 import geompy
31 geom = geompy.geom
32
33 # -- Dimensions de la boite enti\88re
34
35 LX, LY, LZ = 300.0, 150.0, 150.0
36 p0 = geompy.MakeVertex(0.,0.,0.)
37 vy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
38
39 # -- D\89finition du plan de sym\89trie (O,Ox,Oz)
40
41 symPlane = geompy.MakePlane(p0, vy, 10.0)
42
43 # -- bo
44
45 bo = geompy.MakeBoxDXDYDZ(LX, LY, LZ)
46 bo = geompy.MakeTranslation(bo, 0.0, -LY/2, -LZ/2)
47
48 # -- Galerie principale
49
50 gal_diam = 80.0
51 gal_lony = LY
52 gal_x = LX-20.0-gal_diam/2
53
54 gal = geompy.MakeCylinder(p0, vy, gal_diam/2, gal_lony)
55 gal = geompy.MakeTranslation(gal, gal_x, -gal_lony/2, 0.0)
56
57 # -- Galerie perpendiculaire
58 # -- Dimensions de la galerie perpendiculaire
59 # -- La longueur est compt\89\80 partir du centre
60 # -- de la galerie principale
61
62 gpe_long, gpe_diam = 200.0, 60.0 
63 gpe_x = gal_x
64 gpe = geompy.MakeCylinder(
65     p0,
66     geompy.MakeVectorDXDYDZ(-1.,0.,0.),
67     gpe_diam/2,gpe_long)
68 gpe = geompy.MakeTranslation(gpe, gpe_x, 0, 0)
69
70 # -- Dimensions d'une alveole
71 # -- Construction d'une alv\89ole
72
73 alv_long, alv_diam = 60.0, 18.0
74 alv01 = geompy.MakeCylinder(p0, vy, alv_diam/2, alv_long)
75 alv02 = geompy.MakeMirrorByPlane(alv01, symPlane)
76 alv0 = geompy.MakeCompound([alv01, alv02])
77
78 # -- Construction des alv\89oles
79
80 alv_del, alv_sep = 40.0, 35.0
81 alv1 = geompy.MakeTranslation(alv0, gal_x-gal_diam/2-alv_sep, 0.0, 0.0)
82 alv2 = geompy.MakeTranslation(alv1, -alv_del, 0.0, 0.0 )
83 alv3 = geompy.MakeTranslation(alv2, -alv_del, 0.0, 0.0 )
84 alv = geompy.MakeCompound([alv1, alv2, alv3])
85
86 # -- Remplissage de la BO
87
88 gallery = geompy.MakePartition([alv, bo], [], [], [gal, gpe])
89
90 subshapes = geompy.SubShapeAll(gallery, geompy.ShapeType["SHAPE"])
91
92 alvGOs = []
93 alvGOs.append(subshapes[0])
94 alvGOs.append(subshapes[1])
95 alvGOs.append(subshapes[2])
96 alvGOs.append(subshapes[3])
97 alvGOs.append(subshapes[4])
98 alvGOs.append(subshapes[5])
99 alvcomp = geompy.MakeCompound(alvGOs)
100
101 boGO  = subshapes[6]
102 galGO = subshapes[7]
103 gpeGO = subshapes[8]
104
105 gallery = geompy.MakeCompound([boGO, alvcomp, gpeGO, galGO])
106
107 geompy.addToStudy(gallery,"Gallery 2")