Page 1 of 1

Spline from Fit Points in Code

Posted: Tue Feb 10, 2015 10:31 pm
by wildspidee
Andrew,

I can't seem to locate anything on drawing a Spline from fit points (as opposed to control points). I currently have some control point splines such as :

Code: Select all

var sleeveCapB = new RSpline([mA,mI,m3,mH,mE],2);
This works beautifully, of course. However, I have some splines that need to use fit points. I realize this is a Pro feature, but I am asking those that will be using my plug-in to purchase Pro. I won't develop or test in the unpaid version.

Thanks,

Lori

Re: Spline from Fit Points in Code

Posted: Tue Feb 10, 2015 10:52 pm
by andrew
There is no direct constructor for splines with fit points (QCAD wouldn't know which type is meant).

Instead, you can set the fit points for a spline after creating it:
var spline = new RSpline();
spline.setFitPoints([p1,p2,p3,...]);
Splines from fit points are always cubic (3rd degree splines).