algorithmic modeling for Rhino
I have 2 trees that have the same structure and I want to manipulate the values of one tree as per the values or pattern of another one. In the image attached, I want to average the values in the first tree that are paired with the same value in tree 2, and keep the tree structure in terms of branches intact.
ex: in branch{0:291;2}, the values @ indices 0 and 1(115.xx,116.xx) in tree 1 have the same value of 0 at tree 2, so these should be averaged. While the value @ index 2 is solo and thus is going to remain the same.
I hope that the question is clear.
Tags:
Replies are closed for this discussion.
If its only 0 and 1 then you can use this as a Boolean pattern for Dispatch and then pass each resulting output through an Average component before Merging them back together. If its more i.e. 0,1,2 and 3 then Sift Pattern instead of Dispatch
* I should have generated random seeds so that the answers aren't all the same but hey ho
2 things:
1) you should verify your answers because I don't think they are correct.
2) it is slower than the GH method I showed above. (but as it is only 2% of your total processor time it probably doesn't matter)
do you ever have more than 2 of a similar ray? if so then your method gets the average of the first two rays and then the average of that average and the next ray.
If not it won't matter.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by