Straighten a series of jagged/curved polylines

Hello, i have a series of polyline in jagged/curved shape and i want to unwrap and straighten it into a straight line with the points shown too how do i do it?

once that is achieve i would like to do something more advance like this too

Hello
I am quite sure it is not possible except if some lines are extended or you free some points.
Also how do you decide of the position of the lower curve along X ? Green curves seems problematic

hi there i think maybe i would just do 1 line instead, is there any command i can use to achieve it?

Here is a way of doing it for one curve.
Take a starting point, here (0,2,0)
Calculate the length of curve
Make a line with the length and said direction X


For each point look where it it for the curve. Measure length

This could be refined for multiple curve but you ll have to lateral curve from straightened curve.
Post what you have if you want more. Because it could be possible to use Kangaroo if you want to minimize the displacement …

straighten curve.gh (7.7 KB)

you can use the Rhino command Smooth, increase al the leavers till you have a straight line, followed by SimplifyCrv which will make a singular line out of it .