Finding vertices in order

Hi There,

I have a grasshopper script that simulates a folding pattern using Kangaroo solver and hinges command.

The Kangaroo command works all good but I am having difficulty finding the right points as folding points.

currently, the folding points that I am giving to Hinge component are not right, therefore, the folded simulation is as follows:

But the final state that I am trying to fold it into is as follows:

I can choose the points manually, but I want to have the code parametric therefore I rather to find the points through the script.

Can anyone help me, please?

here is the grasshopper code:

FoldingSimulatiion.gh (23.3 KB)

Thanks in advance.

Draw which points do you wish to select.

If the whole sheet is made of 8 pieces of pink highlighted 4 sided polygons, I want a list of points that are tagged as 0 of all the 4 sided polygons, a list of points tagged with number 1 and a list of points of tagged number 2 and a list of points tagged with the number 3.

so it will be as following:
List one:

{Point 0, polygone 1,
point 0 polygone 2,
point 0 polygone 3,
point 0 polygone 4,
point 0 polygone 5,
point 0 polygone 6,
point 0 polygone 7,
point 0 polygone 8}

and the same for points 1, 2 and 3.

here is the reference image:

Here…
FoldingSimulatiion.gh (27.2 KB)

There is a bit more work to be done, but I am sure you can do it…