OpenSCAD For Loop Grid example
Profiles & patterns
Lesson 7 of 22
Generate many related solids from two loop variables and a height formula.
Try changing:
columnsrowsspacingradiusriseLow compile complexity. Cost grows with rows × columns × facet count.
How this model works
OpenSCAD ranges include both endpoints, so [0 : columns - 1] produces exactly columns positions. Each height depends on both X and Y indices. These pillars are intentionally disconnected: STL can contain multiple shells, and that alone is not a compiler failure.
main.scad
Loading draft
Ready
Z up · geometry preview
Your geometry will appear here
Preview or render the model to inspect it in 3D.
Geometry-only STL preview
Grid 10 units · Drag: orbit · Right-drag / two fingers: pan · Scroll / pinch: zoom
0 messages
Make it your own
Change the height formula from x + y to abs(x - y). Add a thin base under the grid if you want one connected object.
Change one parameter at a time and inspect the result. Use the workspace reset action to return to this lesson’s original model.