home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 June
/
PCWorld_1998-06_cd.bin
/
software
/
Programy
/
ARCADEA
/
DEMO30
/
MACROS.Z
/
SPRING.d3m
< prev
next >
Wrap
Text File
|
1997-04-15
|
2KB
|
76 lines
input "how many loops? (0 to 20): ", nrev
sangle = nrev * 360
input "how many cross-section copies per loop? (1 to 20): ", ncrev
ncpy = abs(ncrev * nrev)
if ncpy > 198 then
message "Limit exceeded. Reduced copies per loop to ", 198/nrev
ncpy = 198
end if
size1:
input "radius of wire: ", rwire
input "distance between center of each loop: ", revoff
offst = abs(revoff*nrev)
if rwire > revoff/2 then
message "wire radius too large for given distance: try again"
goto size1
end if
size2:
input "radius of spring (to center of wire): ", rcoil
if rwire > rcoil then
message "wire radius larger than spring radius: try again"
goto size2
end if
dir:
input "axial direction (X, Y, or Z):", adir$
axoff = 0
ayoff = 0
azoff = 0
if adir$ = "X" or adir$ = "x" then axoff = 1
if adir$ = "Y" or adir$ = "y" then ayoff = 1
if adir$ = "Z" or adir$ = "z" then azoff = 1
input "radial direction (X, Y, or Z): ", rdir$
xroff = 0
yroff = 0
zroff = 0
if rdir$ = "X" or rdir$ = "x" then xroff = 1
if rdir$ = "Y" or rdir$ = "y" then yroff = 1
if rdir$ = "Z" or rdir$ = "z" then zroff = 1
if (axoff=1 and xroff=1) or (ayoff=1 and yroff=1) or (azoff=1 and zroff=1) then
message "axial and radial directions must be different. Try again..."
goto dir
end if
sys(1) = 0
'message "about to set point"
set:
setpoint "Set a point for the first point on the axis: " 1
if sys(1) < 1 then goto set
pointval xc yc zc 1
'message "point recognized:", xc, yc, zc
sys(1) = 0
>circle
{
<type 2
<pointxyz [xc + xroff*rcoil, yc + yroff*rcoil, zc + zroff*rcoil]
<pointrel [xroff*rwire, yroff*rwire, zroff*rwire]
<pointrel [axoff, ayoff, azoff]
}
>3dselectmode
{
}
>pointselect
{
<pointxyz [xc + xroff*rcoil, yc + yroff*rcoil, zc +zroff*rcoil]
}
>sweep
{
<axis [ayoff*1 + azoff*2]
<ncopy [ncpy]
<angle [sangle]
<offset [offst]
<pointxyz [xc, yc, zc]
}