[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [femm] [How can I use "sine function" in lua script?]



Here is a small piece of a program I wrote to draw astator and a rotor.  The problem I ran into at the end is in setting the boundary conditions.  There is a round off error that cause the boundaries to not be recognized.  I wrote the program to loop through the drawing program for a section. In the end I had to copy and rotate the points and lines on the boundary to obtain usable boundaries.

-- draw rotor
n24x = RIr
n24y = 0
addnode(n24x,n24y) -- inside right boundary of rotor
n25x = RIr * cos(a_total)
n25y = RIr * sin(a_total)
addnode(n25x,n25y) -- inside left boundary of rotor
addarc(n24x,n24y,n25x,n25y,a_total,.85) -- rotor inner radius
nRx = RIr * cos(a_total/2) --add boundry
nRy = RIr * sin(a_total/2)
selectarcsegment(nRx,nRy)
setarcsegmentprop(1,"radii",0,Sgrp) -- boundry inside of rotor ID
clearselected()