UnwrapCurve node, with majority of the code from UnwrapCurve script of Michael, made compatible with nodeeditor.
Learned that script (sub) functions are located in nodeeditor basicFunctions.js. LengthSq was not in there,
but magnitude(vec) was, as well as normalizeVec(vec) and scaleVec(vec,factor).
dir.scale( 1.0 / magnitude(dir) ); code did not work properly, (Lines and curves had Unwrap length squared, but circles and stars yielded the correct Unwrap length.)
but, dir = scaleVec( dir,1/magnitude(dir) );, did work properly.
(Limited testing)
There is no code to restrict input to curves...
- Brian
|