If I type addArc(10,10,100,1.5,3) at the command line of the script shell I get an arc of radius 1.74 (wrong), starting at 1.5 degrees (wrong, =value treated as a degrees value where it should be treated as radians) and ending at 171 degrees. The addCircle command has a similar radius parameter but gets it right.
Also, if I enter an undefined parameter, e.g. addArc(10,10,100,1.5, end) where "end" is declared but has no value assigned, the error text is confused, viz:
ecma> addArc(10,10,100,1.5, end)
Error: -1: RArc(): no matching constructor found. <native>(10, 10, 1.7453292519943295, 0.02617993877991494, undefined) at -1 addArc(center = 10, radius = 10, startAngle = 100, endAngle = 1.5, reversed = undefined) at :/scripts/simple_create.js:195 <eval>() at 1 <native>('js', 'addArc(10,10,100,1.5, end) ') at -1 <anonymous>(expression = 'addArc(10,10,100,1.5, end) ') at :scripts/Misc/MiscDevelopment/EcmaScriptShell/EcmaScriptShell.js:349 <anonymous>(command = 'addArc(10,10,100,1.5, end)') at :scripts/Misc/MiscDevelopment/EcmaScriptShell/EcmaScriptShell.js:256 <native>() at -1 main() at :scripts\autostart.js:826 <global>() at :scripts\autostart.js:839
This happens both on my PC (Windows 10, x86, QCAD 3.24.2) and macBook (macOS 10.15, QCAD 3.24.2)
Radius and angle issues with addArc
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: Radius and angle issues with addArc
AddArc is a function in simple_create.js
Apart from that you are missing 'reversed' in your trial code.
Usage is:
* addArc(cx,cy, radius, startAngle, endAngle, reversed)
* addArc([cx,cy], radius, startAngle, endAngle, reversed)
* addArc(new RVector(cx,cy), radius, startAngle, endAngle, reversed)
With 5 entrys it is required that the first one is an array or an RVector.
The functions of simple_create.js use degrees for angles.
Regards,
CVH
Apart from that you are missing 'reversed' in your trial code.
Usage is:
* addArc(cx,cy, radius, startAngle, endAngle, reversed)
* addArc([cx,cy], radius, startAngle, endAngle, reversed)
* addArc(new RVector(cx,cy), radius, startAngle, endAngle, reversed)
With 5 entrys it is required that the first one is an array or an RVector.
The functions of simple_create.js use degrees for angles.
Regards,
CVH
Re: Radius and angle issues with addArc [SOLVED]
Thanks, CVH. That's now working for me. I just wish I could have found that in the documentation!