% name of textfile: Pxx Tunacan Revisited(DL/Synergetics Feb 02 v1.0) % .... % ========= % This file requires the previous download of gonzo.ps % available from http://www.tinaja.com/post01.asp % Make sure the following line agrees with your gonzo.ps location % Use DOUBLE SLASHES anytime you want a single slash in a PS string. (C:\\windows\\desktop\\gonzo\\gonzo.ps) run % use internal gonzo % ========== gonzo begin gutility begin printerror nuisance begin % Rewritten code does the tuna can transform 100 100 10 setgrid 26 17 showgrid % tuna transform is % tilt constant k = (D/2) sin (theta) % x' = (D/2) sin (114.591 x/D) % y' = y - k cos (114.591 x/D) /tiltangle 18 def % forward tilt angle /diam 20 def % major can diameter /magick diam 2 div tiltangle sin mul def % special numble /xtransform { /xx exch store % MUST save for y!!!! diam 2 div 114.591 xx mul diam div sin mul } def /ytransform { /yy exch store yy magick 114.591 xx mul diam div cos mul sub } def % these procs can be rewritten to do most nonlinear transforms... /movetoproc {moveto} def /linetoproc {lineto} def /curvetoproc {curveto} def /closepathproc {closepath} def % initial movetoproc converts to a cruvetrace to try and minimize % corner cutting. Long horizontal lines should be done in segments. /movetoproc { 2 copy /lastymt exch store /lasty lastymt store % save close and cp /lastxmt exch store /lastx lastxmt store exch xtransform exch ytransform % x must go first! /moveto cvx} def /linetoproc { /y3 exch store /x3 exch store x3 lastx sub 3 div lastx add xtransform y3 lasty sub 3 div lasty add ytransform x3 lastx sub 3 div 2 mul lastx add xtransform y3 lasty sub 3 div 2 mul lasty add ytransform x3 dup /lastx exch store xtransform % save for currentpoint y3 dup /lasty exch store ytransform /curveto cvx } def /curvetoproc {/y3 exch store /x3 exch store % can use stack roll - nonobvious /y2 exch store /x2 exch store /y1 exch store /x1 exch store /lasty y3 store /lastx x3 store x1 xtransform y1 ytransform x2 xtransform y2 ytransform x3 xtransform y3 ytransform /curveto cvx } def /closepathproc { lastxmt lastx sub 3 div lastx add xtransform lastymt lasty sub 3 div lasty add ytransform lastxmt lastx sub 3 div 2 mul lastx add xtransform lastymt lasty sub 3 div 2 mul lasty add ytransform lastxmt xtransform lastymt ytransform /curveto cvx /closepath cvx } def % final close should be zero /remapit { mark {movetoproc} {linetoproc} {curvetoproc} {closepathproc} pathforall ] newpath dup == cvx exec } def /fudge 3.1415926 2 div store % distance around can to diameter /can { -10 fudge mul 0 mt 6 pu 10{2 fudge mul pr } repeat 6 pd 10{2 fudge mul pl } repeat closepath remapit gsave aqua 0.65 setgray fill grestore line2 stroke } def /lid { 0 6 mt 30 {2 fudge mul pr} repeat remapit gsave aqua 0.8 setgray fill grestore line2 stroke } def /label {-10 1.2 mt 3.5 pu 10 {2 pr} repeat 3.5 pd 10 {2 pl} repeat closepath remapit gsave 0.9 1 0.8 setrgbcolor white fill grestore line2 stroke } def /lettering { /font1 /StoneSans-Bold 5 gonzofont /font1 /StoneSerif-Bold 2.7 gonzofont font1 % -9.6 10 moveto (FREE FONT) false charpath remapit /kernadj {0.18 0 rmoveto} store -8.9 2 moveto (F) false charpath kernadj (R) false charpath kernadj (E) false charpath kernadj (E) false charpath kernadj ( ) false charpath kernadj (F) false charpath kernadj (O) false charpath kernadj (N) false charpath kernadj (T) false charpath remapit black fill % black line1 stroke } def /drawatunacan {gsave translate can lid label lettering grestore} def 13 5 drawatunacan showpage % eof