Anyway to take Gcode and show the printing process real time?

I am working on a virtual version of a 3d printer and was wondering if there was a known way to convert gcode to a model (preferably printing in real(ish) time. Thank you!

Haven’t looked at GCode until now but it looks pretty straightforward to parse it based on this:

After you parse it I suppose you could instantiate a string of little spheres or cubes to mimic the filament being pasted in place just to prove it works.

That approach would get you up to a certain very low point of complexity but then you’re probably going to need to implement some kind of meshing strategy such as marching cubes or some other voxel-based solution to be performant enough at scale.

Honestly, feels like something someone else might have already written… I’d keep googling if I were you.

I made a cheesy quick attempt at the naive approach of one GameObject per blob of filament.

I got this much working:

Full setup in the above repo, or just run it in a scene with some stub data from that website listed in the comments.