← Hackathons

HACKNov 2024

G-Code Assembler — rebuilding a shape from printer instructions

I was too tired to do another hackathon project. Then I noticed Kinetic Vision had a 3D printer as the prize, and only one other three-person team was competing in the category. So I changed my mind.

I'd worked with inkjet-printer firmware before, so the problem felt a lot more familiar than most hackathon prompts did by then. The challenge was to reconstruct a 3D object from G-code.

A printer never needs the original CAD model. It only gets the instructions it needs to make the object: coordinates, extrusion, layer heights and travel moves. So the shape is in there, just backwards.

I treated the depositing moves as physical filament again, rebuilt the volumes, joined them, and exported the result as an STL. I did this one solo, so I have a lot of implementation detail if I ever want to get into it.

Here's the assembler running in the browser, with no server. I rebuilt it in 2026. Next to the hackathon's box mesh it now makes one closed solid out of the printed beads, within about 1% of the challenge's own CAD models, and it reads G-code from Bambu, Prusa, Cura and other slicers.

Full text & source links