Writing Postcards with a 3D Printer

typesafeJ2 pts0 comments

Writing Postcards With a 3D Printer | Severin Bucher | BlogI read Amy Goodchild&rsquo;s blog post about digitizing her handwriting in JavaScript a while ago and couldn&rsquo;t stop thinking about it. I didn&rsquo;t end up digitizing my own handwriting, but it pushed me toward a smaller idea: clamp a ballpoint pen to my 3D printer and let it write postcards for me.<br>This post is the story of getting there, including the part where my printer almost drove the pen straight through the bed.<br>The pen adapter#<br>I have an Elegoo Neptune 4 Plus. The first job was a way to mount a pen on the extruder, so I designed an adapter in OpenSCAD and printed it in PLA. It comes in three pieces.<br>The main adapter body, sliced open in OpenSCAD. The channel holds the cartridge and the spring sits above it.The main piece wraps around the extruder and holds the ballpoint cartridge and a spring. The spring matters more than I expected. It lets the pen push down a little into the paper, so there&rsquo;s enough pressure to write even if the surface isn&rsquo;t perfectly level.<br>The second piece is a small U-shaped part that presses against the top of the extruder. Without it, the screws holding everything together would bear directly on the extruder, and I didn&rsquo;t want to risk that.<br>The third piece is a tiny clamp that keeps the cartridge spring in place.<br>The ballpoint cartridge and the little clamp that keeps its spring in place.None of the parts are precise. PLA was fine, and I&rsquo;d guess almost any filament would work. If you want to print your own, the STL files are on Thingiverse.<br>The assembled adapter mounted on the extruder, ready to write.First test#<br>Before doing anything clever I just wanted to know if the concept held up. I mounted the adapter, used the printer&rsquo;s manual controls to drive the pen down onto a sheet of paper, and moved the axes by hand.<br>It wrote. Cleanly, even. That was enough to keep going.<br>Software#<br>To generate something to write, I used Inkscape. Newer versions ship with a Hershey Text extension that converts text into single-stroke SVG paths, which is exactly what you want for a pen plotter. I typed some text and converted it.<br>Then I fed that SVG into svg2gcode, a web tool that turns SVGs into G-code. The setup is a bit manual: I moved the pen by hand to the lower edge of the paper to set my X and Y origin, then lowered Z until the pen just touched the surface and used that height for the pen-down command.<br>For my machine, pen down is:<br>G1 Z10 F100<br>and pen up is:<br>G1 Z15 F100<br>Second test (the one that didn&rsquo;t work)#<br>My plan was simple: take the generated G-code, send it to the printer as if it were a normal print, and watch it write instead.<br>It didn&rsquo;t write. The printer has a safety routine that homes every axis before a print starts. Homing X and Y is harmless, but homing Z is a problem, because the pen and adapter sit lower than the extruder normally does. With the pen attached, homing Z means driving the tip into the bed.<br>I ran this test at very low speed, so nothing got damaged and the cartridge spring absorbed the contact. But no matter what I tried, I couldn&rsquo;t disable the forced homing. Time for a different approach.<br>Custom software#<br>The first test had already shown me the way out: the printer writes fine when I drive it with the manual controls, and those don&rsquo;t trigger a home cycle. So if I could send manual movement commands one at a time, I could skip the homing problem entirely.<br>Digging around, I found that the Neptune runs Moonraker, which exposes both a REST and a WebSocket API for talking to the printer. That was the missing piece.<br>So I wrote a small tool that takes a G-code file and a printer address and streams the file line by line over a WebSocket connection. It&rsquo;s nothing fancy, and the code is on GitHub.<br>Third test#<br>Same workflow as before: Inkscape for the SVG, svg2gcode for the G-code, then my streamer to send it to the printer. I kept the speed low and set a high Z value on the first run so the pen would trace everything in the air, well above the paper. That let me confirm the motion looked right before committing to ink. Once I was happy, I dropped Z down to actually write.<br>It worked.<br>Setting up a new writing project#<br>For my own reference, here&rsquo;s the full routine for writing on a fresh sheet:<br>Start the printer and home all axes before attaching the adapter, so the printer knows where it is.<br>Mount the adapter on the extruder.<br>Place the paper or postcard on the bed, with its lower edge parallel to the front of the bed.<br>Hold the paper down with a few magnets.<br>Manually drive to the lower-left corner of the paper and lower Z until the pen touches it.<br>Note the X, Y, and Z values.<br>In Inkscape, create your SVG and set the document size to match the paper.<br>In svg2gcode, set the X and Y origin to your noted values and use the Z value for the pen-down command.<br>Stream the G-code to the printer with g-code-streamer.<br>For writing several identical sheets,...

printer rsquo adapter paper write extruder

Related Articles