Grasshopper

algorithmic modeling for Rhino

I have MAIN LIST A, from which I am trying to generate SUB LISTS A1, A2, & A3 from. SUB LIST A1 needs to contain every third item from MAIN LIST A, starting from index #0. SUB LIST A2 needs to contain every third item from MAIN LIST A, starting from index#1. SUB LIST A3 needs to contain every third item from MAIN LIST A, starting from index#2.

I need a way to extract every Nth item from a list, in the same way that Cull Nth works, just inversely-so.

I am fairly new to grasshopper, and I can see in my mind there is a solution but I am not familiar enough with the components yet. 

I've read this thread:

http://www.grasshopper3d.com/forum/topics/copy-every-nth-item-of-a-...

But I didn't quite understand how to apply it to my situation.

Any suggestions would be greatly appreciated.

Thanks

Views: 17474

Replies to This Discussion

So far, I have culled every Nth, produced a new list, then culled every Nth from that list, resulting in a final list containing only 1/3 of the items from the original list. This works, but it's messy and non-adaptable in my opinion.

Closer, I used Cull Pattern, but it still seems like it might not allow for as much dynamic control as setting Boolean patterns would have to remain a manual process for differences in overall # of sub-lists to be generated.

Hello Zack,

you can try the following

cheers

alex

Alex, thanks for the quick reply!

I'm pretty new to Grasshopper, and didn't even realize you could add the +1..+N definitions onto the List Item component. That is really useful, and a little more elegant than the solution I had come up with !

Thanks again

you re welcome!

you can use ZUI to zoom in and add inputs and outputs in many components. also there is an expression x-1 in the second series output. (right click on the output to access the menu).

best,

alex

Thanks!

I've just not realized all the components yet that have the Zui Parameter option yet. I almost wish each component with that option had a little flag or some sort of indicator. 

zooming in, kind of works like an indicator.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service