Random Square grid extrusion with attractor point

Hi. I’m kind of new to GH so I’m having a hard time completing this simple task.
I’m trying to create a square grid ( with 60cm x 60cm squares.) and I want to extrude these squares randomly bıt also have them grow in height toward the edges of the bounding squares. Ill attach an example photo of what I’m trying to achieve. I tried to write the definition in GH but It doesn’t seem to work and I’m pretty sure I’m missing something. If you can help me it would be much obliged.
I will also attach the GH file I’ve been working on.


Grid random extrusion_WIP.gh (18.9 KB)

Your GH file had some missing geometry, not internalized.

The image in your post looks simpler, something like this?


Grid random extrusion_2022Jan17a.gh (20.3 KB) UPDATED with internalized curve!

P.S. Added ‘Steps’ slider (blue group), which behaves differently if you use Round ‘C’ (Ceiling) or ‘F’ (Floor) instead of ‘N’ (Nearest)


Grid random extrusion_2022Jan17b.gh (21.0 KB)

The attractor curve can be any 3D shape, not just a flat line.

Regarding your GH model, I added an attractor curve (yellow group) and made one important change to your code; the number of Rectangular ‘Points’ doesn’t match its number of ‘Cells’, so I used Area ‘C’ instead for scaling. I skipped the SrfMorph because your surface wasn’t internalized.


Grid random extrusion_2022Jan17c.gh (21.6 KB)

I appreciate your help. Thanks a lot. This is exactly what I was trying to achieve!