Before building complex LEGO train layouts, it is useful to plan the layout on the computer. The computer helps you to find good layout geometries that fit to the space available for your layout, and it also counts up the parts that you need.
What software shall I use?
For LEGO track layout planning, Bluebrick by Alban Nanty is the most powerful tool that I am aware of.
Bluebrick can be downloaded here: https://bluebrick.lswproject.com/
Bluebrick requires Microsoft Windows, but someone has also managed to run Bluebrick under Linux.
What is a track library?
Bluebrick contains the limited number of original LEGO tracks by default.
Since Bluebrick 1.9 (released in January 2021), Bluebrick has is built-in ability of automatically importing track libraries.
A track library is a compilation of tracks from other vendors.
I have created a compelling track library for Trixbrix.
Please click on this link for details and download instructions.