
SVGnest: Efficient packing of irregular shapes with JavaScript - ireflect
https://github.com/Jack000/SVGnest
======
Jack000
OP here. I'm a pretty big CNC enthusiast and part nesting is a problem I face
regularly. The software that does this is all pretty expensive and I couldn't
find an open source implementation, so I decided to write it myself.

Try it out and let me know if you have any feedback

~~~
theon144
I was just about to ask what practical applications does this have, CNC
milling totally makes sense :) Are there any others?

~~~
Jack000
laser/waterjet/plasma/knife cutters, though technically they are CNC machines
as well. It's useful whenever you need to cut a large number of parts (eg.
laser cutting a paragraph of text from a piece of acrylic for an led display)

The biggest value-add is in industrial applications, where efficiency is much
more important. I guess that's one of the reasons that the existing software
is typically very expensive or "call us for the price" type deals.

------
lotyrin
I'd think you'd get a better result from simulated annealing over GA here.

------
epmatsw
This is an impressively cool thing that I've never even thought about. Really
neat that a hobbyist result is comparable (better in the example!) than the
commercial product.

------
gavinballard
This is awesome, thanks for sharing!

I'll dive into the implementation a little more shortly, but just wondering
how easy it is to add additional constraints (for example, that pieces need
particular orientations)?

Edit: Oh, I see there's a "Part Rotations" parameter. Excellent!

------
amelius
Finally a github repo with a decent description of the algorithms used!

Very nice work. Thanks for sharing!

------
geoffbrown2014
Love it, great job! How long did it take you to get it up and running?

~~~
Jack000
I started in November and worked on it off and on. I guess about a month of
work. The NFP generation algo is fairly complicated, that took most of my
time.

------
mrcactu5
would this include Letters? this might be a great tool for making word clouds

~~~
Jack000
Tagxedo [http://www.tagxedo.com](http://www.tagxedo.com) seems to do a pretty
good job with word clouds. SVGnest could in theory make word clouds, but the
placement rules would need to be changed to optimize for perceptual qualities
rather than packing compactness.

