tw 0 translate
-/diagconv { % xprop yprop
- dup th mul % xprop yprop y
- 3 1 roll % y xprop yprop
- bdiag mul neg % y xprop x-margin-at-this-height
- tw add % y xprop x-width-at-this-height
- exch mul % y x-width-at-this-height xprop
- exch % x y
+% diagonal conversion
+/dc { % xprop yprop
+ dup th mul % xprop yprop y
+ 3 1 roll % y xprop yprop
+ bdiag mul neg % y xprop x-margin-at-this-height
+ tw add % y xprop x-width-at-this-height
+ exch mul % y x-width-at-this-height xprop
+ exch % x y
} def
newpath
-tw neg 0 moveto
-tw 0 lineto
-bdiag neg th rlineto
-bdiag tw sub th lineto
+-1 0 dc moveto
++1 0 dc lineto
++1 1 dc lineto
+-1 1 dc lineto
closepath stroke
newpath
/thirddivline { % xprop
newpath
- dup 3 div 0 diagconv moveto
- 3 div 0.4 diagconv lineto stroke
+ dup 3 div 0 dc moveto
+ 3 div 0.4 dc lineto stroke
%
} def