Free tools & games for everyone
Free · No sign-up · No accounts
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.
| Tab | Move between the boxes and buttons |
|---|---|
| Enter in a number box | Draw the layout |
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.
A fresh daily puzzle every morning, and new tools added every month.
Browse every product