Inventables Community Forum

New app: QR Code Generator

We’ve been experimenting with creating apps internally to explore the API and make sure that it is useful and easy to use before starting to release it to our first external developers. I took some time over the weekend to create this one: a QR code generator. Input/output wise, it is very simple: enter a URL and it spits out a QR code. But there is actually quite a bit more to this app than meets the eye.

  1. Loading external dependencies. The apps are written in javascript, so there are tons of amazing libraries out there that we want developers to be able to use. @JeffTalbot created a way to load these external libraries easily in the apps. The main library for this app is the awesome [javascript-qrcode][1] library.

  2. Boolean geometry inside of apps. A naive SVG of a qr code would just be a <rect> for each square of the code that is black. This results in 300+ rects, which slows Easel down quite a bit. It also doesn’t generate toolpaths very well. Instead I made each rectangle overlap slightly, and used the jsclipper library to union those blocks together. Easel actually has a lot of code built around boolean geometry, so we are looking into ways to expose useful things like union, intersection and offset to the apps. But for now I just loaded it as an external dependency and worked with it directly.

Here is the result, made with 2 color HDPE

And of course a gif for good measure


[1]: https://github.com/siciarek/javascript-qrcode

5 Likes

Well that’s cool as blazes. No idea what I’ll use it for, but that’s darn cool!

i will be using the qr code on my items that i make that will link to my youtube channel

Awesome work Paul!

Fantastic. :smile:

Can imagine this being used on lots of signage. In fact, can imagine a wall plaque with information and a QR code for more information/and an imbedded NFC tag for same.

Cheers

Ian

I know nothing about QR codes. Does it matter that your code is inverted? The parts that were black on the screen are white in your piece.

1 Like

This is amazing! In my job I use QR codes everywhere when it comes to fixed asset management. The trouble comes with the durability of the decals used to print the codes on items that are exposed to the elements. This solves that problem! Awesome!

1 Like

Yes, it does matter, at least to the QR code reader on my phone. Guess it should be inverted before cutting.

I just printed one - looks great, but doesn’t scan. How can you invert the trace in Easel?

I’m just using it as a plugin on the browser-based Easel. Is that where you’re seeing the issue?

Maybe it’s comforting that, even if it imports, it prints in reversed color, so you can’t use it anyway :slight_smile: Hoping somebody has an answer about reversing the colors in Easel.

After I import it, I inverted it, and that looked fine, but I got a warning about the bit size being too big, despite the fact that this QR is bigger than the one that I successfully carved from the plugin.

Remember that “colors” mean depths in Easel. Reversing the colors would mean raising the QR code shape out of the material around it, i.e. carving around the QR code. You can do this by placing rectangle around the QR code shape and setting the QR code depth to 0.

Nice workaround - thanks for the tip!

I realize this is a very old forum thread, but I am interested to know if this app is currently available through Easel.
I did not see it in the current list of available apps.

Thanks.

Anyone know about this? Thanks.

Looks like it’s not there.
There are plenty of online QR code generators that will export an SVG.