groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] gpic question?


From: Larry McVoy
Subject: Re: [Groff] gpic question?
Date: Tue, 1 Feb 2005 11:56:26 -0800
User-agent: Mutt/1.5.6+20040907i

On Tue, Feb 01, 2005 at 02:34:40PM -0500, Steven Starr wrote:
> John:
> 
> I use pic whenever I can in place of the drawing tools available in
> Framemaker or xfig (UNIX) or Microsoft Word/Powerpoint. It is ALL too
> easy to screw up a carefully drawn illustration in a WYSIWYG with an
> unanticipated nudge of the mouse. pic provides extremely precise
> placement that is nevertheless quite robust as you modify an
> illustration. The language is easy to learn, and gpic provides some very
> nice extensions to AT&T pic.

Indeed.  I got James to add the "`i'th last <whatever>" construct years 
ago and you can do some cool stuff with that.  This is a drawing where
you can change the number of disks/cpus and it just works.  Check it
out.

.\"  $lpr$ groff -p -s $file | lpr -h
.\"  $tty$ groff -p -s -Tascii $file 2>/dev/null | colcrt | uniq | more
.\"  $X$ xroff -p -s $file 
.PS
[
.po +1.5i
.sp .55i
.ps 10
.vs 10
.ft B
boxwid = .5
linethick = 1.5
fillval = .15
trayht = .8
disks = 5       # 1 is for tape
cpus = 4
spacing = .3
s = .50
[       for i = 1 to disks - 1 by 1 do {
                [ D: box fill ht trayht 
                  "DISK" "TRAY" at last box.c + (0, .2 * trayht)
                  box fill 0 ht .22 wid boxwid - .10 \
                    with .s at last box.s + (0, .04) "Ctrl"
                  move to last box.e + (spacing, 0)
                ]
        }
                [ D: box fill ht trayht 
                  "TAPE" "TRAY" at last box.c + (0, .2 * trayht)
                  box fill 0 ht .22 wid boxwid - .10 \
                    with .s at last box.s + (0, .04) "Ctrl"
                  move to last box.e + (spacing, 0)
                ]
        move to 1st [].D - (boxwid/2, 3.3 * s) \
            + (((disks - cpus) * (boxwid + spacing))/2, 0)
        for i = 1 to cpus by 1 do {
                [ C: box fill ht boxwid wid boxwid "CPU"
                move to last box.e + (spacing, 0)
                ]
        }
        dw = disks * boxwid + (disks - 1) * spacing
        boxht = boxht * .8
        w = 1.1
        box wid w with .c at 1st [].D.sw + (dw/2, -s)
        "100Mb/sec" "Switch for" "DISKS & TAPE" at last box.e + (.5, 0)
        for i = 1 to disks by 1 do {
                line <-> from `i'th [].D.s to \
                    last box.nw + (i/(disks+1)*w, 0)
        }
        for i = 1 to cpus by 1 do {
                line <-> from `i'th last [].C.n to \
                    last box.se - (i/(cpus+1)*w, 0)
        }
        linethick = .5
        for i = 1 to disks by 1 do {
                for j = 1 to cpus by 1 do {
                        line from last box.nw + (i/(disks+1)*w, 0) to \
                            last box.se - (j/(cpus+1)*w, 0)
                }
        }
        linethick = 1.5
        s = 2.2
        S: box wid w with .c at 1st [].D.sw + (dw/2 + .7, -s)
        "100Mb/sec" "Switch" "for CLIENTS" at last box.e + (.5, 0)
        for i = 1 to cpus by 1 do {
                line <-> from `i'th last [].C.s + (.10, 0) to \
                    last box.ne - (i/(cpus+1)*w, 0)
        }
        linethick = .5
        for i = 1 to cpus by 1 do {
                for j = 1 to 10 by 1 do {
                        line from last box.nw + (i/(cpus+1)*w, 0) to \
                            last box.se - (j/(10+1)*w, 0)
                }
        }
        w = 1.0
        linethick = 1.5
        A: box wid w with .c at 1st [].D.sw + (dw/2 - 1.0, -s) \
        "Console" "Server"
        linethick = 1
        for i = 1 to cpus by 1 do {
                line <-> dashed from `i'th last [].C.s - (.10, 0) to \
                    last box.ne - (i/(cpus+1)*w, 0)
        }
]
l = .3
line with .n at last [].A.s down l
"AUI or 10BaseT" at last line.s - (0, .15)
for i = 1 to 10 by 1 do {
        line with .n at last [].S.sw + (i/11 * last [].S.wid, 0) down l
}
"1 to 10 100/10baseT interfaces" at 5th last line.s - (.05, .15)
.\"     Just to give us an idea of where we are.
.\"     box dashed with .nw at last [].nw + (-.25, .25) \
.\"     wid 1st [].wid + 0.7 ht 1st [].ht + .5
]
.PE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]