ASCII Art

I’ve been working on plotter capabilities lately, and I’m ready to reveal my secret project:

[attachment file=101698]

While the finished product is in no way “better” than other rendering techniques, I find this approach really amusing because the entire purpose of ASCII art is to render graphics when only characters are available. On a plotter, of course graphics are native and characters require an extra step, so this is dumb… for fun.

For this I created a toolpath font by generating raster characters of the fixed-pitch “OCR-B” font, then performed centerline tracing using Autotrace (as a plugin for Inkscape). These would serve as my pen paths. The auto-generated paths are not that great so I heavily edited the paths manually to my liking.

I then wrote a program that parsed out the Bezier paths from the SVG file and split it into a few Bezier paths for each character. I can then generate g-code for any character at any size at any location by scaling and offsetting the coordinates and emitting G5 commands for Bezier curves. Marlin’s Bezier support is turned off by default so I had to turn on G5 in the firmware. Marlin’s implementation for G5 worked on the first try.

Now that I can generate arbitrary text, I had to select an image and render as characters. This is simply creating ASCII art. I ended up doing this conversion myself because I wanted an accurate brightness model for the particular font I was using, and because it’s not that hard.

The drawing itself it took about 4:40, and my phone died partway through filming.

All in all, it’s been a lot of work to render an image as text as pen strokes. But that was the point from the beginning.

4 Likes

Over The Top! Excellent.

Just think, if it could write backwards, it could go twice as fast!

1 Like

Oh look! A pupper! So cute!

That is really cool. Well done. Building the machine, tuning and calibration. Then fixing the stuttering issue. Not to mention all the software side to get it to gcode that I don’t know how you did… anyway that was a lot of work for pupper. Well done indeed.

lost my mind for a minute.

angel-ascii.txt (55.4 KB)

How large is the page you’re drawing on?

Is your dog’s name Bruno?

I was going to upload some g-code for you but it’s rather big. But you can try this:

  1. Go here: https://vector76.github.io/gcode_tpgen/
  2. For Mode, select the "Text" radiobutton (last one)
  3. In the text box at the bottom of the form, copy-paste your text (don't worry if it wraps lines, it knows where the true line endings are)
  4. Enter your page size for X extent and Y extent. For a 10" (in X) by 7.5" (in Y) drawing that fits comfortably on a US Letter size page, try X Extent of 254 and Y Extent of 191. It will stretch the text to fit these dimensions.
  5. Most of the other defaults for feed rates should be reasonable.
  6. Click generate, and it should let you download a gcode file.
To use the generated gcode file you must compile your firmware with G5 splines enabled!

If you have trouble I can try to answer specific questions.

1 Like

Actually, I think you have too much text for a page-size drawing. The characters will end up about 1mm in size, which probably won’t produce the output you want.

Generate your text again using a smaller image or somehow so you have maybe about 100 columns of text. Then follow the steps above.

When you generate the g-code, it will report the output pitch line-to-line and character-to-character, so you can judge if your pen is likely to make decent characters.

LoL i really need someone to stop me from posting when I’ve been drinking. This is sometimes the dragon wins, im just in my garage. just ignore me.

this would be great on a t-shirt or blanket with a fabric pen.

check this out. https://www.youtube.com/watch?v=h3vjhNnHTSw

5 Likes