Track Layout Geometry
Here are some more advanced ideas for LEGO train layouts, while still keeping consistent with the restrictions of track geometry. While none of these ideas are original to myself (with the possible exception of the yard at the bottom), I hope this explanation will inform and inspire you to build better and hassle-free LEGO layouts.
New as of Jan 7 2008: this page is now available in Italian courtesy of ITLUG, the Italian LEGO® Users Group. You can see the Italian translation on the ITLUG Web site. (EDIT 9/15/2008: updated URL)
Table of Contents
- Introduction
- Crossovers
- Changing Two Curves To a Straight
- Wye oh Wye?
- 22½° Diagonal Track
- 45° Diagonal Track
- Diagonal Track with Switches
- The Big Yard
- Track Designer files
Introduction
LEGO track geometry is very limiting. There are only a handful of available pieces. From left to right, these are: straight, curve, left switch (or point), right switch, and cross track:

Each straight track piece is 16 studs long and 8 wide. The curved pieces produce a 22½° bend, so that 4 of them make a 90° turn. The switches have a different kind of curve in them, and they are meant to be used in conjunction with a curved track to produce parallel tracks. Here are some of the basic track concepts that are valid with LEGO track. Each one preserves perfect alignment with the studs on the large grey baseplate (48×48 studs).

Straight track can go anywhere. But in order for the alignment of tracks to be maintained consistently through curves and switches, it is necessary to adopt some standards. The standard that works best is:
- Adjacent parallel tracks have a pitch of multiples of 16 studs; or put another way, 8 studs between tracks.
This is dictated by the geometry of the LEGO track switch, which creates parallel tracks of this pitch. - On a 48×48 baseplate, tracks may run down the center of the baseplate or 4 studs in from either edge. This is for symmetry and in order to preserve the previous rule.
- On a 32×32 baseplate, tracks may only run 4 studs in from either edge.
- Horizontal and vertical track segments must begin and end on a baseplate boundary, except for dead-end spurs.
If you follow these rules, you will never have trouble getting your layout to line up.
On first glance you may think this is too limiting, because the following restrictions would seem to be implied by the above rules:
- All curves must be 90°, consisting of 4 curve pieces.
- All switches must have a curve piece on the “spur” end to make the track parallel to the “main” line.
However, there are some additional things you can do with LEGO track geometry that do not violate our rules. This is because in the real world, there is a little bit of slack in the connections, and the studs can still be made to line up with certain alternate configurations.
Crossovers
A crossover is where you have two parallel tracks with a line connecting them. The standard way is to take the switch geometry described above, and create a crossover where the two switches line up with a pair of curved tracks in between. But look at the right hand crossover: it also lines up, only instead of the two curves there is a single straight piece:

How does this work? Well, it turns out that 2 curved track pieces, when positioned at 22½° from horizontal, have the same amount of vertical distance between start and end as a single straight at that angle. Also, the horizontal distance is almost exactly double that of a straight.
But what if you put nothing in between? Then the tracks don’t line up right:

DON’T DO THIS. The areas circled in red are not lined up properly. If you want these tracks to line up elsewhere on your layout you will run into problems. Just add a straight or two curves (or two curves and several straights, to make a parallel track in between). Remember, a switch is NOT the same as a curve!
Changing Two Curves To a Straight
It’s not just crossovers that let you replace two curves with a straight. Here are some other situations where this trick can help avoid unnecessary zigzagging of your trains.
A standard "S" curve (left) is made with eight curves. But replace the two middle curves with a straight (right) for a smoother shape that uses less space. |
A branch line coming off a switch can be given a gentler curve, and take up less real estate, with the same technique. |
You can loop back on yourself by replacing 2 curves with a straight. |
|
A crossover requires extra space between the parallel tracks. Here’s one way, using both types of "S" curves, |
|
Wye oh Wye?
A wye (named for the letter Y) is one of the most common ways for trains to turn around, and it allows you to connect the loops of your layout in different ways for interesting variations.
Caution: a wye made of LEGO (or any DC model train) track will have a short circuit! You will need to electrically isolate the track segments in at least one spot in order to make it work. You can do this by inserting paper between the track pieces before connecting them, and then cutting away the excess.
The wye on the left uses standard LEGO geometry, with 4 curved tracks in each 90° turn. In the one on the right, the double curves (3 sets of them) are replaced by straights. This shrinks the size and produces more reasonable curves.

22½° Diagonal Track
Another convenient coincidence that comes in handy when designing layouts involves a straight track running at a 22½° angle. If you use 12 straight tracks with a curve at either end, you can still line up your track at both ends while having a more unusual track angle.

This works because of the magic of Pythagorean triples. Like the well-known 3-4-5 triangle, you can make a perfect right triangle using dimensions of 5, 12, and 13. In such a case, the angle is 22.62°, which is close enough to 22½ that it works. Thanks to Jason Railton for pointing this out. But why is it 12, and not 13, you ask? Remember above where you can replace 2 curves with a straight? The 13th straight is replaced by the curves at either end of the 12. Note that a horizontal track of 12 units will line up nicely with the end of the diagonal track.
This trick only works if the begin and end of the turn are parallel. If you want to have the begin and end be perpendicular, you need an extra straight. Here’s why:

45° Diagonal Track
There are no Pythagorean triples that produce anything close enough to a 45° angle, but we can ue math to derive a result anyway. Trigonometry tells us that the distance traveled horizontally or vertically for each unit of diagonal movement is the sine of 45° (or cosine if you prefer; they’re equal for a 45° angle), or 0.7071. This is also half of the square root of 2 (1.4142). So we need a number that, when multiplied by 0.7071, produces something close enough to an integer that it will work with LEGO track.
The best choice is 17 straights, but you should be able make 10 work also. |
|
|
Thanks to Larry Pieniazek, David Koudys, and Jeff Van Winden for their postings in a thread about this topic on LUGNET.
Note: this requires that the beginning and end be perpendicular to line up properly. If you need the beginning and end to be parallel, add a right angle turn (four curves) to the above. You can simplify it by replacing two of the curves with a straight, but you will still need to go the “wrong way” with one curve track in order for it to line up:

Diagonal Track with Switches
You can add a switch and curve to each end, or replace the two resulting curves with a straight, just like we did in the earlier crossover:

The result is a pair of switches separated by 14 straights. Put several of these together, and you have a switching yard:

We can also do the same thing with a 45° track:

The Big Yard
Here is a big switching yard that uses several of the ideas shown here:

You can also find more ideas by Tim Strutt at his Brickshelf folder.
Track Designer files
If you have the Track Designer program on your PC, here are the files for each of these examples (minus the text and arrows and such):
Image hosting courtesy of BrickShelf. You can also view this page as a BrickShelf folder.




November 2nd, 2006 at 7:45 pm
[...] Three years ago (on November 21, 2003) I wrote a page on my old site about Track Layout Geometry showing some of the interesting things you can do with LEGO train track, for example, this method for running track on the 22.5° diagonal: I was browsing my favorite blogs today and noticed that the page got mentioned on Mike Walsh’s blog. That prompted me to take another look at it, and I decided it really would be better to put it here on the Brickpile site. So I moved that page to this site, and changed the page on the old site to redirect to it with a 5-second delay using JavaScript. Thanks for the link Mike (and sorry for changing it out from under you)!Technorati Tags: lego, trains, track, layout, geometry [...]
January 7th, 2008 at 11:45 am
[...] My Track Layout Geometry page has been translated into Italian! [...]
December 9th, 2008 at 4:58 pm
Larry has posted a blog entry linking here. Since Blogspot doesn’t do trackbacks I’m posting it as a comment manually. Thanks Lar!
April 13th, 2009 at 12:12 am
you have to make something like a idea for a big track with two switches, 17 straigts & 31 curves. if you do that than i can build a big city so please design something?????!!!!!
(p.s. what for program do you youse to design these tracks?)
April 13th, 2009 at 2:17 pm
This page shows some of the techniques you would use to design your layout, but what you need depends on how much space you have to work with. I don’t design custom layouts, sorry. The program I used was Track Designer which is a pretty old program; I think there may be newer ones available now but I haven’t tried them.
June 27th, 2009 at 8:57 pm
Not owning any Lego or Lego track, I wonder about Real World track fit. In particular, since your criteria for choosing number of track segments for “45° diagonal track” is to choose “integer lengths”, what would happen with 7 diagonal straight pieces, which to me, look attractive. Isn’t a shorter substitution more generally useful?
(from a guy into fudging the fit)
June 27th, 2009 at 9:44 pm
If you look at the table where I did the math, with 7 straight pieces on the diagonal you’d have a hard time lining it up with the rest of the track. There’s a lot of slop in the track connections though, so you can get away with a lot of things that I don’t recommend here because of the play in between track connections. However, that can cause derailing if it’s extreme enough, so to play it safe use the tips on this page.
LEGO has recently introduced some flexible track pieces which are 1/4 the length of a straight piece and have a hinge in the middle, so there’s a lot more you can do, but the new track doesn’t have conducting rails so it can only be used with battery-powered trains.
August 11th, 2009 at 7:35 pm
This is pretty cool. I have some little train track bought by grandpa in the sixties. Somehow, I have been struggling to reconstruct it. Thanks for the info. I am sure this will be very helpful.
August 11th, 2009 at 8:26 pm
Actually if it’s from the 60s it’s probably 4.5v or 12v track, and the geometry is different for those…
December 9th, 2009 at 2:00 pm
Hi,
I have been messing around with the atlas track designer and I have been having a devil of a time trying to get it to do the layout I want. I feel that it is possible I’m just not doing whatever it is I need to do to get it working.
What I am trying to do I have (crudely) sketched down below. Its basically the smallest reversing figure 8 I can make so I can fit it into the internals of my 4×8 layout. I would like to put a switch or 2 on that reversing section and draw a branch line off around the outside of the 8 but that will be easy once I get the 8 figured out.
If you could please let me know the pieces I need to put in to make it happen I would be grateful. Please email it to me at [email address deleted] it would make my day.
…….____________……
…../……..\…../………\
…/…………\./…………\
..|…………..|…………..|
…\…………/.\…………/
…..\____/…..\____/
note: I dont have to have the center overlap, a simple crossing of any standard degree would be fine.
this would also be acceptable (and preferible if posible) the “oval-eight”
…….____________……
…../……..\…../………\
…/…………\./…………\
..|…………..|…………..|
…\…………/.\…………/
…..\____/___\____/
December 9th, 2009 at 2:22 pm
LEGO has only one type of crossover, which has tracks meet at 90 degrees. That dictates that the minimum size of the layout would need to be 5′8 by 2′9.


If you let the tracks cross by having a bridge where one goes over the other, you could do it smaller.
December 9th, 2009 at 5:07 pm
I exchanged some emails with the commenter and realized what he wanted was more like these:


December 9th, 2009 at 5:12 pm
OH YES!
Very very nice, thats exactly what I was looking for. I am trying to get as much switching and track pieces as I can get into this 4×8 layout (realism is not in effect here) mostly to play with and I would like to use standard pieces without having to resort to flex track. I have never been very good at using that stuff.
Thanks so much!
December 9th, 2009 at 5:32 pm
In TD 2.0 what does the Z height have to be in order for a normal sized HO train to fit underneath for a crossover?
Thinking of how long a branch line has to be in order to cross back over the figure 8 mainline
December 9th, 2009 at 5:36 pm
The height features of Track Designer have never worked well for me. I think there are some bugs there. I just lay one track atop the other and worry about height only when doing it for real. But then, I’ve never tried to cross tracks that way in a layout. Hills don’t work well – the trains slow when climbing and zoom when going downhill – so our club doesn’t use them.
Probably you should be using BlueBrick instead of TD anyway … TD is totally unsupported, and the author doesn’t even have the source code. I keep meaning to make that transition myself, but I have spent too much time in TD. But if you’re just starting out, use BlueBrick. http://bluebrick.lswproject.com/