size 22 22

! funky LaTeX commands
begin texpreamble
    % set fonts used for text and maths to Palatino
    \usepackage{mathpazo}
    \renewcommand{\familydefault}{ppl}
    \usepackage{upgreek}
    \usepackage[load-configurations=abbreviations]{siunitx}
end texpreamble

set hei 1.0
set lwidth 0.05

set texscale scale

set just center

a=0.6
b=0.25
c=5
xx=1
yy=1
al=3

shi=12
k=1


sub minus x y z 
    x=k*x
    y=k*y
    z=k*z
    amove xx+c*(x+a*z) yy+c*(y+b*z)
    begin origin
    !amove 0 -al/2
    !rline 0 al arrow end 
    amove 0 0
    circle 0.15*c fill yellow
    rmove 0 -0.5
    set lwidth 0.08
    rline 0 1 arrow end
    set lwidth 0.05
    end origin
end sub


sub plus x y z 
    x=k*x
    y=k*y
    z=k*z
    amove xx+c*(x+a*z) yy+c*(y+b*z)
    begin origin
    !amove 0 -al/2
    !rline 0 al arrow end 
    amove 0 0
    circle 0.15*c fill purple
    set color white
    rmove 0 -0.5
    set lwidth 0.08
    rline 0 1 arrow start
    set lwidth 0.05
    set color black
    end origin
end sub


sub lines z
    set lwidth 0.2
    for i=0 to 1
    x=i
    amove xx+c*k*(x+a*z) yy+c*k*(0+b*z)
    aline xx+c*k*(x+a*z) yy+c*k*(1+b*z)
    next i
    for i=0 to 1
    y=i
    amove xx+c*k*(0+a*z) yy+c*k*(y+b*z)
    aline xx+c*k*(1+a*z) yy+c*k*(y+b*z)
    next i
    set lwidth 0.05
end sub

sub lines2 z
    set lwidth 0.2
    for i=0 to 1
    for j=0 to 1
    x=i
    y=j
    zz=z-0.1
    amove xx+c*k*(x+a*zz) yy+c*k*(y+b*zz)
    zz=z-1.0
    aline xx+c*k*(x+a*zz) yy+c*k*(y+b*zz)
    next j
    next i
    set lwidth 0.05
end sub

yy=yy+shi

@lines 1
@plus 0 0 1
@plus 1 0 1
@minus 0 1 1
@minus 1 1 1
@lines2 1

@lines 0.0
@plus 0 0 0
@plus 1 0 0
@minus 0 1 0
@minus 1 1 0

rmove -1 3
text \tex{(a) type A}


xx=xx+shi

@lines 1
@minus 0 0 1
@plus 1 0 1
@minus 0 1 1
@plus 1 1 1
@lines2 1

@lines 0.0
@plus 0 0 0
@minus 1 0 0
@plus 0 1 0
@minus 1 1 0

rmove -1 3
text \tex{(b) type C}


xx=xx-shi
yy=yy-shi

@lines 1
@minus 0 0 1
@plus 1 0 1
@plus 0 1 1
@minus 1 1 1
@lines2 1

@lines 0.0
@plus 0 0 0
@minus 1 0 0
@minus 0 1 0
@plus 1 1 0

rmove -1 3
text \tex{(c) type G}


xx=xx+shi

@lines 1
@plus 0 0 1
@minus 1 0 1
@minus 0 1 1
@plus 1 1 1
@lines2 1

@lines 0.0
@plus 0 0 0
@plus 1 0 0
@minus 0 1 0
@minus 1 1 0

rmove -1 3
text \tex{(d) type E}