Hi..
I hope this is the right place in the qcad forum to make this contribution.
If not, please point me to the right place.
I used a spline in qcad 3.12.6 with 7 points.
In the properties editor -> degree i could choose between 1 to 6 degree.
The drawing showed a difference between selecting 1, 2 .. 6 degree.
I choose 5.
Then i saved the drawing, closed the drawing, and opened the drawing again.
The something strange happened.
The DEGREE of the spline was changed from 5 to 3 .
The drawing showed the result of 3 degree.
The setting 5 degree was lost.
Then i downloaded the source code to see what happened.
I am a low level hobby programmer, with no experience in programming QCAD.
So it could be i did something stupid )
In qcad-3.12.6.0/src/io/dxf/RDxfImporter.cpp
In:
void RDxfImporter::addSpline(const DL_SplineData& data) {
i changed the line :
if (data.degree<=1 || data.degree>3)
To :
if (data.degree<=1 || data.degree>= data.nControl )
Now it looks like qcad spline can remember the 5 degree.
It seems to work fine.
Is this a correct code change ?
I do not understand why spline first offered one less degree then then number of points.
Is this somehow needed ?
I toke data.nControl to limit the degrees, is this right or wrong ?
Does this solution break some international dxf definition or something ?
What do i know
Vroemm.
spline 3 degree limit ? Bug ?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: spline 3 degree limit ? Bug ?
Thanks. Yes, that check is obsolete. I think it's better not to check the degree at that point at all. The spline will simply fail to render at a later stage if it is invalid.
Commit:
https://github.com/qcad/qcad/commit/30e ... b0aa64322a
Commit:
https://github.com/qcad/qcad/commit/30e ... b0aa64322a
A spline by definition always needs at least degree+1 control points.I do not understand why spline first offered one less degree then then number of points.
Re: spline 3 degree limit ? Bug ?
Thanks..
It feels good to contribute something to QCAD.
A smile on my face and a warm feeling..
Vroemm.
It feels good to contribute something to QCAD.
A smile on my face and a warm feeling..
Vroemm.