Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help writing script

Status
Not open for further replies.

drewboy23

Mechanical
Jan 30, 2004
55
0
0
US
I need some help getting started. In simple terms, I want a script that will tell me how many jelly beans I can fit into different standard size jars.

Here is Jelly Bean-A. How many can I fit into Jar-A or how many can I fit info Jar-B, etc.
 
Replies continue below

Recommended for you

Hi,

Probably you will need to work with Measure Inertia workbench in order to measure the volumes of the Jar and Jelly Bean and then you can simply divide the values.

Regards
Fernando
 
You will also have to apply some packing density fudge factor to get a reasnoble estimate (i.e. jelly beans are not going to tesserlate exactly into the jar)
 
Thanks for the tips. Maybe jelly beans in a jar was not a good example. Say it was a all the same size shoe boxes going into a bigger box.
 
Approximation based on a bit of empirical studies is probably your best bet unless you want the complexity-level to increase drastically.
If you are really looking to find the optimal packing for a set of objects with an arbitrary shape (jelly bean) withing a given volume you should look into Space Packing algorithms. But for large sets this can take a long time so is better done in more optimized code, not script.
Daniel Bosia at Arup AGU has done some interesting work in this field -> Watercube Stadium in Beijing amongst others

/Thomas
 
Status
Not open for further replies.
Back
Top