Friday, November 7, 2014

Pew pew meets vroom vroom

Continuing my mostly pointless exploits with Microsoft's Epilog laser, I spent a bit of time last night experimenting with etching some leather scraps my folks sent me. Using the worst piece in the lot, I started some dog identification tags for our newly-adopted rescue, calibrating the speed and power to etch and cut... well enough.

Turns out cutting leather with a laser is possible, but it burns the sides pretty good. I ended up doing the cut on lower power and using an X ACTO knife to finish it. This proved quite difficult to do cleanly with the hole. Overall, it turned out pretty well.

I thought it would also be neat to make myself a new keychain for my motorcycle, so I did a quick search and came up with this guy:

Very clean, no gradients, one color, and a rather large image, to boot. I then used the open source Potrace to turn it into a vector image. The resulting SVG contained seven groups -- one for each letter and another for the logo's shape. In Visio -- the software we use for sending print jobs to the laser -- I was able to easily dispatch the letters, change the fill and line width in the logo, and I was left with a very simple SVG that contained a single path that looks something like this:

<path d="M4735 9954 c-253 -19 ... 160 2z"/>

The relevant components of the SVG specification are the "moveto" command ("M") and the "closepath" ("Z"). Looking at the full text of the path, there are actually three polygons. Expanding the XML a little, you see the following:

<path d="M4735 9954...-1020 18z m955 -288...965 -14z m3340 -3685...160 2z"/>

This is a single path with multiple polygons. This first polygon represents the overall guitar-pick-shape. The second is the upper space in which the text resides, and the last polygon is the lower space. I simply deleted the second two polygons and was left with a very clean vector representing what would become the shape of my cutout.

Adding the image back, sizing and aligning them gives the final image to be sent to the laser.

The vector border is set to a very thin (basically zero-width) line that the laser interprets as a cut, whereas the rest of the logo is rasterized and is done as an etch.

After a test run on a higher power, I brought it back a bit and ran the final job.

Another X ACTO cut gave me the raw piece.

With a reasonable hole punched out, it's ready for use.