Packing algorithm node
Packing algorithms are tricky! But we should find or build one that's high quality and efficient based on whatever the state of the art is in this field of research that supports nonconvex shapes.
The motivating use case is creating a sign like this out of icons:
Another great use case would be layout optimizations for printing, basically packing as many designs as possible on one sheet of paper which can then be cut out using scissors
Yeah, although paper is cheap— the more common use case along the same lines in industry is for expensive materials. Blade/laser/plasma/waterjet cutting materials like vinyl, wood, acrylic, and metal. In those cases, material costs really matter (especially at scale), so there are commercial off-the-shelf packing algorithm software packages that do exactly that as optimally as possible to save on material costs. We should aim to eventually have a competitive algorithm in terms of both quality of output and performance.
We actually do this every year for printing tshirts. Currently we manually layout the objects to use as little tshirt printing material as possible. That was also the main use case I was thinking of
We could use one of these exsting implementations: https://github.com/JeroenGar/jagua-rs https://github.com/JeroenGar/sparrow And also allow users to select other algorithms (e.g. regular texture atlas packing) etc. via a dropdown
This is basically identical use case as packing unwrapped UV meshes in 3D graphics. There is a lot of existing tooling for this use case: https://projects.blender.org/blender/blender/issues/105680 https://projects.blender.org/blender/blender/pulls/105821 This tool is doing much more than just packing the UV islands (vector shapes) so the packing algo would need to be extracted: https://github.com/jpcy/xatlas