2024-12-15
Placing logos inside bounds - or 'nesting'
There are many ways of optimizing the placements of logos inside a constraint (ie. a sheet). Some of them use a lot of fancy math, but I decided to use the nesting method found in SVGnest. This is based on No Fit Polygon and a generic algorithm (basically: try a lot of different combinations, and pick the best result for next iteration and so on…)
The biggest issue was that SVGnest relies a lot on running in a browser: webworkers and SVG, whereas Flutter which is my prefered development environment does threading and graphics a bit different.
But these were not big issues, and eventually I also ended up implementing SVG support, because it turned out to be the easieste way to implement output to PNG (more on that later).
[ ] Describe cost
Written by: Jesper Halvorsen