Elastica script

 From:  bemfarmer
7001.17 In reply to 7001.16 
Organizing thoughts:

Notes on bug(s) in Elastica2 script.

The Elastica2 script creates 7 of the 9 elastica curves.
The circle, and the line elastica are not created by the script.
The elastica curve created is based upon the Shape parameter, U.value.
The Shape slider ranges from -2 to 0.99999.
A circle would need a U.value of -infinity,
and a line would need a U.value of 1.0. But max U.value is set to 0.99999.

Based upon the Shape parameter, U.value, the
script mathematics culminates in an initial curve, with final point:
var pt = cplane.evaluate( x, y, z ); in world coordinates.
Except for the (half) curve created by U.value of -1.0, the initial curve
is one quarter of the final elastica curve.
The U.value of -0.65223... creates a "figure 8" final elastica curve.

The initial quarter curve can be created in any one of the 7 MoI views,
3D, Top, Bottom, Front, Back, Right, Left.
Using two mirrors, and/or rotation, the initial curve becomes 4 curves, which are joined to become one final elastica curve.

One bug results in an error message, re: Frames in MoI3, for some point selections at some U.values. (Especially for a point with 2 equal
coordinate values.) (Does not always happen. Might be a cleanup problem?)
The second bug has half of the final curve at strange angles, mostly for
points with non-zero third coordinate value. (Occasionally for third coordinate of zero. The strange angles are not the same for different
positions of the initial picked point.

The 3D view has characteristics like a Top View.
Top, Front, and Right views have different x, y, and z axis pairs,
So World coordinate Frames for mirror1 and mirror2, and rotate will be set up for each View Case.
Using Cases should eliminate the bugs.
Another goal is to revert most of the javascript code to the .js file, from the .htm file. (An old Max technique.)
Beginning with MoI4, the .js file is as fast as placing script in the .htm file.

mirror1 Frame is done with base point at the initial picked point.
mirror2 Frame is done with base point at the quarter curve end point.
rotate Frame is done with base point at the initial picked point.
join is also done.

- Brian