How to align one curve to another by overlapping their midpoints

Hi.

I have two difference curves (A and B) in my .gh file:

curvea_curveb.gh (6.2 KB)

I would like to align one curve to another and have their midpoints overlap, as shown in the print screen:

Is there a simple way to do this?

Thanks for any comment!

How about “subcrv” command with option “FromMidpoint”

@Alex43 thanks a lot for your answer, and sorry for my very late answer. The “subcrv” command works fine, but I would like to do this in grasshopper. Is there a way to implement this in grasshopper with the “subcrv” component and other components?

@saeed_hasan_zadeh thanks for your answer, but my intention is to align curve B to curve A and have curve B have the same curvature as curve A.

reposition_001.gh (10.5 KB)

I tried to do this in two ways, but I didn’t succeed. The problem is the domain of the curve and its length, because they are different from each other. This is annoying. I know this is about parametric curves, but I don’t know how to transform a point on a curve by its length to its domain value, even with the “remmap numbers” component. Curve B needs to be in the middle of curve A, and the length that runs over curve A from its middle needs to stop exactly after running the length of curve B divided by 2 to the left and to the right, or - [Curve_B_Lenght]/2, and + [Curve_B_Lenght]/2 (just to give you an idea).

domain and lenght.gh (12.2 KB)

Ok, while fiddling with some component, I saw that “Evaluate Lenght” works well for this case.

I got the solution, but I wish there was a more convenient one, like the “SubCrv” command, as shown by Alex.

Thank you very much for your comments, @Alex43 and @saeed_hasan_zadeh.

CrvA_CrvB_solution.gh (16.0 KB)