The structure is represented with three faces of a box printed with different shades of black. The program has four procedures. One procedure for each face and a main procedure calling these three procedures. The main procedure takes one pair of coordinates in two dimensional space as an input. These are is the upper right coordinates of the front face of the box. Then the procedures drawing the faces are called one by one and the faces filled. This is done for all the boxes starting at the back of the structure and moving towards the front. Some lines representing the coordinate system are also printed.
%!
/b1 {newpath % Draw a closed path around an area
0 0 moveto % according to a front face. The line
-0.98 0.17 rlineto % are drawn from the current point.
0.00 -1.00 rlineto
0.98 -0.17 rlineto
closepath
} bind def
/b2 {newpath % Draw a closed path around an area
0 0 moveto % according to a side face. The line
0.00 -1.00 rlineto % are drawn from the current point.
0.64 0.54 rlineto
0.00 1.00 rlineto
closepath
} bind def
/b3 {newpath % Draw a closed path around an area
0 0 moveto % according to a top face. The line
0.64 0.54 rlineto % are drawn from the current point.
-0.98 0.17 rlineto
-0.64 -0.54 rlineto
closepath
} bind def
/b {gsave % Save stack
translate % Change the current point
1 setgray
b1 fill % Draw lines and fill the faces
0.5 setgray
b2 fill
0 setgray
b3 fill
grestore
} bind def
300 400 translate % Origo in the paper plane
2.6 2.6 scale % Size of boxes
0.005 setlinewidth % Thickness of lines
45.7 53.9 b 45.9 53.8 b % Draw box at (45.7,53.9) and (45.9,53.8)
46.2 53.8 b 46.4 53.7 b % Continue with boxes until finished
46.7 52.4 b
showpage % Make hardcopy of page