Pepijn
Pepijn

Reputation: 4253

How can I convert a web page to gcode for CNC engraving?

What I want to do is take the text from a Wikipedia page and etch it into stone with a CNC.

Conceptually it's not that hard, you scrape the text, convert it to vectors, and use a CAM tool to make gcode. But doing it in an automated way with a body of text seems tricky, and I'm not super familiar with all the tools. Most of them are GUI tools that are more designed to making a small label here and there, and don't deal well with typesetting, text layout or automation.

In my search I keep coming back to Hershey Text as the best way to render text using single line fonts.

The main trouble seems to be generating a formatted body of text with line wrapping and such.

A path that seemed somewhat promising is to print a webpage to PDF, import into Inkscape, and from there use Hershey Text. But the plugin failed to work on my imported PDF. (scripting tbd, but seems like with some selenium hacks it could work)

I also found this program that uses Hershey Fonts to generate gcode from a text file, but again, no line wrapping or formatting: https://github.com/Andy1978/hf2gcode

So I'm thinking, maybe the missing piece is a library that will render some form of rich text to SVG, or I'm looking completely in the wrong place.

Upvotes: 0

Views: 137

Answers (0)

Related Questions