kleer001 Posted February 3, 2015 Share Posted February 3, 2015 (edited) I have this puzzle made of blocks that I've built in 3D. But I want to rapid prototype it. There's lots of restrictions. And they basically all mean that I can't leave the pieces in a solved state and need to repack them looser (so they don't fuse together). Any ideas on procedurally stacking them to semi-optimally fix a larger box? I have a simple stacking Solver SOP setup, but it's running "long". I was thinking of tossing them one at a time (with shrink wrapped shells) as bullet objects into a box and letting them settle, but that seems kinda messy. edit: After a little more reseaching... Whoa, this is a nontrivial problem. puzzleBox_01.hipnc Edited February 4, 2015 by kleer001 Quote Link to comment Share on other sites More sharing options...
Artem Smirnov Posted February 4, 2015 Share Posted February 4, 2015 Hi Kleer, Don't know if it helps but here is the same thing you do in a for loop but implemented in vex. I guess it is faster... puzzleBox_01dd.hipnc Quote Link to comment Share on other sites More sharing options...
kleer001 Posted February 4, 2015 Author Share Posted February 4, 2015 Thanks Artem! Not really necessary, but good for learning What I ended up doing is aligning the blocks all to their back upper left corner at the origin so the XY and YZ planes are flat as they stack along X... then I folded them, cut them into 4 goups and stacked them on those two planes. Pics soon. I'll probably have to hand translate smaller pieces when they don't line up for stringing. Stringing? Yes, when they're printing they have to be all one piece or it's waaay more expensive. This way they're all like beads on a necklace. Quote Link to comment Share on other sites More sharing options...
kleer001 Posted February 5, 2015 Author Share Posted February 5, 2015 Holy smokes, this is a fun little can of worms. Here's a paper on 2D optimal stacking. http://www.aaai.org/Papers/ICAPS/2003/ICAPS03-029.pdf From this page about 2D stacking in web pages: http://www.codeproject.com/Articles/210979/Fast-optimizing-rectangle-packing-algorithm-for-bu And the wikipedia entry on the larger group of packing problems: http://en.wikipedia.org/wiki/Packing_problems Finally, it's such an interesting problem that people have built APIs around solving general cases and charge for it, like this page: http://v2.3dbinpacking.com/dem p.s. I don't think I'll be able to use these algorhythms because I have to thread a line through all the object so they count as a single piece at Shapeways. But I'll totally post when I get the process right. Quote Link to comment Share on other sites More sharing options...
pezetko Posted February 6, 2015 Share Posted February 6, 2015 For simple 2d packing I used UV Unwrap. I put there simple example (H13), it's more a dirty hack then proper solution. I used it to quickly populate warehouse with already modeled parcels. pz_pack_primitives_2d.hipnc Quote Link to comment Share on other sites More sharing options...
kleer001 Posted February 7, 2015 Author Share Posted February 7, 2015 (edited) Here's my solution: A bit of attribute juggling, a little math on a null to find how many pieces go in each of the 4 groups, a Primitive SOP to rotate the pieces and push them apart, a Foreach SOP (running 4 times) to slide them back, and a (white) polywire cube to wire all the pieces together I did all the testing with simple block pieces, then finalized it by running it through the carving process (to minimize print material). It's still not printable, for some reason, but I figure that's a trivial change to fix. Edited February 7, 2015 by kleer001 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.