From ec7eae75af87bf2f40dbc4993d81650cd78d896a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Dec 2020 23:26:04 +0000 Subject: [PATCH] working divconv --- pumpkin-books.ps | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pumpkin-books.ps b/pumpkin-books.ps index c8102a7..d1be66b 100644 --- a/pumpkin-books.ps +++ b/pumpkin-books.ps @@ -5,33 +5,36 @@ 0 0 0 setrgbcolor 1 setlinewidth -/tw 115 def +/tw 57.5 def /th 73 def /bdiag 5 def -/diagconv { % xprop(-1..+1) yprop(0..1) +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 % y x-width-at-this-height xprop - 1 add 0.5 mul % y x-width-at-this-height xprop-adj(0..1) - mul % y x + tw add % y xprop x-width-at-this-height + exch mul % y x-width-at-this-height xprop exch % x y } def -0 0 moveto -tw 0 lineto -tw bdiag sub th lineto -bdiag th lineto +newpath +tw neg 0 moveto +tw 0 lineto +bdiag neg th rlineto +bdiag tw sub th lineto closepath stroke -tw 0.5 mul 0 moveto +newpath +0 0 moveto 0 th rlineto stroke /thirddivline { % xprop + newpath dup 3 div 0 diagconv moveto - 3 div 0.8 diagconv lineto stroke + 3 div 0.4 diagconv lineto stroke % } def -- 2.30.2