1 # -*- coding: latin-1 -*-
2 # Hexa : Creation d'hexaedres
4 # Copyright (C) 2009-2013 CEA/DEN, EDF R&D
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
27 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
30 doc = hexablock.addDocument ("test_cone")
32 orig = doc.addVertex (0, 0, 0)
33 ori2 = doc.addVertex (0, 0, 10)
34 vz = doc.addVector (0, 0, 1)
35 vx = doc.addVector (1 ,0, 0)
47 c1 = doc.makeCylindrical (orig, vx,vz, rad1, angle, height, nr,na,nl, hollow)
48 c2 = doc.makeCylindrical (ori2, vx,vz, rad2, angle, height, nr,na,nl, hollow)
50 vh0 = c2.getVertexIJK (0, 0, 0)
51 vh1 = c2.getVertexIJK (1, 0, 0)
53 vb0 = c1.getVertexIJK (0, 0, nl)
54 vb1 = c1.getVertexIJK (1, 0, nl)
56 qcible = c2.getQuadIJ (0, 0, 0)
58 for ni in range (nr) :
59 for nj in range (na) :
60 quad = c1.getQuadIJ (ni, nj, nl)
63 ## Join quads to make a cone between the 2 cylinders
64 doc.joinQuads (qliste, qcible, vb0, vh0, vb1, vh1, 1)
66 ### -------------------- Mesh
68 law = doc.addLaw ("Uniform", 4)
70 for np in range(doc.countPropagation()):
71 propa = doc.getPropagation (np)
74 mesh_hexas = hexablock.mesh(doc)