From: Ian Jackson Date: Wed, 2 Dec 2020 23:37:55 +0000 (+0000) Subject: more divconv X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=051fcb0a3775d30650e2a985972d19106ce5e3a5;p=quacks.git more divconv --- diff --git a/pumpkin-books.ps b/pumpkin-books.ps index d1be66b..e97bdf1 100644 --- a/pumpkin-books.ps +++ b/pumpkin-books.ps @@ -11,20 +11,21 @@ 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 @@ -33,8 +34,8 @@ 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