Shift Path Logic Please!

Dear All

Sorry a very silly question, I am trying to understand the logic on how the Shift Path compoent works.
In this simple example, I have 3 lines as 3 branches.
When Shift Path is -1 the data tree becomes 1 branch with N=3
When Shift Path is 1 the data tree becomes 3 branched with N=3 and Simplified (pls refer to Para Viewer).

I sense that its very similar to Flip Matrix but not quite, can anyone please explain the logic behind this component?

Any directions would be much appreciated!!

Many thanks!
YutakaShift Path.gh (9.3 KB)
Shift Path.3dm (214.1 KB)

1 Like

I sense that its very similar to Flip Matrix

It has nothing to do with flip matrix. Is shifts the path level in a direction by collapsing common path branches together. Flip matrix flips paths from columns to rows with item counts.

See here an image how shift path works:

2 Likes

Many thanks for your reply and very clear diagram!
Helped a mountain!
Is it true that the longer the branch structure, the larger negative number I will need in the offset in order to collapse the branch?

Is it true that the longer the branch structure, the larger negative number I will need in the offset in order to collapse the branch?

Not really, What matters is the level of unique addresses. For instance, all the zeros in front of the path do not really matter (as you probably noticed by using simplify). What matters is the first time there is a difference between branches, like in the above diagram when the first 3 have “0” and the next 3 have “1”. So I guess you can look at it as the the longer the branch structure after simplification.

If there is only 1 level of difference in addresses (paths) like seen in the diagram above after shift -1 then you will get the result of a flat list (same as using flatten)

Thanks Micheal, yes I realized the zeros arr actually arbitrary items as David Rutten mentioned in a tutorial.

Its interesting that you mentioned about the level of differences in paths. I have attached an example here consisting of a grid of 40 branches & 10Ns which has been exploded into 400 branches to produce rectangles in the means of the cells.
Then I used shift path -1 which brought me back to its original Branch Structure of 40 branches x 10Ns (exactly what I needed).

in this example can I say that there are 40 level differences in the paths?

Many thanks for your directions!

Shif Path_2.gh (18.4 KB)