require KPbuild 4040

if par5 != 16052253 then <magnetic1-init.kps

silent=t
verbose=f

scale = \rr[.23/.42]
rota x \rr[360]

field type mag trace grid npoint 108 step .1 gsize 10 ncell 4

mode sF
cyl=.2
knot
force 1
coll a
go

txt clobber on
txt centre
txt font 4
txt fill off
txt c -20 "Magnetic Field"
txt font 3
txt c a "(unfinished demo)"

txt fcolour hsv:102.2/.4/.4 .6
txt font 2
txt lineskip -24
txt fill on
txt right


txt -20 20 "Unknot" "func exec 10"
txt -20 a "Hopf Link" "func exec 9"
txt fill off
txt -20 a "Presets:"



spec orient
3dop colo #f00

select action 0 "click to reverse current" "revb 0"
select action 1 "click to reverse current" "revb 1"
select action 2 "click to reverse current" "revb 2"
select action 3 "click to reverse current" "revb 3"
select on
txt on

silent=f

echo
echo " *** Click on a component to reverse direction of current"
echo "     (arrow indicates direction)"
echo
