Jump to content
Sign in to follow this  
kleer001

packing procedural blocks

Recommended Posts

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.

post-1210-0-71804100-1422940891_thumb.pn

puzzleBox_01.hipnc

Edited by kleer001

Share this post


Link to post
Share on other sites

Thanks Artem! Not really necessary, but good for learning :D

 

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

post-1210-0-16671900-1423326465_thumb.pn

Edited by kleer001

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×