Paths and path mapping remain one of my greatest challenges with Grasshopper… after a couple of years I at least understand how they work, but still sometimes struggle to get them shaped the way I need.
My current difficulty is merging two lists, one of which is just one branch with several items, and the other of which is a series of branches with a couple items each.
The goal is to take the first and last item from one list, the middle items from the other list, and produce one branch per item.
It’s hard to explain in text (reading the above makes little sense to me), so here’s an example with data:
pathtrouble.gh (12.9 KB)
That brute forces the data into the right shape, but relies on a hardcoded number of items. Note that where I’ve written “bad” in the source data, the actual data is not obviously bad and can’t be filtered with nulls or similar.
My immediate problem will always be taking the first and last item from Input 1 and all middle items from Input 2 (there may be more branches and/or more items in input 2). But what I’m really after is something like Pick 'n Choose, but which will pick all items in a branch.