# 3D Array

    // Array 'size' parameter.
    Dim=1;

    // For a consistent viewpoint, define $vpr, $vpt and $vpd.
    $vpt=[13.72,8,2.65]*Dim;
    $vpr=[45,0,340];
    $vpd=80*Dim;

    for(Idex=[0:2])
    for(Jdex=[0:2])
    for(Kdex=[0:2])

    // Some factors for nice spacing (and size).
    translate([Idex*10,Jdex*7.5,Kdex*2.5]*Dim)
    // Color needs values [0:1].
    color([Idex,Jdex,Kdex]/2)
    linear_extrude(0.3*Dim)
    text(str("[",Idex,"][",Jdex,"][",Kdex,"]"),size=Dim,font="Noto Mono");