The script for chain

 From:  bemfarmer
6087.67 
Implemented the option to Twist the individual chain links.

Note that some trial and error, guided by the many helpful explanations of Michael, was necessary in order to discover
that Input "0" of the Twist factory would work with sweeplist, from var sweeplist = sweepfactory.calculate();,
but would not work with link1, from var link1 = sweeplist.item(0);.
Also, it was not necessary, in this case anyway, to add sweeplist to the moi.geometryDatabase with moi.geometryDatabase.addObjects( sweeplist );.

As an alternative test, the rail based upon a rounded rectangle worked well with the Twist factory, and would be another way to Twist the first chain link.
Twisting the rail is not done in the current version of the script.

There are several possibilities for the Twist axis. The one used seemed to look well.

The script worked well on one test 3d curve.


ArrayGem in 3d would need a surface for normal.
Chopping the curve up into points which are equally spaced in space, not necessarily equally spaced along the curve, and then
doing a copy to two points is another possibility, but probably needs normal also, in 3D.

This completes the chain script, for now.

I should probably delete old versions...?

- Brian