-/draw_beam % width slope thick
-{
- 2 div /beam_thick exch def
- /beam_slope exch def
- /beam_wd exch def
- beam_slope beam_wd mul /beam_ht exch def
- 0 beam_thick neg moveto
- beam_wd beam_ht rlineto
- 0 beam_thick 2 mul rlineto
- 0 beam_thick lineto
- closepath fill
+/skeel { scale } bind def
+% FIXME. translate to middle of box.
+% Nice rectangle with rounded corners
+/draw_box % breapth width depth height
+{
+ currentdict /testing known {
+ %% real thin lines for testing
+ /blot 0.005 def
+ }{
+ /blot blot-diameter def
+ } ifelse
+
+ 0 setlinecap
+ blot setlinewidth
+ 1 setlinejoin
+
+ blot 2 div sub /h exch def
+ blot 2 div sub /d exch def
+ blot 2 div sub /w exch def
+ blot 2 div sub /b exch def
+
+ b neg d neg moveto
+ b w add 0 rlineto
+ 0 d h add rlineto
+ b w add neg 0 rlineto
+ 0 d h add neg rlineto
+
+ currentdict /testing known {
+ %% outline only, for testing:
+ stroke
+ }{
+ closepath gsave stroke grestore fill
+ } ifelse
+} bind def
+
+% Nice beam with rounded corners
+/draw_beam % slope width thick
+{
+ currentdict /testing known {
+ %% real thin lines for testing
+ /blot 0.005 def
+ }{
+ /blot blot-diameter def
+ } ifelse
+ blot setlinewidth
+
+ 0 setlinecap
+ 1 setlinejoin
+
+ blot sub /t exch def
+ blot sub /w exch def
+ w mul /h exch def
+
+ blot 2 div t 2 div neg moveto
+ w h rlineto
+ 0 t rlineto
+ w neg h neg rlineto
+ 0 t neg rlineto
+
+ currentdict /testing known {
+ %% outline only, for testing:
+ stroke
+ }{
+ closepath gsave stroke grestore fill
+ } ifelse