How to stretch a polyline with multiple segments into a linear line

Hi,

I am looking for a way on Grasshopper to “stretch” the polyline into a linear curve. The length of the linear curve should be the same as the polyline, and the points on the polyline should appear on the linear line as well. Is there a way to modify the polyline, instead of creating a new linear curve based on the original polyline?
Original polyline and points:

The end result show look something like this.

I am trying to use the domain function, but not sure what’s the next step.

Many thanks!

-J

That’s elementary via code.



Notify if you are familiar with C#

You can set StartPoint and Direction (vector) of Line to any value you want.


Strech_PolyLine_1.gh (12.7 KB)