***** My Scientific Developing Blog *****
What we need to optimize is the intermediate curves by interpolation :-)
Step 1:
Interpolate the torsions of the start and end CCC.
Step 2:
Build the intermediate snake by the give interpolated torsions. [The start point and vectors are also given].
Step 3:
Optimize the intermediate snake to lay the start and end points on to the rails or as close as possible.