Random box

Hello everybody
please I still need your help, in my case here I am trying to choose a number of boxes in this 3D grid and I want these selected boxes to be gathered together in a way that they are closer to each other, even when I change “seed” to component “jitter” they move in a way as if they are in a group
Is there a possibility of doing this? thanks again
random box.gh (12.7 KB)

Sorry, I know this isn’t what you asked for. Nothing random about this. I started to guess what you want by thinking of a designated point (blue group) being an “attractor” that would have random boxes around it but got lazy and ended up with this.


boxes_2024Apr17a.gh (16.4 KB)

I started to group the points in ten domains based on their distance to the attractor with the intent of randomly reducing size and more points in domains that are further away, something like this:

I read your description again and really don’t understand it, so both of these efforts may be way off.

The white group tries to do what I described above but looks wrong… :thinking: Too tired to fix it.


boxes_2024Apr17b.gh (29.8 KB)

Or maybe this subtle change fixes the issue I saw? :zzz:


boxes_2024Apr17c.gh (28.8 KB)

you probably want to use tree masking with very low jitter values
for that we need to reconstruct the tree from the flattened list


the format of the mask is this
{ (z coordinates) ; ( x coordinates) } [ y coordinates ]

this basically allows you to select a chunk of the matrix. if jitter is 0, then the chunk is, well, a box. with a small jitter, that box is slightly exploded. with large jitter, it’s more random

you can select multiple chunks by turning the panel into multiline and have a mask on each line

random box [ reconstructed tree] .gh (14.5 KB)

It probably doesn’t matter but I took another look at the code I posted yesterday. The anomaly I saw was far more subtle than I realized, fixed by sorting the output of Set along with branches of the MIndex ‘I’ output (yellow group). Also added an assembly of white pipes to make the attractor point more obvious (purple group), a couple of Dom (Contruct Domain) components and made sure the code is correct.


boxes_2024Apr18a.gh (39.0 KB)

thank you very much sir Joseph Oster for your help and the time you gave to my design problem
your last file helped me a lot, it’s true that I’m a beginner :smiley: and it took me a little time to understand the tree structure and the sequence of components but finally I managed to understand the process

1 Like

This might be the post where I developed this method of using domains to create gradient effects: