Spline from Fit Points in Code

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
wildspidee
Full Member
Posts: 84
Joined: Sat Nov 03, 2012 2:00 am

Spline from Fit Points in Code

Post by wildspidee » Tue Feb 10, 2015 10:31 pm

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

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Re: Spline from Fit Points in Code

Post by andrew » Tue Feb 10, 2015 10:52 pm

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).

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”