I have a curve object with multiple splines. I can loft them, using something like the Higgsas GeoNodes "Loft Splines" node-group. This kind of approach uses the spline Index to determine what order they're lofted together.
Instead, I would like to loft based on the order of the splines on the X axis (ties going to the original spline Index). I can get the mean position of each spline by evaluating Position in the Spline domain (this returns the mean of the points on that spline), giving me a canonical value to use to determine order... I could also use the position of the start or end vertex, or some other position. The problem I'm facing is the re-ordering part.
I'm not sure how to take the values and get this sort of ordering back (Original indexes in blue, new indexes in red)
As you can see, the lofted surface doubles back on itself because the splines were created "out of order", which is not what I want as my result
My last resort is to write a python script to populate an attribute, but I want to avoid that because I'm doing this to practice thinking using functional programming methods in Geometry Nodes. I'm in Blender 3.6.1, so I can do it with Simulation Nodes if that's what's needed, but I'm not good at this thinking yet.
Once I've got the coordinate-based indexes, I can tackle how to change up the lofting node to use them instead of the spline index