Preliminarily, I was thinking of something like this, based upon mouse input, with modifed SketchCurve.js :
(I'm sure my code is probably very messed up.) :-)
code:
function DoFairCurve()
{
var ui = moi.ui;
var pointstreampicker = ui.createPointStreamPicker();
//Delete: var curvefactory = moi.command.createFactory( 'sketchcurve' );
//Delete: pointstreampicker.bind( curvefactory );
while ( 1 )
{
if ( !pointstreampicker.waitForEvent() )
return;
if ( pointstreampicker.event == 'finished' )
break;
}
//Delete: curvefactory.commit();
var numPts = pointstreampicker.numPoints;
for ( var i=0; i < numPts; i++ )
{
var point = pointstreampicker.getPoint[i];
/*
Save the points in array or something.
Manipulate the points to make a "fair, high-quality" curve, with
clothoids, etc. somehow, in javascript.
Save the modified curve as a Nurbs control point curve.
*/
}
}
DoFairCurve();
Or the input curve could be a curve on the screen, created some way other than with mouse trace...
|