Grasshopper

algorithmic modeling for Rhino

Hopefully I'm just silly and there is a straightforward way of doing this but...

I want to go from a flat list of 0,1,2,3,4,5 to
{1} 0,1
{2} 2,3
{3} 4,5
where I can set the number of values in each branch or (less preferably) the number of branches to divide the values between

I find this amazingly hard to accomplish, any help?
/Fr..

Views: 749

Replies to This Discussion

See if the attached works for you. It works fine, provided that the number if items within each "chunk" you want to take is evenly divisible by the length of the list.
Attachments:
Thanks a bunch!

Precisely what I needed.
Now I will stretch my brain around how it works.
When you extract the subset of a list, each subset is outputted into its own branch. So what I did is made an interval based on the length of the list, then divided that interval based on the number of items in each chunk. Since dividing the interval will include an "extra item" I then take out that extra one again through an interval representing the number of items for each chunk.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service