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.
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
offsetto 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