# How to create random extrusion distance for n x n square model?

I want to recreate the attached image as best I can. Is there a good/easy way to create randomness in how much each face is extruded? My goal is a square grid that is approximately 10 x 10, and then those random extrusions with a color gradient. I am relatively new to Blender so any help is very appreciated. Thank you!

You can use a very simple Geometry Nodes setup for this.

Start with a grid with 11 vertices so that you have a 10x10 face grid. Next use a Split Edges node to seperate these faces. Scale down these faces by a small amount if you want seperated columns. Next, use a Extrude Mesh node to extrude these faces. Plug a random value node into the Offset Scale. Finally use a Set Material to assign a material to this geometry.

The material setup is one of the simplest ones. Just seperate out the Z component and use it as an input for an Emmision Shader. (Use the object coordinates instead of the generated ones if you don't want the gradient to always stay from 0-1.)

This should give you something that looks like this:

If you want the outlines too, there are a few different ways to go for it. The simplest one would be the inverse hull method. But there are a few different other options. There are a lot of existing resources for outlines, and therefore, I won't include that in this answer.

1. ⬆ ShiftA, M, P Add a new Plane.
2. ⭾ Tab Edit Mode
3. $$\color{#888}{█0}\color{green}{█}$$ right mouse button, S Subdivide
4. F9 Specify the number of cuts.
5. ⎇ AltE, then I Extrude Individual Faces
6. ✲ CtrlI Invert Selection
7. H Hide everything but the top faces
8. Enable proportional editing, random falloff.
9. GZ Move vertices up, don't confirm yet
10. $$\color{#888}{█}\color{green}⬇\color{#888}{█}$$ mouse wheel down until all verts have roughly the equal distribution.
11. Click to confirm movement, O disable proportional editing.
12. A Select all.
13. ., I Set Pivot to Individual Origins
14. SZ0 Flatten on $$z$$ axis.
15. ⎇ AltH Reveal hidden