Making a shed for a model railway using python code

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • I'm working on a project to design model buildings using code. The idea is that you can create template files which describe the building using JSON. Those can then be loaded into the application, tweaked for the particular design, scaled to the appropriate model railway scale and then saved as and SVG file ready for further tweaking in InkScape, or that can be sent straight to a laser cutter.
    This video explains the first steps of my program to reach the point where it could generate the files needed for laser cutting the two sheds. These are created using the same template file, but one is outputted for OO scale (1:76.2) for a typical indoor model railway, the other is outputted for G scale (1:22.5) for a garden railway.
    I explain about some of the decisions that I had made and how I've actually written much more code, which due to the agile style of programming was subsequently discarded when I refactored the code.
    I also researched various techniques including how to add interlocking tabs, understanding the point-in-polygon and intersecting line principles needed to determine where I should exclude elements of the etching. One thing that I also looked into was creating a simple tokenizer. In my case this enabled the use of variables within an otherwise static JSON file.
    Tokenisers are often used in compiler design (which is where I based the idea on), but are also used in the large language model (LLM) AI systems used the Chat GPT etc. Whilst this is a long way off using any form of artificial intelligence it's useful to learn some of the basic elements used.
    For more details, including a link to the source code see www.penguintut...

Комментарии •