Hi everyone,
I’m struggling with a data tree matching issue. I have two trees with different path depths and I want to perform an operation between them. For simplicity i picked addition as seen below.
Setup:
The parent tree has a depth of 1 (e.g., {0}, {1}) containing lists of values (e.g., 10, 20, 30).
The children tree has a depth of 2 (e.g., {0;0}, {0;1}, {0;2}) containing single indices.
Problem:
Grasshopper seems to match the branches based on their index order, not their path name.
Branch {0;0} matches with {0}, so far so good.
Branch {0;1} matches with {1} instead of staying with {0}
Once the a tree runs out of branches, all subsequent branches of the other tree reuse the last branch of the first one.
Goal:
I want every sub-branch that starts with 0;... to use the data from parent branch {0}, and every sub-branch starting with 1;... to use data from {1}. Essentially, I need the parent list to be duplicated for each of its children. I can imagine this as a workaround but there has to be a smart and dynamic solution to this.
So I have tried Path Mapper and Match Tree, but I can’t seem to get a hold to it.
Appreciate any input and help to this.
Attachments:






