Why does the join curves component shift starting point

Hi.

I was working on creating a script in grasshopper when i discovered something that was causing me lot of frustration. I was able to recreate the problem in a simpler format which i will provide here. I now know how to work around this problem, but i want to understand why it happens.

When i have a closed polyline, the start point of the curve will be the start point of the first segment. For visual purposes i offset the curve inwards and then explode it to get the separate segments. If i then join these segments together again, the start point is now shifted to the start of the last segment. This becomes obvious when i try to loft this newly joined polyline to the original polyline, and the result is messier than one would expect.

Why does the starting point change during a join curves component?


Join curve error.gh (7.5 KB)

Please have a look at Interpolate Curve - problem to apply points according to preferred order - Grasshopper
@lucas_cañada gave an answer what might be usefull.

I have never experienced this behavior in gh for closed curves… is this is an assumption of yours?
would you mind posting a gh file where shifting segments and joining them yields the same shifted start/end points each time?

as far as I know, start/end points stays the same if both the curve is open, and all the segments belong to the very same curve:

Join open curve.gh (9.9 KB)

but for closed curves, start/end points just might end up in the same location as result of a lucky sorting when they go through the joining function… but that would be nothing more than a lucky random sequence that does not necessarily happen:

Join closed curve.gh (10.7 KB)