algorithmic modeling for Rhino
Sheesh! Can you (or anyone) please explain why 'Shortest List' is necessary here?
I had the series, shift and merge but no luck without 'Shortest List' - this stuff is SO HARD!!!
Here, because the original list and shifted lists are of unequal length, you use use "shortest list" to truncate the end of the longer one. But here it's also doing one other thing that's a bit trickier. One thing that the shift lists component does is it adds a new layer of data structure to your original list. So your original list is {0;0}, say, and after shift it appends a new one {0;0;0}. David has a post floating around that explains all conditions where this occurs. If you feed both the original list and the shifted list in "shortest list" it identifies that you're giving it two individual lists, and cleans up the data structure between the two such that they match. (Here it also does the nice bit of ensuring that you will always have two values in each grafted branch).
If you just graft and merge the outputs from the original list and the shifted list, then you end up with two distinct data structures: {0;0;x} and {0;0;0;x}. It can be annoying (and there are no shortage of people who are highly critical of the data tree as a means to manage nested lists), but it is at least always internally consistent. In this case, you can carefully use simplify to get rid of those extra lead-in zeros:
You'll notice that last bucket only has one value in it though...that's that other thing that using shortest list takes care of. Hope this helps!
That is simpler, which is good, but I would never have guessed the effect "-1" has of effectively removing the last item in that list... Far from obvious.
Here is one more way, using 'Sub List (SubSet)', that makes more sense to me - no idea about relative performance.
One domain is constructed as '0 to Length-2' (A=0, B=x-2), the other as '1 to Length-1' (A=1, B=x-1):
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