Grasshopper

algorithmic modeling for Rhino

Hello community,

I have a rectangular grid from which i remove some items according to a semi-random pattern. After that, I would then like to retrieve the branch number that every item originally belonged to.

That means, for every rectangle that is left on the grid, i would like to know on which branch it originally belonged before i reduced the grid population.

I include script and screenshots. Thank you in advance for your help.

 

Views: 356

Attachments:

Replies to This Discussion

Hello Dim,

I took a look at your file. Here is how I would do it. Instead of flatenning everything, and hoping that in the end you can put everything back where it belongs, you need to keep your tree structure at every step.

The tricky part is getting the random numbers that determine your culling pattern.

What I did is graft those random numbers and organise them in a tree with the exact same structure as your rectangles. So you have a culling pattern as a tree, and your culling component does not alter the tree branches. Your culled rectangles stay in their respective branches.

I hope it helps.

Attachments:

Hello Friou,

Thanks a lot for your response. I did not open the file yet because i was busy with some other stuff today. Your logic is correct and i understand what you did. You distributed the random values in branches so that we do not miss the branch number from the original values. That is the way to do it correctly. Cheers!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service