Meshes in Code

A table is a 2D block of numbers.

$i$$x$$y$$z$
0 0.01.0 0.5
1−0.50.5 0.5
2−0.50.0 0.5
3 0.50.0 0.5
4 0.50.5 0.5
5 0.01.0−0.5
6−0.50.5−0.5
7−0.50.0−0.5
8 0.50.0−0.5
9 0.50.5−0.5
var positions = [
    [  0.0,  1.0,  0.5 ],
    [ -0.5,  0.5,  0.5 ],
    [ -0.5,  0.0,  0.5 ],
    [  0.5,  0.0,  0.5 ],
    [  0.5,  0.5,  0.5 ],
    [  0.0,  1.0, -0.5 ],
    [ -0.5,  0.5, -0.5 ],
    [ -0.5,  0.0, -0.5 ],
    [  0.5,  0.0, -0.5 ],
    [  0.5,  0.5, -0.5 ]
]

In program code, we represent a table as an array of arrays.