I'm working with a $~3$D visualization toolkit in python.I want to draw lines (which will be converted to tubes) between given $~3$D points. I have a function that given two $~3$D points $~(P1(X,Y,Z), ~~P2(X,Y,Z))~$ draws a line between them and converted to a tube.
However, in some cases I need to convert the line to two offset parallel lines with small distance between them. Thus I need to calculate the new points for the two lines $~(P1',P1'', P2' and P2'')~$.
This following image summarizes the starting point and the desired result :

If you want the new tubes to be in a particular plane, I would approach the problem as follows: