Grasshopper

algorithmic modeling for Rhino

How would i weave two lists in this manner to get a data tree?

 

A= [A,B,C,D,E,F]

B = [x,y,z]

 

Result tree

 

[A][x,y,z]

[B][x,y,z]

[C][x,y,z]

[D][x,y,z]

[E][x,y,z]

[F][x,y,z]

Views: 5027

Replies to This Discussion

Can you be more specific. What are A,B,C etc and x,y,z?

Do you want (A,x,y,z) to be values on a branch or do you need A to interact with x,y,z?

do the brackets represent branches of the resulted tree?

meaning that [A] is the first branch, [x,y,z] the second, [B] the third and so on?

or is [A,x,y,z] the first branch?

[A,x,y,z] would be the first branch, and data type is geometry here...

 

I tried using Graft in combination with Weave component, but the file crashed before showing any result...

in this case i thought it would be real easy, but turns out grasshopper doesn't act the way i was expecting:

 

first weird thing is that the series component doesn't reduce the branch address to {0}, even though it is simplified (so it needed a path mapper component to get the hierarchy the same for the two input streams of the merge component)

 

second weird thing is that the stream component doesn't match the data as other components would, meaning using a "longest list" logic when matching branches, i see it matches the first branch in the first tree with the first and only branch in the second tree, but the other branches in the first tree don't get to be matched with the only branch in the second (which is the way other components seem to match branches)

 

I'll think of an alternative way, but i am hoping for a clarification regarding these apperantly weird behaiveurs

 

take care!

 

Thanks Andrei, but this solution works for only first branch,I tried Merge component before too, but mine din't even resolved my issue for the 1st branch... I guess it was simplifying the tree that resolved the first one...

yeah, it wasn't a solution, i just posted it in the idea that david or somebody else that knows grasshopper more "intimately" can give an explanation

 

i'll think of a way to solve what you are asking for, but a bit later...

Well i tried grafting with Weave technique with strings and integers, and it worked... I guess it was calculations with geometry that is causing the crash...

 

weave is use in the same lists...

try a duplicate data in the second list + simplify with merge.

 

ok, so the problem was i forgot branch addresses are important when using the merge component. it merges only the branch that contains A with the number list, because this is the only one that has the same address {0}. You can do what Manuel said, duplicating the data, or even better, what you said, using weave. Glad we figured this out.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service