Skip to content

juanramirezc2/factorio-blueprint-visualizer

Repository files navigation

Factorio Blueprint Visualizer

I love the game Factorio and I really like the look of factories after growing for many hours or blueprints after tweaking them for perfection. So I thought about visualizing the factories and blueprints.

All factorio buildings and tiles with their bounding boxes and belt, pipe, rail, inserter, wire and electricity connections can be visualized. Everything is drawn in vector graphics (SVG) to be able to view it in any resolution.

Use the online demo to visualize your own blueprints. With the latest update, Blueprints from Factorio before version 2.0 might not work correctly.

Examples

The last three blueprints are by Josh Ventura and can be found here.

Updates

  • Factorio 2.0 and Factorio: Space Age are supported.
  • Portet everything to Javascript for simplicity and performance.
  • Added ability to modify drawing settings.

Usage

Text to Image

I created a dataset with images generated using this tool to finetune SDXL (a text-to-image neural network). The model with examples can be found here: https://huggingface.co/piebro/factorio-blueprint-visualizations-sdxl-lora

Pen Plotting

I have a pen plotter, and one of my initial ideas was also to be able to plot my factories. You can create visualizations you can easily draw. I recommend using https://github.com/abey79/vpype for merging lines together before plotting. An example of a visualization for plotting is here:

Another way to create plots from your factories is to use: https://github.com/drawscape-labs/factorio-cli.

verilog2factorio

It's possible to use https://github.com/redcrafter/verilog2factorio to create factorio verilog blueprints and visualize the buildings and wire connections like this.

Convert to PNGs

To easily convert all SVGs in a folder, you can use a terminal and Inkscape like this. mkdir pngs; for f in *.svg; do inkscape -w 1000 "$f" -e "pngs/${f::-3}png"; done

Contribute

# install uv uv run ruff check --fix uv run ruff format

Contributions to this project are welcome. Feel free to report bugs or post ideas.

To update the python code for the website, you have to update the python wheel in the website folder. To update it, just run: python setup.py bdist_wheel --universal --dist-dir=website

To update the installed version while developing you can use python setup.py bdist_wheel --universal --dist-dir=website && pip uninstall factorioBlueprintVisualizer -y && pip install website/factorioBlueprintVisualizer-1.1.0-py2.py3-none-any.whl

If you use an external api on localhost (e.g. for getting the blueprint from factorio.school) you need to disable CORS. To start Chrome on Ubuntu with CORS disable you can use google-chrome --disable-web-security --user-data-dir=temp http://0.0.0.0:8000/.

Statistics

There is lightweight tracking with Plausible for the website to get infos about how many people are visiting. Everyone who is interested can look at these stats here: https://plausible.io/piebro.github.io%2Ffactorio-blueprint-visualizer?period=all

About

A python library to artfully visualize Factorio Blueprints and an interactive web demo for using it.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 72.4%
  • Python 14.3%
  • HTML 11.3%
  • CSS 2.0%