A random pattern of three different widths pieces

Hello,

I’m trying to generate a model like the one in the picture que-03 (I’ll add it in the next post) using ‘geometry nodes’. I searched on Google and the AI ​​offered me a possible solution (que-04), but it doesn’t work the way I want. The cubes sit grouped together, instead of spreading next to each other, without overlapping. Probably after two more posts I will be able to add the Blender file and the other images.
Can you please tell me what is missing or wrong in the code I created?
Thank you!

Based on a YT tutorial ( How to Stack Cubes with the accumulate field node, by Cartesian Caramel) I modified the initial code and now the boxes are spread out, but I still need to control the distance between them, so that they are next to each other.

Hello and welcome here !

So there is a lot to say :smiley: I’ll try to keep it simple !

First if you ask an AI especially for GN stuff, I think it’s best to ask for tutorials or forum post … Solutions they offer by themselves with GN are generally lame.

There are different approach to what you’re trying to do, I think the method outlined is along those lines : https://www.youtube.com/watch?v=kiSi0HC7-aM&t=2s

Now is this the right approach for your problem … IDK but hey we need to start somewhere right ?

Lastly, I highly recommend you start by studying GN on it’s on and avoid to study it with a complex project such as this… If you’re stuck on simple graph like this , things won’t get simpler …

But at least it’s kind of the right exercice to start with !

Good luck !

Merci, sozap! :slight_smile:
After looking on initial GN, I thought the same thing and searched for ‘Accumulate field’ and I was able to modify the code to make it work (a little). I still have to figure out how to control the distance between the panels, because the tutorial I followed used ‘Scale’, and not the exact dimensions of multiple boxes in a collection.

Hahaha you’re welcome !

Okkk ! This gets a bit trickier indeed !
At this stage it’s hard to advice you properly, because there are different ways to approach programming, but choosing the right one depends a lot on the context…

In a collection elements are stored as instances which makes things a bit different…
Try this to access to each instance dimensions :

Thanks for the answer!
I tried to apply it but it is too complex for now and I couldn’t get it to work.

I followed the YT tutorial instead and the Scale method works.

I tried to add to it the possibility to set three box sizes by adding Switch and Equal nodes, but I still can’t find a way to eliminate the distance between them.


Thanks again!

I found the solution with the help of a YouTube tutorial ( Procedural stacks with the Repeat Zone geometry node in Blender, by harry blends). :slight_smile:
Thanks!

Ok great ! Well done !