gleSpiral - Problem

Hi there,
I’m having a problem with the gleSpiral function from the GLE tubing and extrusion library (subroutine documentation can be found here: http://linas.org/gle/tube.html ). I’m trying to draw a coil spring, which represents a multi-mass-spring. Basically I’m drawing the spring through given points in 3D-space (spheres represent the given points):
http://s3.directupload.net/file/d/1458/kgvons5k_png.htm

For a constant cross section of the spring that’s not a problem:
http://s5.directupload.net/file/d/1458/mz9sr28r_png.htm (normals are messed up, but the geometry is correct)

The problem is that the spring should have an elliptic and variable contour (cross section) from one point in space to the next one. Every radius in each point is given. Therefore I’m using the gleSpiral routine with the differential affine matrix “dXformdTheta” for scaling. It should scale my contour over the sweep angle. This is what I get:
http://s1.directupload.net/file/d/1458/gnwiwy5i_png.htm

So I have theta, a1, b1, a2, b2 and the slope, but I can’t calculate sx and sy correctly, so the cross sections can fit together. Does anyone have an idea how to calculate the matrix using the given variables??

I hope this is the right place for my question, since it is a math problem…

Ivan