Grasshopper

algorithmic modeling for Rhino

# looking to duplicate a a set of branches

this is another simple one, but can't figure it out. I'm trying to take a series of branches and repeat them - but with out their content ending up in the same branches...

so {0:1}, {0;2}, {0:3}...

becomes
{0:1}, {0;2}, {0:3}...
{1:1}, {1;2}, {1:3}...
{2:1}, {2;2}, {2:3}...

and each branch where {A;B} the B is the same irregardless of A...

how? thanks!

Views: 807

### Replies to This Discussion

I'm not really sure if this can be done parametrically. The easiest way to take care of this is just with two extra path matchers where you just sepecify "A" directly (so the input would be {a;b} and the output would be {1;b}). Then just merge the theree streams together.
I think this will do ya... each branch can have a unique number of items.
(Damien, it's not as bad as I thought it would be...)

Actually, strictly speaking, the first [Path Mapper] isn't necessary....
Damian, Taz...thanks!....
Looks good... I thought it would have been worse too, but that does it purdy well, and not too may extra components either (which is a plus)
option 2：

and if I wanted to follow this duplication by converting the hierarchy of branches into a single level where instead of
{0;1},{0:2},{0:3},{1;0},{1;1},...

I would get the following
{0;1},{0:2},{0:3},{0;4},{0;5},...???
ok...I want to combine the power of expressions with the lexer combo mapper - ideally I could use the "max B" in an expression:

{A;B} >> {0;A*(Max(B)+1)+B}

yes, is this possible?
YES! it is...i was just missing a * sign...this is great
er um, no it doesnt - I think instead of getting the Maximum B value for everything in the B column, I'm just getting the B value...
Try {path_index} as the target. {0;path_index} if you need the leading zero.

Check the "Remarks" of the help file for a description.

• View All