Curve Interpolation Method (with one or more mid points) Optimization?

Hello friends, I’ve been working on this for a couple of days, and I feel so close to what I want to achieve. I just need a little help to optimize my script.

The base component is clustered; it looks for a base curve, an end elevation, and a start elevation, and it interpolates a new curve to fit.

My next goal is to plug in some intermediate points, then modify the elevation of the intermediate points and let each segment reinterpolate for finer control.

Then I’m stuck here, my current script works but it gets a bit messy when there are more segments. it feels heavy to work through each point and segment.

I was envisioning a more streamlined workflow. For instance, we don’t need to manually connect each segment to the base component; we just need to look at a list of intermediate point elevations and make adjustments, and then the curve will interpolate accordingly. perhaps some list operation or graft logic could help? I currently have no clue. Files are attached. Any advice is appreciated!

question.gh (135.6 KB)

question.3dm (51.8 KB)

My interpretation.

question a.gh (129.7 KB)

Hey Leopold, thank you for this!

question b.gh (118.8 KB)

Hi, Leopold, sorry I did not get back to you sooner. This looks great and I never thought this could be solved through scaling the lines on z values. I still need some time to read through and understand how the components work in this script. I’ll get back to you if I have any questions, thanks so much!