Online since 2002. Over 3300 puzzles, 2600 worldwide members, and 270,000 messages.

TwistyPuzzles.com Forum

It is currently Wed Apr 23, 2014 6:32 am

All times are UTC - 5 hours



Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Packing STLs into minimal volume
PostPosted: Wed Jul 31, 2013 11:57 am 
Offline
User avatar

Joined: Sat Apr 21, 2007 11:21 pm
Location: Marin, CA
Check out this neat tool for packing parts into minimal volume by netfabb:
http://www.netfabb.com/automatic_packing.php

Here's a video of this in action.
http://www.youtube.com/watch?v=2yQiCrpaLoE

If 12 of us come up with $500, we could buy a license! (You have to get netfab pro for about 1500, and then this add on is 4500-9000 depending on where you ask.)

Is this really the only commercial tool out there for solving this problem? I'm kind of blown away that there isn't another commercially available tool available for a smaller price. But I've reached my limit of patience for manual packing...

_________________
Jason Smith posted here as 'io' through 2012.
Visit Jason Smith's PuzzleForge on Shapeways!
Jason Smith's Puzzles - YouTube Channel.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Wed Jul 31, 2013 1:18 pm 
Offline
User avatar

Joined: Thu Dec 31, 2009 8:54 pm
Location: Bay Area, California
TomZ wrote code to do it and I've kicked around the idea of writing something myself but I think Tom has done it really well. Sorry I don't have a link (on a phone).

_________________
Prior to using my real name I posted under the account named bmenrigh.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Wed Jul 31, 2013 9:24 pm 
Offline
User avatar

Joined: Fri Feb 08, 2008 1:47 am
Location: near Utrecht, Netherlands
I've got my own tool for this. The algorithm is rather rudimentary: it approximates the parts with a 1mm^3 voxel grid (which is expanded by 1mm to ensure clearance between parts) and then greedily places the parts from largest to smallest (having the smallest parts fill in the gaps between the larger ones). It tries to place the parts as "close" to one corner of the bounding cube if possible. It starts with a relatively small bounding box which is expanded if it is not possible to fit the parts any more.

Attachment:
COO4orH[1].png
COO4orH[1].png [ 87.9 KiB | Viewed 1434 times ]


Depending on the puzzle it'll get 9-11% density but playing with the settings it's usually possible to get over 10. The main reason I have not made it available yet is that's it's very inefficient and it will keep your computer busy for like 10 minutes. But on the other hand I recognize it's a very useful tool and I'm slightly embarrassed I haven't made it available yet. I plan to do so after the IPP. (Perhaps at a cost, any ideas for what is fair here?)

You can import STL files and it will automatically recognize the part count if it's named ('part_name.XXX.stl' or 'part_name (XXX).stl'). You can also manually specify the part count and create mirrored copies of the same part. The "minimum hole" setting is to prevent the following situation: if you have a hollow core it will place parts inside of the core but it might not be possible to remove them from it. Setting the minimum hole value allows you to specify the maximum size part that could still be removed from inside the part. "Part rotations" and "minimize box" are settings that can be played with to optimize stacking. The program will try various orientations of the same part to see which one will fit most efficiently. "cubic" is a good option for most part since it ensures a decent orientation in the printer. If a part is not cosmetic and you don't care about printing orientation, select "arbitrary". "minimize box" first orients the part to have a minimal bounding box but this can result in a sub-optimal printing orientation.

Attachment:
4yu9[1].png
4yu9[1].png [ 238.26 KiB | Viewed 1434 times ]

_________________
Tom's Shapeways Puzzle Shop - your order from my shop includes free stickers!
Tom's Puzzle Website


Buy my mass produced puzzles at Mefferts:
- 4x4x6 Cuboid for just $38
- Curvy Copter for just $18
- 3x4x5 Cuboid for just $34


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Thu Aug 01, 2013 12:52 am 
Offline
User avatar

Joined: Thu Dec 31, 2009 8:54 pm
Location: Bay Area, California
TomZ wrote:
The main reason I have not made it available yet is that's it's very inefficient and it will keep your computer busy for like 10 minutes.
I'm used to waiting hours or days or sometimes even weeks for optimization problems to run. ~10 minutes sounds incredibly fast to me. Perhaps after your initial release you could add more rotations or smaller voxels for those of us willing to do whatever it takes to get under the 10% density?

TomZ wrote:
I plan to do so after the IPP. (Perhaps at a cost, any ideas for what is fair here?)

The puzzle I need to pack will save about $220 per print if I get the density discount. I need at least 6 prints.

I think you should go with a "pay what you can" pricing model with a minimum price of say, $10. Then some designers will pay you $10 and some of us will pay you a lot more.

_________________
Prior to using my real name I posted under the account named bmenrigh.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Thu Aug 01, 2013 12:28 pm 
Offline
User avatar

Joined: Sat Apr 21, 2007 11:21 pm
Location: Marin, CA
Tom, I'd be very interested in your tool, and I'd be willing to pay a larger donation. I have just evaluated a commercial tool and I'm getting 8% with obvious space everywhere.
Also, if you open the source, I'd be interested in adding a feature or two, like automatically primary axis alignment of parts so that their bounding boxes are better aligned to the build volume, and perhaps an annealing experiment? I'm inches away from just writing one myself. Save me!

_________________
Jason Smith posted here as 'io' through 2012.
Visit Jason Smith's PuzzleForge on Shapeways!
Jason Smith's Puzzles - YouTube Channel.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Thu Aug 01, 2013 12:52 pm 
Offline
User avatar

Joined: Fri Dec 28, 2012 1:50 pm
Location: Near Las Vegas, NV
For me, I usually pack all of my parts right in Solidworks, using a scaling technique. I insert a scale feature, then scale every part down by the centroid, usually by an amount between 0.8-0.6% of their original size (you want the parts separated by about 2-1mm apart). Then after that scale is applied, I then scale every part back up from the origin. I take 1 and divide it by the original scale-down factor to get the scale-up factor (I try to avoid irrational scale factors if possible). Then once I have scaled every part back up by the origin, instantly all of the pieces are separated out for printing.

Unfortunately, this usually only works with single-model prints that are already a relatively small size, and sometimes
I do need to manually move individual parts. But I don't really see the need to pack them in minimal volume. As long as you get the density above 10%, then you're fine.

_________________
My Youtube channel
My Shapeways Shop


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Thu Aug 01, 2013 3:43 pm 
Offline
User avatar

Joined: Thu Dec 31, 2009 8:54 pm
Location: Bay Area, California
JasonSmith wrote:
Also, if you open the source, I'd be interested in adding a feature or two, like automatically primary axis alignment of parts so that their bounding boxes are better aligned to the build volume, and perhaps an annealing experiment? I'm inches away from just writing one myself. Save me!

+1 for opening the source. Of course I'd still be willing to donate but this would give me the opportunity to tweak parameters or add features or improve the algorithm for various scenarios. I would have written this a while ago if it weren't for being busy and knowing you've already done most of the work.

_________________
Prior to using my real name I posted under the account named bmenrigh.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Sat Aug 03, 2013 2:53 am 
Offline
User avatar

Joined: Fri Nov 05, 2010 2:20 am
Location: Wherever
benpuzzles wrote:
For me, I usually pack all of my parts right in Solidworks, using a scaling technique.



I do this as well, but sometimes there are huge gaps between pieces that will not occur if TomZ's program or manual packing is used.

_________________
A budding puzzle designer!

Check out my Shapeways shop!


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Sat Aug 03, 2013 4:38 am 
Online
User avatar

Joined: Mon Jun 30, 2008 8:38 pm
Location: Russia
Tomz, I also want to buy your software

_________________
my Shop: ShapeWays, grigorusha Big Puzzle Sale: EBay
Image Image


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Sat Aug 03, 2013 6:40 am 
Offline
User avatar

Joined: Sun Mar 15, 2009 12:00 am
Location: Jarrow, England
Tom, I think your software would be very useful as well. I usually have to arrange all of the pieces in SketchUp manually, which is a real pain. For my Dalek puzzle I ended up with this:
Attachment:
File comment: Packing
PAcking for SW.png
PAcking for SW.png [ 139.38 KiB | Viewed 1174 times ]
I had to place pieces inside other pieces, and also add some spares in the unused gaps to get the density above 10%. Tom, does your program have the ability to add dummy pieces in unused awkward gaps?

_________________
My Shapeways Shop: http://www.shapeways.com/shops/gus_shop

Image


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Sat Aug 03, 2013 6:47 am 
Offline
User avatar

Joined: Fri Nov 05, 2010 2:20 am
Location: Wherever
Gus wrote:
. Tom, does your program have the ability to add dummy pieces in unused awkward gaps?


I would believe that the packing ability minimizes the awkward gaps, and even if they appear, the density would be above 10% anyway.

_________________
A budding puzzle designer!

Check out my Shapeways shop!


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Sun Aug 04, 2013 2:35 am 
Offline
User avatar

Joined: Sat Apr 21, 2007 11:21 pm
Location: Marin, CA
benpuzzles wrote:
For me, I usually pack all of my parts right in Solidworks, using a scaling technique. I insert a scale feature, then scale every part down by the centroid, usually by an amount between 0.8-0.6% of their original size (you want the parts separated by about 2-1mm apart). Then after that scale is applied, I then scale every part back up from the origin. I take 1 and divide it by the original scale-down factor to get the scale-up factor (I try to avoid irrational scale factors if possible). Then once I have scaled every part back up by the origin, instantly all of the pieces are separated out for printing.

Unfortunately, this usually only works with single-model prints that are already a relatively small size, and sometimes
I do need to manually move individual parts. But I don't really see the need to pack them in minimal volume. As long as you get the density above 10%, then you're fine.


Ben, I must admit I've had a hard time finding a scale feature. I'm sure it's something obvious, but where is that? I have some face caps I could try this on.

EDIT-This may be because I've been in SW2008 forever...?

EDIT2-I see it's in SW2013. Never mind...

_________________
Jason Smith posted here as 'io' through 2012.
Visit Jason Smith's PuzzleForge on Shapeways!
Jason Smith's Puzzles - YouTube Channel.


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Wed Aug 07, 2013 7:10 pm 
Offline
User avatar

Joined: Fri Dec 28, 2012 1:50 pm
Location: Near Las Vegas, NV
JasonSmith wrote:
benpuzzles wrote:
For me, I usually pack all of my parts right in Solidworks, using a scaling technique. I insert a scale feature, then scale every part down by the centroid, usually by an amount between 0.8-0.6% of their original size (you want the parts separated by about 2-1mm apart). Then after that scale is applied, I then scale every part back up from the origin. I take 1 and divide it by the original scale-down factor to get the scale-up factor (I try to avoid irrational scale factors if possible). Then once I have scaled every part back up by the origin, instantly all of the pieces are separated out for printing.

Unfortunately, this usually only works with single-model prints that are already a relatively small size, and sometimes
I do need to manually move individual parts. But I don't really see the need to pack them in minimal volume. As long as you get the density above 10%, then you're fine.


Ben, I must admit I've had a hard time finding a scale feature. I'm sure it's something obvious, but where is that? I have some face caps I could try this on.

EDIT-This may be because I've been in SW2008 forever...?

EDIT2-I see it's in SW2013. Never mind...

Actually I have SolidWorks 2011 and that feature is in there (insert, features, scale). Interesting that it isn't in 2008...

_________________
My Youtube channel
My Shapeways Shop


Top
 Profile  
 
 Post subject: Re: Packing STLs into minimal volume
PostPosted: Wed Aug 07, 2013 7:14 pm 
Offline
User avatar

Joined: Wed Jan 07, 2009 6:46 pm
Location: Evanston, IL
I would happily pay for this software, Tom! $20-30 sounds about right.

-Eitan

_________________
Eitan = "EIGHT-ahn"
Buy a Radio Cube 3! Only $150 at Eitan's Shapeways Shop
Check out my video: Twisty Puzzles a la Vi



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Forum powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group