Here the 3D printing extrusion nozzle is moved in a particular direction and for a specific length, before it halts and waits for a new instructions.
So, we could use Python Turtle code to simulate a 3D printing layer. Then put it into a repeating loop to create multiple layers. This loop could subtly change the direction and length commands to build quite complex and intricate shapes.
Here's a video of a Turtle code driven 3D printer in action.
The video was part of this 3D Printing presentation at the IPSJ Summer Programming Symposium in 2014.
A post from my Learn Python on the Raspberry Pi tutorial.