Path Mapper Logic on Switching Placeholder Positions

Dear All

I have 2 square grids of 5x5 & 7x5 Entwined together.
I have been struggling to understand the logic of this simple Lexical rearrangement in the Path Mapper (please see attached file).

My questions are:

1. Why would switching the position of the First and Last placeholder would result in a checkboard pattern below? (please also refer to attached file)

2. What do the Constrains at the bottom of the Path Mapper component mean (eg item_count= number of items in the current branch, path_count= number of paths in the tree, path_index=index of current path)?

Many thanks and appreciate if any of the masters out there can save me from misery here!

YutakaPath Mapper.gh (10.6 KB)

Source Target
{a;b;c;d] ===>[d;b;c;a] this would give me a checkered result in the format of

Result
N=5
N=7
N=5
N=7 etc

The original arrangement was
N=5
N=5
N=5
N=5
N=5
N=7
N=7
N=7
N=7
N=7

Because the last path “D” have two identical paths each, so they would be sorted out and mix the two grid branches alternatively.
If you want to keep the order of branches by their grid group, then you should renumber the path indices of D.

Path Mapper_re.gh (11.5 KB)

Hi Kim

Many thanks for your help as always! That cleared the question well, thank you!

Could you pls explain what does the item_count = number of items in the current branch, path_count= number of paths in the path mapper mean and how they should be used?

Thanks so much!
Yutaka

Check attached…

Path Mapper_reV2.gh (14.5 KB)

1 Like

Hi Kim

Many thanks, your explanation is nice and clear and I got most of it.

I am just a bit confused about the meaning of the notations.
As you may see in the attached file,

In Query 1: I could not figure out the difference between \ & / . In query 1, I have used (i\2) & (i/2) which I presume means partition into 2 parts & divide into 2 parts respectively. However, if you look at the ParaViewer, the N in the second tree differs from N=4 (i\2) to N=5 (i/2).

In Query : When I use (i/25) I presume that the total of 386 flattened branches will be divided by 25 resulting in 16 branches. How then does GH decide that Branch 0 has N=13 & Branch 15 has N=23?Path Mapper_sign conventions.gh (24.9 KB)

In Query 3:
What is the meaning of “item_count -1-i” (why would -1-i result in a reversed tree?)

Many thanks and most grateful again for your help Kim!

Regards
Yutaka

As far as I know, GH uses division operators which are a standard part of VBScript and VB.NET language.
To split a list with the first N items going into the first branch and the next N going into the second branch, you’ll need the backslash divide (integer division) " \ " instead of a forward one.

Grid1
5-1-0 = 4
5-1-1 = 3
.
.
5-1-4 = 0

Grid2
7-1-0 = 6
7-1-1 = 5
.
.
.
.
7-1-6 = 0

And please search the forum discussions…

Thank you HS Kim, that is very clear and helpful many thanks!