this is the error message I get:
Code: Select all
TypeError: Result of expression 'tw' [3] is not a function.I'm using QCAD Version: 3.24.3.0 (3.24.3) on a Windows 11 Pro system.
Below is my code - the function is called tw()
Thanks for any help or insight.
=HS
Code: Select all
function tw(angle, we, ws, steps) { // provide trace width for given angle; Note
tw = ws + ((we-ws)/steps)*angle;
return tw;
}
var rs = 15; // start radius (inner most line)
var ws=20; // trace width begin
var we=3; // trace width end (of 2*pi*N)
var g=1; // gap between traces
var N=2; // Number of turns
var steps=100; // steps per 2*pi*N
var aDelta = 2 * Math.PI * N / steps;
var wDelta = (we-ws)/steps;
re= 2*tw(steps, we, ws, steps) + 2*g; // function works here
var r1Delta = (re-rs)/steps; //
r1=rs;
a=0;
for (var n=0; a<(2*Math.PI * N); n+=1) {
a = (2 * Math.PI * N / steps)*n;
xd = 2*tw(steps, we, ws, steps) + 2*g; // function doesn't work inside for loop.
// inner most line
}