Google Gemini and an Old 3D Printer Make a Great Generative Art Pen Plotter

Jacob C turned an old Ender 3 3D printer into a pen plotter for generative AI artwork.

AI, especially LLMs and generative art models, are controversial right now, to put it very mildly. But there is no denying that they make it easy to churn out pretty good stuff in seconds, which is incredibly impressive. Humans being what we are, those words and images are mostly being used for low-effort social media posts and scammy websites. But what if you could use them to produce something more interesting? That’s what Jacob C. did when he used Google Gemini and an old 3D printer to build The Incrediplotter.

Gemini is one of Google’s AI assistants and it is very versatile. It can write essays, code programs, and generate images. And it has a public API, so it is easy to integrate into projects. Just make an API call with a prompt and get the requested content back in a few seconds. In this case, Jacob’s program asks Gemini to generate an image with some specific characteristics: a “monochrome unshaded simple thin line art X.” The X is the desired subject and the result is an image perfect for pen plotting.

Jacob didn’t have a pen plotter, but he did have an old Creality Ender 3 3D printer in pieces. That pile of hardware contained almost everything he needed to build a plotter. With his brother assisting with the mechanical design, Jacob reconfigured the frame for this new mostly 2D purpose and added a servo motor to lift the pen relative to the paper. To control the plotter, Jacob chose to use an STM32 “Blue Pill” microcontroller development board paired with two TMC2208 stepper driver modules.

On the firmware/software side, Jacob used Klipper and set that up with Moonraker and a Mainsail interface. The Klipper software does most of the toolpath processing on Jacob’s PC, then simply sends motor movement commands to the STM32. That processing isn’t strenuous, but this method makes everything fast and accurate.

The final piece of the puzzle was getting the Gemini-generated images into a format that Klipper could work with, which is g-code. To do that, Jacob programmed a custom Python script that uses AutoTrace to convert the bitmap image into an SVG file. It then uses vpype-gcode to turn that SVG file into g-code for Klipper.

Now, Jacob can give his program a prompt, like “draw a cat wearing flipper,” and it will automatically generate an image and plot it out.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles