The history and origin of Templot

(written September 1999)

Templot has now been in existence in one form or another for 20 years. But although a great many turnouts and at least one complete layout have been built on Templot-generated templates, it is only recently that there has been any great interest in the software which produces them. So, as a postscript to this web site, here is

Some Background History to Templot:

In 1979 I bought myself a birthday present - a programmable calculator. (For the equivalent price today you could have a good mid-range PC). It was needed for some toolmaking work we were doing at the time on turbine blades - but I soon found a more interesting use, curved turnouts!

Memory constraints meant that you needed a separate program for each rail, and the displayed co-ordinates had to be plotted laboriously on millimetre graph-paper. You then drew the template join-the-dots fashion and added in the timbering by hand. Tedious, but you had accurate curved turnouts, of known radius and dimensions which matched one another - a big improvement on the scissors and glue method using pre-printed straight templates.

By the early '80s the program was running on a home-made computer based around the 6502 processor. We built it primarily to drive stepper motors on a CNC milling machine, but it didn't take me long to have it producing track templates. Output was still in the form of printed lists of co-ordinates for hand plotting, but you could have templates on transition curves, curviform or regular crossings, a full range of switch sizes and most of the timbering centres. The intention then was to drive a flatbed pen-plotter (although this never materialised), so I called the program TEMPLOT.

I recall writing circa 1982 to the Scalefour Society, explaining at length that I had this facility available and enclosing several sample graph-paper templates, but received only a brief acknowledgement in reply - so I assumed that I was alone in this particular form of madness (and probably was at the time).

In 1988 I purchased an Atari ST computer. (It's unfortunate that this computer never became more popular for serious use - with its dedicated hi-res monitor you got 90% of a Mac for about 20% of the price. But it seemed to be universally regarded as just a games machine.) Using a superb compiled language called GFA-Basic which I miss sorely on the PC, I soon had Templot running on the Atari and set about the task of producing graphical output instead of lists of numbers. This was easy enough to do on the screen, but producing accurate printed templates was not so simple as none of the available printer drivers could be relied on to put all the dots in exactly the right place to within a fraction of a millimetre.

I wanted to print the templates on continuous telex roll paper on a 9-pin dot-matrix printer - a fairly straightforward requirement, or so I thought at the time. But it was several years and numerous re-writes of my own printer driver before I had solved all the problems and nailed some elusive bugs. Do you know how much memory is required for a 240 x 216 dpi bitmap which is 8 inches wide and several yards long? And in 1988 megabytes of memory didn't come cheap. Needless to say, the template had to be generated in a series of narrow bands, and making the joins invisible in every circumstance proved to be a challenge.

But it worked in the end, and lots of templates have been produced on the Atari. The dot-matrix printer is slow and noisy - it can take 30 minutes or more to print a long 0 gauge template, but it all still works fine.

Friends had been urging me to make the Templot program available to other modellers. But the trusty Atari (I can't remember the operating system crashing once in 10 years use) was beginning to look old-hat, and not a system most modellers would have. So about 18 months ago I finally gave in and purchased my first Windows PC and an inkjet printer. It shouldn't take more than a week or two to re-write a simple program like Templot for it, I thought!

Well the mathematical bits were easily re-written, and haven't actually changed much for years - in fact some of the original calculator code is still in there. And my hard-won printer driving code could all be ditched - Windows miraculously drives any printer you care to mention all by itself. But Windows visual programming proved to be more daunting than I expected for my aging brain. So it has taken much longer than I expected to get Templot to its present state, although it does now contain many more features than were originally intended. This is because 10 years development in processor speeds has meant that we can now do things in a second or two which would have required a good ten-minute wait on older machines.

Where next? The increasing power of modern processors makes for many exciting possibilities. All railway modellers have at some time sketched the perfect layout on the back of a envelope, usually while in the pub! Imagine taking it home, scanning it, and there it is, converted to a proper scaled track plan with not a sleeper out of place!

Well that's probably some way off, but there are many lesser developments in the pipeline. Watch this space.


September 1999.

Templot home page

© Sep 1999