That’s awesome! So it’s a 2D bin packing algorithm for SVG files? Definitely useful for people cutting a lot of laser cut parts! I’d considered doing something similar as an Inkscape plugin, but I like this solution because it requires no installation.
What sort of algorithm are you using to solve it?
If you ever run out of ideas on features, configurations, and constraints to have, here are a few that come to mind:
Preserve orientation of certain parts, or allow 90deg rotation only.
Allow certain parts to be mirrored (or not).
Specify bounding box size and number of each item to include. Output should be multiple bounding boxes, with the right total count of every part.
Optimization for sharing edges (good if cut time is costly).
Minimum required spacing between parts (important for CNC router).
Pack inside arbitrarily shaped bounding SVG (think Glowforge camera + your parts files, auto-arranged on whatever scrap piece of material you have inside).
There are a few edge cases in the no fit polygon generation. Still working it out
The spacing feature is in the config menu. The other features are definitely on my to-do list. The major one that I’m thinking about is placing parts in holes of other parts, which it doesn’t do right now.
This is awesome! I ran into a similar issue trying to bin pack all the cut outs for the VHS layout stuff… I ended up writting a fusion 360 plugin (GitHub - laftho/CSVRectanglePack: Autodesk Fusion 360 2015 script to parse CSV rectangles and pack into a 2D sketch) which mostly works… the downside is it that exporting it to a file usable on a laser I lose my text… Was going to do a similar thing for inkscape or something but might just be able to use this for the bin pack!