What I want to do is feed in a set of 3 coordinates such as [<1,0,0>,<0.7071,0.7071,0>,<0,1,0>] and it will produce a circular torus so that the center of the tube passes through all 3 points, with the beginning cut starting at the first coordinate, and the ending cut finishing with the 3rd coordinate.
I've been trying to write the code based off "simple" point sets, such as the one given, but when I try to extrapolate that code to more non-simple cases such as [<1,2,.5>,<-3,1,3>,<2,-.75,2>] my very simplified math falls apart. Does anyone have some code, or even insight into translating how SL builds a torus (outer-edge radius, inner "hole", and the x,y,z stretches) compared to the standard mathematical definition of a torus:
x=(R+r*cos(v))*cos

y=(R+r*cos(v))*sin

z=r*sin(v)
where R is the radius from the center to the middle of the tube, r is the radius of the tube, and u,v = [0,2pi)