This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.
I tweaked my little Hershey Fonts in JavaScript toy a bit. Now, the SVG data that it produces is at the right size and scale to plot on a sticky note on a MakerBot Unicorn. Save the SVG content, load it in Inkscape, and save it as .gcode using my Inkscape extension for Unicorn.
At long last, after a bunch of little thing-a-days, I can write out a sticky-note:
Save the SVG data and open it in Inkscape:
And save it as G-Code for plotting on the Unicorn!
Matt Griffin was kind enough to plot it for me on one of the Thing-O-Matics at the BotCave:
This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.
I really wanted to get SVG manipulation going in this demo, so I have ported the rendering (once again), this time using the jQuery SVG lib, which is really nice and easy to use: http://keith-wood.name/svg.html
This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.
Ok, this is kind of fun, even though the code is very naive.
I've added a height-check at the end of my line-breaking code. If there are too many lines of text to fit within the allowed space, the algorithm will rescale everything and try again:
This isn't great for real-time text flow, but it is fine for fitting text, I think.
This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.
I haven't been making as much progress on my "draw things in the browser so a robot can draw them on the Unicorn" project, so I decided to take a stab at cleaning things up a little to make that easier.
Today I rewrote my little demo to use canvas 2D instead of Raphael.js. It looks the same, for the most part:
But being in canvas land instead of Raphael land means I can do real stacked transforms easily, without having to keep track of them myself. For instance: ROTATION!
Word wrapping is an interesting topic, and I hope to get this cleaned up a bit with features like breaking up words if they are too long, improving the algorithm to make nicer "squared" paragraphs, etc.
Making text for Unicorn or EggBot plots isn’t always a fun process. Most tools require you to convert text into paths, and even then you get the outlines of shapes, which can often turn messy at small sizes.
mifga pointed me towards the Hershey fonts[1]. They’re a set of fonts for vector plotters named after creator Dr. A. V. Hershey who made them for the National Bureau of Standards.
These files are in a weird, weird, format. But after some normalizing, wailing, and gnashing of teeth, I was able to write some code to parse them and spit them back out as SVG! Now you can use these fonts in your Unicorn drawings.
Each SVG contains a layout of one of the Hershey fonts. The hershey_svg.zip file below contains all of the SVG files. The hershey.zip file contains the (cleaned up) original .jhf files. math-drawing.svg is just an example of using these glyphs, including scaling and stretching. I think the result is nice!
To use these in Unicorn plots, you’ll want to grab my Unicorn G-Code extension for Inkscape[2].