From: ian Date: Sat, 2 May 2009 16:34:04 +0000 (+0000) Subject: slope templates X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=c59842c5ab2f7faeebcca1c4dd9f70a5a17c1d89;p=trains.git slope templates --- diff --git a/layout/slopeguide.ps b/layout/slopeguide.ps new file mode 100644 index 0000000..1faf711 --- /dev/null +++ b/layout/slopeguide.ps @@ -0,0 +1,84 @@ +%! + +% convert coordinates to mm +% from bottom left corner of landscape +72 25.4 div dup scale +90 rotate +0 -210 translate + +0.05 setlinewidth + +/Times-Roman findfont 5 scalefont setfont + +10 10 moveto ($Id$) show + +15 30 translate + +/sbuf 10 string def +/i2s { 10 sbuf cvrs } def + +/xmax 260 def +/changein 160 def + +/title { + 0 exch moveto + (0 to ) show + slope i2s show (% in ) show + changein i2s show + (mm) show +} def + +/do { + /slope exch def + + 2 title + -9 title + + 0 1 xmax { + /x exch def + newpath + x 0 moveto + 0 1 rlineto + stroke + } for + + 0 10 xmax { + /x exch def + newpath + x 0 moveto + 0 -2.5 rlineto + stroke + + x -4 moveto + x i2s show + } for + + 0 1 10 { + neg /y exch def + newpath + 0 y moveto + xmax 0 rlineto + stroke + } for + + /afterchange slope changein 0.005 mul mul def + + 0 0 moveto + 0 0.5 changein { + /x exch def + /y x changein div dup mul afterchange mul def + x y lineto + } for + /y xmax changein sub slope 0.01 mul mul afterchange add def + xmax y lineto + stroke + + newpath + changein 0 moveto + 0 afterchange rlineto + stroke + + 0 22 translate +} def + +0.5 0.5 4 { do } for