Hacker News new | past | comments | ask | show | jobs | submit login
SVGnest: Efficient packing of irregular shapes with JavaScript (github.com/jack000)
108 points by ireflect on Jan 16, 2016 | hide | past | favorite | 21 comments



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


This is awesome! Unfortunately, my paying corporate desk-engineer job offers no opportunity, but as a grad student I did quite a bit of laser-cutting-prototyping (mostly acrylic and delrin). At one point I searched around quite a bit for reasonably priced nesting software, to no avail, only high priced professional stuff for shops.

Forwarded it to my former lab, I'm sure they'll get some use out of it. Very interesting to read the implementation details, too.


My day job is as a laser cutter operator cutting metals. Our machine came with proprietary software NC Express which does part nesting then generates the G code for our machine.

When I get time I'd like to look at your implementation and see how it comes. Most of what we cut is rectangles with holes, but there's often odd shaped components. Which greatly increases the time required for NC Express to complete the nesting - up to about 30 seconds max, mind you I'm using a 6 year old CPU here at work.


This is interesting. I wrote Tagxedo http://www.tagxedo.com which is another kind of constrained packing problem and there is a bit of similarity in the approaches. This is the first time I've heard of CNC packing and part nesting... May I ask what kind of software and how much they are selling for?


The one I compared with is mynesting which has a pay-per-use model. They also make nestfab, which is 2k+ per seat I believe.

There are lots of others at various price point, but none that are free it seems.


My wife does papercraft with a Brother ScanNCut, could she use this to pack her designs more efficiently? The machine apparently does this packing but not well... maybe you could sell them know-how.


it should be possible, but it seems that particular model requires some hoop-jumping to work with SVG:

http://svgcuts.com/blog/brother-scanncut-review/


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


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.


Placing electronic components for PCB layouts.


cool, I'll try to integrate it to my own software: https://github.com/nraynaud/webgcode


THAAAANNKS!


you are my hero :)


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


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.


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!


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

Very nice work. Thanks for sharing!


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


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.


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


Tagxedo 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: