4 .. _tuiblockscylinderpipe:
6 =====================================
7 Make blocks for a cylinder and a pipe
8 =====================================
10 Make blocks for a cylinder
11 ==========================
15 elts = doc.makeCylinder(cyl, vb, nr, na, nl)
19 vb: vector on the base of the cylinder to start hexahedra.
21 nr: number of blocks on radial.
23 na: number of angular section.
25 nl: number of blocks along the axis of the cylinder.
27 The result is an array of hexahedra ranked first by following the
28 radial direction and the angular direction, then according to the
29 layers in the cylinder axis.
38 doc = hexablock.addDocument()
40 base = doc.addVertex(0, 0, 0)
41 direction = doc.addVector(0, 0, 1)
45 cyl = doc.addCylinder(base, direction, radius, height)
47 vb = doc.addVector(1, 0, 0)
51 elts = doc.makeCylinder(cyl, vb, nr, na, nl)
53 .. image:: _static/cylinder.png
59 Make blocks for cylinders
60 =========================
64 elts = doc.makeCylinders(cyl1, cyl2)
66 The result is an array of hexahedral.
69 Make blocks for a pipe
70 ======================
74 elts = doc.makePipe(pi, vb, nr, na, nl)
76 The result is an array of hexahedral arranged in layers following the
77 first radial and angular layers, and finally the axial layers.
85 doc = hexablock.addDocument()
87 orig = doc.addVertex(50, 0, 0)
88 vz = doc.addVector(0, 0, 1)
92 pi = doc.addPipe(orig, vz, int_radius, ext_radius, height)
94 vb = doc.addVector(1, 0, 0)
98 elts = doc.makePipe(pi, vb, nr, na, nl)
100 .. image:: _static/pipe.png
106 Make blocks for pipes
107 =====================
111 elts = doc.makePipes(p1, p2)
113 The result is an array of hexahedra where we first find hexahedra of
114 the first pipe and the second pipe. Each pipe range hexahedra following
115 first radial layers and angular layers, and finally the axial layers.
118 GUI command: :ref:`guiblockscylinderpipe`