Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/hexablock.git] / doc / tui_blocks_for_cyl_pipe.rst
1 :tocdepth: 3
2
3
4 .. _tuiblockscylinderpipe:
5
6 =====================================
7 Make blocks for a cylinder and a pipe
8 =====================================
9
10 Make blocks for a cylinder
11 ==========================
12
13 ::
14
15     elts = doc.makeCylinder(cyl, vb, nr, na, nl)
16
17 cyl: cylinder
18
19 vb: vector on the base of the cylinder to start hexahedra.
20
21 nr: number of blocks on radial.
22
23 na: number of angular section.
24
25 nl: number of blocks along the axis of the cylinder.
26
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.
30
31
32 Example
33 -------
34
35 ::
36
37         import hexablock
38         doc = hexablock.addDocument()
39
40         base = doc.addVertex(0, 0, 0)
41         direction = doc.addVector(0, 0, 1)
42         radius = 4
43         height = 5
44
45         cyl = doc.addCylinder(base, direction, radius, height)
46
47         vb = doc.addVector(1, 0, 0)
48         nr = radius
49         na = 9  
50         nl = height
51         elts = doc.makeCylinder(cyl, vb, nr, na, nl)
52
53 .. image:: _static/cylinder.png
54    :align: center
55
56 .. centered::
57    Cylinder
58
59 Make blocks for cylinders
60 =========================
61
62 ::
63
64      elts = doc.makeCylinders(cyl1, cyl2)
65
66 The result is an array of hexahedral.
67
68
69 Make blocks for a pipe
70 ======================
71
72 ::
73
74     elts = doc.makePipe(pi, vb, nr, na, nl)
75
76 The result is an array of hexahedral arranged in layers following the
77 first radial and angular layers, and finally the axial layers.
78
79 Example
80 -------
81
82 ::
83
84         import hexablock
85         doc = hexablock.addDocument()
86
87         orig = doc.addVertex(50, 0, 0)
88         vz = doc.addVector(0, 0, 1)
89         int_radius = 3
90         ext_radius = 4
91         height = 5
92         pi = doc.addPipe(orig, vz, int_radius, ext_radius, height)
93
94         vb = doc.addVector(1, 0, 0)
95         nr = 4
96         na = 9
97         nl = 5
98         elts = doc.makePipe(pi, vb, nr, na, nl)
99
100 .. image:: _static/pipe.png
101    :align: center
102
103 .. centered::
104    Pipe
105
106 Make blocks for pipes
107 =====================
108
109 ::
110
111     elts = doc.makePipes(p1, p2)
112
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.
116
117
118 GUI command: :ref:`guiblockscylinderpipe`