Say I have a planar (poly)curve, is there a function to elevate this curve in a way where you give a length and a height value and the curve moves for each length value the height value in the non-planar direction?

I realise my English is a bit rusty so here is an image to clarify what I’m asking for:

Thank you!