0

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.

Pepijn
  • 4,145
  • 5
  • 36
  • 64
  • Hi Pepjin. I think this question as it stands is covering too many subjects at once, and should be broken down into smaller questions, each answered individually. I see the following subquestions here: 1) How to extract rich text from a website (that possibly uses JavaScript to generate it). 2) How to render rich text into a vector format that's suitable for post processing. 3) How to convert a vector format containing stroke&width or outline text into gcode. – datenwolf Mar 05 '23 at 09:57
  • 1
    If you have a robust CAM software like Mastercam you can just take the text or even images of any object right from the website and trace image raster to vector and then engrave it. Does your CAM software not offer you that option? – Rory Mar 07 '23 at 14:38
  • I think the web to text and vector to gcode parts are pretty simple but would argue against splitting it up because then you get the opposite problem of people going "what are you actually trying to do" – Pepijn Mar 08 '23 at 17:19
  • I don't have any CAM software, and really want to automate the process. But if there are any free ones that are scriptable it could work. – Pepijn Mar 08 '23 at 17:21

0 Answers0