Random select geometry from the list

hello everyone,

I’m working on a project that involves a 3D grid with a sorted data tree based on bounding boxes (as seen in the image). My goal is to randomly select a unique piece of geometry from each list in the data tree. This means no duplicates should be chosen from any individual list.

Attached Images:

  1. Initial Grid: This image shows the basic 3D grid structure.
  2. Data Tree (Bounding Box Representation): This image visually demonstrates the sorted data tree, where larger bounding boxes are positioned higher in the tree.
  3. Current output that i am getting now.
  4. Current Output (Front View): This image shows the current output with the issue of missing geometries, highlighting the need for unique selection.
  5. Script: This image displays my current Grasshopper definition, showcasing the components I’ve used so far.

My challenge:

I’m struggling to choose random elements from each sub-list in the sorted data tree while ensuring they are unique. I’ve tried using:

Random Item: This provides unweighted selection, not considering the sorted data.

Please feel free to ask for further details or clarifications on the specific components or logic I’m using.

Sincerely,

Jay Vayeda





You need to upload code.

randomSelect_07-03-24.gh (11.6 KB)

i have tried this but this is not working.

i have attached the file you give it a look.

randomSelect_07-03-24.gh (18.0 KB)
Not super sure if I understand correctly what you want but maybe this is it

no this is not what i want because the data tree is flipped in here.


this is your result


this is what i want to work on

But apart from the data structure, the resulting circles are how you want them?
That is what is not clear.

I’m also not 100% sure. I think they want random items removed from each list in such a way that when viewed from the front all the items will appear to be there, but when viewed from a difference angle each set will have unique items removed.

Complete set:
R1

Unique items removed from each set:
R2

When viewed from front the collection appears complete & there are no objects in front / behind another object.
R3

yes somewhat similar

can tell me how you achieve this result ?