I want to reconstruct a closed loop in 2D or 3D space (depending on whether there is torsion or not) through calculating the Frenet-Serret equations the Frenet-Serret equations, just like the figure below The final shape I want to reconstruct. The curvature of several fixed points on the curve is known, but the total length of the loop is unknown.
I can calculate the open curve with different curvature and torsion, the figure shown below the open curve. For this curve, the distances between the two red points are same and the total length of the curve is known. Because the reconstruction algorithm calculates backward according to the position and curvature of the previous point until it reaches the last point, I cannot control the position of final point and then the curve is open. So, how can I make a closed loop i.e the start point is the same as the final point? Should I use the arbitrary-speed Frenet-Serret equations? How to implement this algorithm?