How to 'match' my curve to a target curve's slope in 3d

Hello friends, I thought this should be simple but it turned out to be a bit more complicated for my skills. I have a black line as my own line. And there is a cyan line as the target line. They are very similar in the horizontal alignment but not 100% the same. My goal is to ‘match‘ my black line to the cyan line in the space. My strategy is to get the control point of the black line, and try to find their closest points on the cyan line. After that I can find the correct z value for the black line control points and I can construct the new line using “Nurbs PWK”, so the horizontal alignment will be the same and the space slope can also match.

However the ‘Closet point’ or ‘Pull‘ is not giving me the result I expected. I was thinking I could get closet points on the cyan line as the blue mark shown below. But looks like the ‘closest point’ is calculating based on the vertical distance in space instead of a certain projection view. Is there a way to achieve this? Or should I go another route with some other components? Files are attached, thanks a bunch!

MATCH LINE SLOPE.3dm (154.5 KB)

line slope match.gh (15.6 KB)

you can just move each control point using a “move” from a to b. (a being black line points, b being your cyan line reference points)

i guess it depends on how your line is built or how you would rebuild it

maybe someone has a smarter way to do this, interested to see other replies

hypothetically you could also extrude black line in both directions, split the extrusion by the cyan line, and get that split edge :rofl:

i guess it would help to understand why you need to match that line to a curve you already have in light blue, otherwise its hard to make sense why you would remake it

Yeah the issue is that I don’t know the distance to move each point with. I was hoping to find the closest point on the cyan line so i know the z value to copy from.

you can draw vertical lines from your points, split those lines by your cyan curve to find the length of the distance, then move by those distances

or simply use a distance component from point a (black) to point b (cyan) and then move the points in the Z by those distances

i think the vertical line is a way to go. I am not following the point method tho. I only have points on black curve, there is no projected points on the cyan line…am I missing anything?

For your reference.
LineSlope.gh (15.1 KB)

Hi Jessen, this is great, I learned new components and way of thinking from you to tackle this. Thank you very much!

Thank you for all the help!