To make a uniform quad revolution you need:
One quad revolution:
elts = doc.revolutionQuadUni(quad, center, axis, angle, nbLayers)
Revolution of a set of quads:
elts = doc.revolutionQuadsUni(quads, center, axis, angle, nbLayers)
GUI command: Uniform Quad Revolution
To make a custom quad revolution you need:
One quad revolution:
elts = doc.revolutionQuad(quad, center, axis, angles)
Revolution of a set of quads:
elts = doc.revolutionQuads(quads, center, axis, angles)
GUI command: Custom Quad Revolution
Operations on elts: Elements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2016 CEA/DEN, EDF R&D
#
# 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
# version 2.1 of the License, or (at your option) any later version.
#
# 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.
#
# 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#### Quad Revolution Test #####
import hexablock
doc = hexablock.addDocument("Quad Revolution Test")
center = doc.addVertex(0, 0, 0)
vz = doc.addVector(0, 0, 1)
v1 = doc.addVertex (10, 0, 0)
v2 = doc.addVertex (11, 0, 0)
v3 = doc.addVertex (11, 0, 2)
v4 = doc.addVertex (10, 0, 2)
quad = doc.addQuadVertices (v1, v2, v3, v4)
doc.saveVtk("revolution1.vtk")
angle = 180
nbLayers = 8
grid0 = doc.revolutionQuadUni (quad, center, vz, angle, nbLayers)
doc.saveVtk ("revolution2.vtk")
nr = 1
na = 6
nl = 1
grid = doc.makeCylinderTop (nr,na,nl)
liste = []
for nx in range(nr):
for ny in range(na):
cell = grid.getQuadIJ (nx, ny, nl)
liste.append(cell)
center = doc.addVertex(0, -10, 0)
axis = doc.addVector (1, 0, 0)
angle = 180
nbLayers = 9
grid1 = doc.revolutionQuadsUni (liste, center, axis, angle, nbLayers)
if grid1.isValid():
doc.saveVtk ("revolution3.vtk")
|