10 To add a cartesian grid to the model, the following data are required:
12 - the vertex of the initial hexahedron: *pt*
13 - the vectors corresponding to the diametrically opposite vertices to the initial vertex: *vx, vy, vz*
14 - the number of repetition of this hexahedra along the three axes: *ni, nj, nk*
16 Make a Cartesian grid::
18 elts = doc.makeCartesian(pt, vx, vy, vz, ni, nj, nk)
22 elts = doc.makeCartesian1(pt, vec1, px, py, pz, mx, my, mz)
25 Access to the number of elements of the grid::
27 vn = elts.countVertex()
32 Access to all elements of the grid::
34 vi = elts.getVertex(i)
39 Specialized access to all vertices of the grid::
41 ve_xyz = elts.getVertexIJK(i, j, k)
48 Specialized access to all edges // vx axis of the grid::
50 ed_a = elts.getEdgeI(i, j, k)
57 Specialized access to all edges // vy axis of the grid::
59 ed_b = elts.getEdgeJ(i, j, k)
66 Specialized access to all edges // vz axis of the grid::
68 ed_c = elts.getEdgeK(i, j, k)
75 Specialized access to all quadrangles // on plane vx, vy::
77 qu_a = elts.getQuadIJ(i, j, k)
84 Specialized access to all quadrangles // on plane vx, vz::
86 qu_b = elts.getQuadIK(i, j, k)
93 Specialized access to all quadrangles // on plane vy, vz::
95 qu_c = elts.getQuadJK(i, j, k)
102 Specialized access to all hexahedra of the grid::
104 he_xyz = elts.getHexaIJK(i, j, k)
117 doc = hexablock.addDocument()
119 orig = doc.addVertex(0, 0, 0)
121 dx = doc.addVector(1, 0, 0)
122 dy = doc.addVector(0, 1, 0)
123 dz = doc.addVector(0, 0, 1)
129 grid = doc.makeCartesian(orig, dx, dy, dz, ni, nj, nk)
132 .. image:: _static/cartgrid3.png
139 GUI command: :ref:`guicartgrid`