Script for Curvature Calculation

 From:  bemfarmer
6634.9 
Outline of proposed modifications to Karsten's CCC script, for faster htm processing.

(All constructive criticism and comments welcome :-)

Note that the .htm script runs in a different (lesser / less escape-able/ ...) processing environment than .js script code.

By bemfarmer April 21, 2014.

After numerous trials, as far as I can tell, only one objectList, or factory, or array,
can be returned by a function in .htm script, to the .js script. (True for javascript in general...)
If additional such items or geometric objects are created in the .htm script, they are not recognized in the .js script, for update purposes. (Not sure about global variables?)

So the three factories, (or their results), acFactory, lFactory, and plFactory, must have their associated .htm functions called separately. Four main .htm functions are proposed in the following outline, with the first two returning point arrays, the third returning lines object list, and the last an interpcurve curve.

1. function getacpoints( Curve, NumItems )
returns ptx, an array of points on the curve, using acFactory.
These points will be use later, in the calculations.
Also, excepting the first and last point, these points will be used later, as the start points of the lines which represent curvature K, or radius.

2. function getplpoints( ptx, analyse_as, scalefactor )
returns plpoints, an array of the scp points, by calculations.
These points will be used later, as the end points of the lines, and also for an interpcurve.

3. function getLines( ptx, plpoints )
returns linesList, an object list of the lines. (or else return the line array.)

4. function getplcurve( plpoints )
returns plcurve, an interpcurve. (Or objectList...)

Note that the clone of ptx, the pts array, is not being used, as far as I can tell.

- Brian

EDITED: 22 Apr 2014 by BEMFARMER