It is surprisingly difficult to build train tracks given a set of parts, even without taking junctions into account - there is a challenge about it on Stack Overflow's Programming Puzzle site (https://codegolf.stackexchange.com/q/116607/66060) and there is only one answer in the two years it's been there. In some ways, real life engineers have it easier - they don't have to plan routes based on the parts in the box!