Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Train track planner

Plan a sectional train track layout: type the pieces, see the plan, check that the loop closes, find crossings, list the parts and the board size.

How to use it

  1. Measure your track: the length of a straight piece, the radius of a curve (from the centre of the circle to the middle of the track) and how many curves make a full circle.
  2. Type the pieces in the order you lay them, starting at the green arrow: S, H, L and R, with a number in front to repeat a piece. Or start from a ready-made shape.
  3. Press Draw. The planner shows whether the end of the track meets the start, how big the gap is, where the track crosses itself, the parts you need and the size of board it fits on.
  4. If it does not close, press Close the loop: the planner searches for the fewest extra pieces (up to 10) that bring the end back to the start.

Keyboard

TabMove between the boxes and buttons
Enter in a number boxDraw the layout

Tips

  • An oval needs the same number of straights on both long sides. Add straights in pairs, one on each side, and the loop still closes.
  • Real track has a little play at every joint, so a gap of a millimetre or two closes in practice. The planner calls a loop closed within 1 mm.
  • Where the track crosses itself you need a crossing piece at that angle, or one track on a bridge. A figure of eight needs one crossing.
  • Leave room around the track for trains to overhang on curves: the board size adds 50 mm on every side.

About this tool

The planner follows the centre line of the track piece by piece. A straight moves forward; a curve of radius r and angle a moves along an arc, ending r × sin a forward and r × (1 − cos a) to the side. The loop closes when the end is back at the start and pointing the same way.

Close the loop is a breadth-first search over up to 10 more pieces, keeping only positions it has not reached before (to half a millimetre) and dropping any that are too far away to get back. Crossings are found by checking every pair of short segments along the centre line.

The tests follow the same pieces with a separately written Python version, check every ready-made shape, every crossing count and that every added set of pieces really closes the loop. For model railway scales and gradients, see the model railway calculator.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product