sideLen=20; gap=2; gridSize=10; for( a = [0 : gridSize-1]) { translate([a*sideLen+a*gap, 0, 0]) for( a = [0 : gridSize-1]) { translate([0, a*sideLen+a*gap, 0]) cube(sideLen); } }