Jump to content

packing procedural blocks


kleer001

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
Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...