Qcad's Spline algorithm

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

Moderator: andrew

Post Reply
trongdong
Newbie Member
Posts: 4
Joined: Mon Jan 12, 2015 8:06 am

Qcad's Spline algorithm

Post by trongdong » Tue Jul 21, 2015 4:18 pm

Hi there,
At the moment we are using QCAD Pro (latest version). We developed a calc engine, which create entities in python code, and then compile it to DXF file using QCAD.
We have a problem with spline. Since, in python code, we use interpolation from scipy package.
http://docs.scipy.org/doc/scipy/referen ... olate.html
http://docs.scipy.org/doc/scipy/referen ... nterpolate

The problem is it doesn't give us the correct spline that appears in qcad. So, what's the algorithm did you use to build that spline?
Thank you very much!

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

Re: Qcad's Spline algorithm

Post by andrew » Tue Jul 21, 2015 6:26 pm

I assume you are referring to splines created from fit points (points that are on the spline curve).

There are various different algorithms for spline fitting. QCAD Professional uses the Teigha libraries to do the spline fitting exactly in the same way as Autocad and compatible products do it. I honestly do not know what kind of algorithm Teigha or Autocad use internally. But perhaps this is a new lead to follow..

trongdong
Newbie Member
Posts: 4
Joined: Mon Jan 12, 2015 8:06 am

Re: Qcad's Spline algorithm

Post by trongdong » Wed Jul 22, 2015 2:20 am

Hi Andrew,
Thanks for reply. Does that Teigha Libraries support us to calculate the length of spline and give exactly answer as qcad does?

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

Re: Qcad's Spline algorithm

Post by andrew » Wed Jul 22, 2015 8:49 am

You can use RSpline::getLength() to get the approximate length of the spline (based on interpolation).

Post Reply

Return to “QCAD Developers and Contributors”