Project a line/curve line onto a profile

How to project a straight line / curve line onto a profile?

For straight line i can do
create slab > clip volume > extract face/edge

but for curve line i have no idea what to do.