Page 1 of 1

Angle at spline

Posted: Mon Aug 05, 2019 11:52 am
by CVH
Win7pro Qcad3.23pro wininstaller 32bit

Refering to the spline in the attached file, just any spline.

[code]
// with entity isspline
var shape = entity.castToShape();
var aaa = shape.getAngleAt(12.200,RS.FromStart);
// OR
var castPoint = shape.getPointWithDistanceToStart(12.200);
var bbb = shape.getAngleAtPoint(castPoint);
[/code]

Angle aaa differs with bbb with a small amount up to 0.1 degree.
I can't find the source of that even with all scripts loaded to my script folder.
In the debugger the differences come from 'native code'.

Graphing them shows a periodic nature. A higher frequency and an lower one.
See screengrab: 1/2 period at low frequency & 11 periods of about 5 units.

I am intrigued with the source for that.
I persume Qcad uses biarc poly intermediate to do the math.
And as there is a proven flaw with the biarcs I am troubled.
https://qcad.org/rsforum/viewtopic.php?&t=4859

Can you point out the better solution?

Regards

PS The layer 'Rope' is a sneak preview for what I need the tangent at a point.
Bending the rope.