Polynomial Knot script

 From:  bemfarmer
5279.1 
Attached is a simple script to create two Knots, as in tying a rope.
The ends are not connected.
The script only does the two simplist knots at present. Another 33 could be added.
It is a bit hard, but it is possible to place a sweep circle perpendicular to the curve. I used a line segment tangent to
the curve near the origin, to help MoI place the circle perpendicular.



Michael, is there a way to "rename" the function that is called to evaluate x, y, and z point values, depending on
the build type? Currently, I have the If knottype (buildtype) statement inside the for loop, a poor location.
code/ if ( knottype == '3_1' )
{
var pt = EvalPolyKnot3_1( t2, len, mir );
}

if ( knottype == '4_1' )
{
var pt = EvalPolyKnot4_1( t2, len, mir );
}

I would like to place the If Else statements outside of the for loop, and have them "rename" the EvalPolyKnotxxx, in the for loop,
to the correct function to use to calculate the control points of the curve.

Thank you.





This script came about as a result of the Belt post, and uses Michael's Lineweb and ToroidalHelix scripts "formats."
http://www.m-hikari.com/ijma/ijma-password-2009/ijma-password5-8-2009/prabhakarIJMA5-8-2009-1.pdf

EDITED: 8 Nov 2012 by BEMFARMER