Xfig Utilities

I really like Xfig - the Linux/Unix X11 drawing program. I have used Xfig for all sorts of things - viewgraphs, scaled architectural drawings, party invitations. Also for some less usual applications.

Gerber Editing

Gerber format is used for printed circuit boards. Originally driven by paper tape, an aperture wheel with 24 different shapes would be imaged onto a big sheet of photographic film and either "flashed" - literally - to make a single circle, square etc. or lit and moved to draw lines. Nowadays it's all done with lasers and files off the net or email. Design used to be done on Unix workstations with (very) expensive software, now it's mostly PCs running Windows for small jobs. I'd written odd utilities in the past to plot Gerber files on a pen plotter, so I adapted one to convert Gerber to Fig. This lets you view a multilayer circuit board. Then I thought maybe I can create Gerber from Fig - it supports layers and library elements, as do real PCB design tools. There is no concept of connectivity or design rule checking, though, so it would only be suitable for very small projects. I subsequently found some (free) real PCB tools for Linux.

HTML Imagemap

I have some applications using the HTML imagemap method to pass position data to a CGI program. Originally I used Thomas Boutell's mapedit program, but I had trouble compiling and running the old code under newer Linux, and the new Java version didn't easily do what I want - it insists on an HTML file first - and it's not free. So, another Fig program. This makes NCSA imagemap server-side files from Fig rectangles, circles and polygons. If you place a 1:1 scale image at (0,0) the pixels will line up, so just draw shapes on top of the image. The URL comes from the comment in the shape - edit them after drawing. Adaptable to generate client-side HTML I guess. - Now client-side maps generated, too. Note that fig2dev already generates client-side maps with a slightly different comment format, using the whole Fig region (assuming it's converted to .GIF). If there are no elements outside the picture object, then this will probably come to the same thing, and fig2dev is preferred (it does ellipses, too). I hadn't realized this when I wrote fig2map, or I might have written an html-map to NCSA map conversion, instead.

Text Editing

My daughter uses Xfig as a word processor. Weird, eh?. txt2fig takes a Unix ASCII file (with linefeeds) and converts it to a block of Fig text in a selected font. It can then be merged, scaled, moved etc. in a Fig document.

Sound Editing

Almost anything is better than this. Convert a raw sound file (created by sox) to Fig, edit it, and convert it back.

PostScript Editing

pstoedit by Wolfgang Glunz will convert a PostScript file to Fig (and other formats) so that it may be easily edited.

Google Satellite Images

Google Maps satellite images (and maps) are made of square tiles. If these are collected (from a browser cache, or from downloading), they can be fitted together like a jigsaw. Normally, 16 tiles are displayed on the screen. Using these utilities, you can assemble a much larger number (over 500) into a big image for printing.

You can also trace over satellite images in Xfig and make highly accurate maps.

(Google images are copyright and may not be used for commercial purposes. Canadian copyright law allows a user to make one copy of documents for research or personal use - but you can't make copies for all your friends, AFAIK)

Garmin GPS

NetStumbler

NetStumbler is a Windows application for mapping and recording WLAN signal strength and access point locations. It can export a TSV file; additionally the native file format is documented here. It would seem pointless to use ns12tsv when netstumbler will generate TSV directly; however, with a large number of NS1 files it was easier to mount the FAT partition under Linux and script the conversion rather than do it manually click-by-click under Windows.

Also, it is useful to combine multiple files to find the best signal for each access point. TSV files can just be concatenated, whereas NS1 files would have to be read individually and intermediate data stored before sorting.


Andrew Daviel