用 3D 打印机写明信片
Writing Postcards with a 3D Printer

原始链接: https://severinbucher.com/posts/writing-postcards-with-a-3d-printer/

受手写数字化启发,作者将自己的 3D 打印机改装成了笔式绘图仪。整个过程始于使用 OpenSCAD 设计的一款 3D 打印适配器,用于固定圆珠笔和弹簧,以确保笔尖在纸张上保持压力均匀。 该项目面临一个重大障碍:打印机强制执行的“自动归位”程序会将笔头压向打印底板。为了规避这一问题,作者开发了一个自定义工具,通过 WebSocket API 直接向打印机发送 G 代码,从而在不触发安全程序的情况下手动控制打印机移动。 其工作流程是使用 Inkscape 配合“Hershey Text”插件将字体转换为单笔画路径,再通过 `svg2gcode` 将其转换为 G 代码。在为每一页手动校准 X、Y 和 Z 轴偏移量后,打印机便会按照指令进行书写或绘画。 这套自制设备已成功将打印机变成了一台自动明信片书写机,让作者能够通过手写便条与朋友保持联系。适配器文件和自定义流传输软件已在 Thingiverse 和 GitHub 上开源。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 用 3D 打印机写明信片 (severinbucher.com) 9 分 | typesafeJ 3 小时前 | 隐藏 | 过往 | 收藏 | 3 条评论 djmips 22 分钟前 | 下一条 [-] 所以这意味着如果给它装上旋转刀,它也能当刻字机用吗? 回复 voidUpdate 18 分钟前 | 父评论 | 下一条 [-] 数控就是数控,只要能装上附件,大概率就能用。如果你把打印头换成铣刀,并设置挤出机线路来控制铣刀开关,它就成了数控铣床。如果你用旋转刀,它就成了刻字机。 回复 stavros 13 分钟前 | 上一条 [-] 真不错!我也用过同样的技巧来制作 PCB,让打印机用记号笔在不想蚀刻的部分画出来: https://www.stavros.io/posts/make-pcbs-at-home/ 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

I read Amy Goodchild’s blog post about digitizing her handwriting in JavaScript a while ago and couldn’t stop thinking about it. I didn’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.

This post is the story of getting there, including the part where my printer almost drove the pen straight through the bed.

The pen adapter

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.

Cross-section of the main adapter body in OpenSCAD, showing the channel for the pen cartridge and the spring
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’s enough pressure to write even if the surface isn’t perfectly level.

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’t want to risk that.

The third piece is a tiny clamp that keeps the cartridge spring in place.

The ballpoint cartridge next to the printed clamp that holds its spring
The ballpoint cartridge and the little clamp that keeps its spring in place.

None of the parts are precise. PLA was fine, and I’d guess almost any filament would work. If you want to print your own, the STL files are on Thingiverse.

The finished adapter mounted on the printer's extruder
The assembled adapter mounted on the extruder, ready to write.

First test

Before doing anything clever I just wanted to know if the concept held up. I mounted the adapter, used the printer’s manual controls to drive the pen down onto a sheet of paper, and moved the axes by hand.

It wrote. Cleanly, even. That was enough to keep going.

Software

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.

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.

For my machine, pen down is:

G1 Z10 F100

and pen up is:

G1 Z15 F100

Second test (the one that didn’t work)

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.

It didn’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.

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’t disable the forced homing. Time for a different approach.

Custom software

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’t trigger a home cycle. So if I could send manual movement commands one at a time, I could skip the homing problem entirely.

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.

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’s nothing fancy, and the code is on GitHub.

Third test

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.

It worked.

Setting up a new writing project

For my own reference, here’s the full routine for writing on a fresh sheet:

  1. Start the printer and home all axes before attaching the adapter, so the printer knows where it is.
  2. Mount the adapter on the extruder.
  3. Place the paper or postcard on the bed, with its lower edge parallel to the front of the bed.
  4. Hold the paper down with a few magnets.
  5. Manually drive to the lower-left corner of the paper and lower Z until the pen touches it.
  6. Note the X, Y, and Z values.
  7. In Inkscape, create your SVG and set the document size to match the paper.
  8. In svg2gcode, set the X and Y origin to your noted values and use the Z value for the pen-down command.
  9. Stream the G-code to the printer with g-code-streamer.
  10. For writing several identical sheets, leave two magnets as end stops so the next sheet lands in the same spot.

Wrap-up

This was a fun weekend project, and watching the machine work is oddly relaxing. Since it writes any SVG, it draws pictures just as happily as text, and it’s gotten me to send actual postcards to friends and family for the first time in years. Here’s a short clip of the plotter in action.

The plotter writing a postcard.
联系我们 contact @ memedata.com