Grasshopper

algorithmic modeling for Rhino

Hello,

I have a tree with 11 branches , my goal is to shift items in each branch by its path_index.

This gave null values in the beginning of each branch. Is there a way to shift the items such that they wrap?

Views: 1097

Replies to This Discussion

I haven't tested this, but you could try using the modulus operator (%) to divide by the item_count and get the remainder.  This would mean that when the index exceeded the maximum it would 'start again' from the beginning.

In other words your lexical rule would be:

{A}(i)        ->        {A}((path_index + i) % item_count)

Wow! that worked :D

Thanks Paul !

I would love to know if there is a way to do this without path mapper!

Thanks again!

Tree Statistics / Deconstruct Path / Shift List

Thank you

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service