Stickerpacking

Background

I'm a member of a makerspace which recently gained a dye-sublimation printer and heat press. This means that we can make - amongst other things - custom stickers. Our laptops, water bottles, and local lampposts are immeasurably richer for this.

However, it's not without drawbacks. The paper we print on costs 50p per sheet, and the sticker paper is twice that. In the grand scheme of things, that's not much, but - combined with an idle comment by a friend in town for a visit - it was enough to get me thinking.

We also have a Silhouette Cameo 3, which can be used for automated cutting. We run this using an Inkscape extension - at the moment, by generating a document with the registration marks the cutter needs to orient itself, then putting in the stickers we want, creating paths around the boundaries of those stickers that will be used to cut the stickers out, and then printing the stickers, sublimating them on to sticker paper, and putting them through the Cameo.

The final incentive I needed was a night spent making stickers for a protest against the recent UK Supreme Court ruling. Trying to pack as many stickers as possible onto an A4 sheet, then cutting them out using an elderly guillotine cutter, was enough to convince me that there must be a better way.

There must be a better way!

Well, now there is. Or, at least, there is progress towards it.

stickerpacking is a tui application that's my best attempt at a complete toolchain. It guides you through the process of selecting the stickers you want to print, then calculates a reasonable placement for them. It even detects and removes transparent areas of PNGs, and will pack the resulting polygon. And it does all this really inefficiently and in no longer than it takes you to make and drink a cup of coffee!

Anyway, turns out that this is an NP-hard problem, which is strangely freeing to learn of a project after you've already started it. Equipped with this knowledge, I've produced something which is - at minimum - better than packing by hand. However, there's still plenty left to do: