Mystery: Identical geometry produces different results?

Hi! I am bashing my head against this one. One part of my script does a simple sort by x value to order a number of curves. This worked fine until changing some things upstream, and now this part refuses to work.

The old curves arrange themselves as I would imagine, the one with the highest x value becomes the first in its branch and so on. But the new curves break the tree branch logic completely and arrange themselves in some other weird way. EDIT: The matrix is flipped. Why does this happen and how can I avoid it?

To me, the tree structure of the old input curves and the new ones looks identical in every way, so I really can’t see why the result would be different. Maybe someone can see what I’m missing?

example3.gh (12.2 KB)

PS: For the old curves set, there are some very tiny curves at the lowest part, only visible when zoomed way in. These are the ones I have gotten rid of in the new curves set. You will see them when box properties is highlighted.


example3_re.gh (15.8 KB)

1 Like

Hi, thank you for having a look but it turns out the two structure sets ARE NOT the same, it only looks similar enough to confuse me. I have remedied it on my side. Sorry for taking your time!

Your second set of curves already has different data structure from the first set.

I just regroup the curves according to the proximity.

1 Like

Yes, I tricked myself with my structures there… Sorry for basically asking you to clean a mess! Thank you again!

For my future reference: when checking the data structure, don’t only check indices, also use “tree branch” to extract specific branches of the tree to see if they look as expected.