From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <38d44a937853b7d7c9a875c3d90461db@quintile.net> Date: Tue, 24 May 2011 12:22:49 -0400 Message-ID: Subject: Re: [9fans] pic From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: e8d1c668-ead6-11e9-9d60-3106f5b1d025 >> Otherwise, I've found that it is always worth the time to >> program the drawings (pic macros, postscript functions, >> metapost, whatever), because then editing them is possible. > > out of interest, which of these do you use yourself by preference? I don't think I have one that I would say I prefer, but they're all preferable to using a WYSIWYG editor and then having to go back and change all the diagrams in the same way. > http://2.bp.blogspot.com/_ZnVhQ3NyEx0/S4NfiL9UgZI/AAAAAAAAAB0/mW2hZr-Ay5k/s400/gorace4.png > > getting those curves right can't be that easy if you're working > out the parameters manually, and doing the collision avoidance > programmatically can't be too easy either... This was pic, with copy-and-paste but only around 60 lines. It's a one-off. .sp .PS .fp 5 CW LucidaSansCW83 texty=0.015 dx=0.3 dy=0.3 "\X'PS 4 setlinewidth'" "\f5" rx=0.015 boxwid=0.4 boxht=0.15 IP: [ Box: box ht 3*boxht line from 0.333 to 0.333 line from 0.667 to 0.667 Ptr: circle fill rad 0.01 at 0.167 "0" at 0.5 "7" at 0.833 "\s-2\fIptr \fP\s+2" rjust at 0.833-(rx,texty) "\s-2\fIoff \fP\s+2" rjust at 0.5-(rx,texty) "\s-2\fIlen \fP\s+2" rjust at 0.167-(rx,texty) ] JP: [ Box: box ht 3*boxht line from 0.333 to 0.333 line from 0.667 to 0.667 Ptr: circle fill rad 0.01 at 0.167 "1" at 0.5 "2" at 0.833 "\s-2\fIptr \fP\s+2" rjust at 0.833-(rx,texty) "\s-2\fIoff \fP\s+2" rjust at 0.5-(rx,texty) "\s-2\fIlen \fP\s+2" rjust at 0.167-(rx,texty) ] with .n at IP.s + (0, -0.5) I: [ Box: box ht 2*boxht invis "\X'PS 0.8 0.3 0.3 setrgbcolor 20 setlinewidth'" at Box box ht 2*boxht at Box "\X'PS 0 0 0 setrgbcolor 4 setlinewidth'" at Box box ht 2*boxht at Box line from Box.w to Box.e "\s-2\fIbase \fP\s+2" rjust at 0.25-(rx,texty) "\s-2\fIcap \fP\s+2" rjust at 0.75-(rx,texty) Base: circle fill rad 0.01 at 0.25 BaseData: "[1, 2, 3, 4, 5, 6, 7]" ljust at 0.25+(dx*2/3,0) "7" at 0.5-(0,texty) line -> from Base to BaseData.w ] with .nw at IP.ne + (0.5,-0.25) spline -> from IP.Ptr to I.Box.nw+(-0.2,0.2) to I.Box.nw spline -> from JP.Ptr to JP.Ptr+(0.75,0) to I.Box.nw-(0.5,0.1) to I.Box.nw "x := []int{1,2,3,4,5,6,7}" ljust "" at IP.Box.nw "" "[]int" ljust at IP.Box.sw "y := x[1:3]" ljust "" at JP.Box.nw "" "[]int" ljust at JP.Box.sw .PE Steve said a load of complex diagrams, though, and for that I think it's more important to be able to go back and fix things. The diagrams in the regexp articles are also pic but with macros for drawing each kind of node. A: [ circa(b, 0, 0, , "\v'-0.02i'\*(q8", ) box invis ht 0.15 wid 0 ] B: [ circa(b, 0, 0, , "\v'-0.02i'\*(q9", ) box invis ht 0.15 wid 0 ] with .n at A.s-(0,dy) S: [ circ(0, "", "\v'-0.02i'\*(q6,\*(q7", "") ] at 0.5-(dx,0) SS: [ circa(a,1,0,"\*(q1,", "\v'-0.05i'\*(q2, \*(q3", ) circa(b,1,0,,"\v'-0.02i'\*(q4,\*(q5",) ] with .e at S.w F: [ final(0,,"\v'-0.02i'\*(qA", ) ] at 0.5 start(SS) spline -> from S.n up (dd-r) then right (dd-r) then to A.w spline -> from S.s down (dd-r) then right (dd-r) then to B.w spline -> from B.e-(dx,0) right (dx-dd+r) then right (dd-r) then to F.s spline -> from A.e-(dx,0) right (dx-dd+r) then right (dd-r) then to F.n "\f(CWa\fP" "" at A.w-(dx/2,0) "\f(CWb\fP" "" at B.w-(dx/2,0) The diagrams in this paper were all hand-written PostScript. http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TM-650.pdf %!PS-Adobe-2.0 EPSF-1.2 %%BoundingBox: 0 0 105 80 %%DocumentNeededFonts: Times-Italic Helvetica-Bold %%Pages: 1 %%EndComments @include osdi2-ex.inc 10 I 10 30 translate /skew 2 def timecaption gsave 10 -10 moveto 70 -10 70 -30 arcstart 10 -30 arccont arcfinish lightgray fill grestore 0 20 moveto (A) cshow right 4 timeline square arrowdown right square right square right square 0 0 moveto (B) cshow right 4 timeline right square right square arrowdown right square 0 -20 moveto (C) cshow right 4 timeline right right right square %%Trailer %%EOF