3d nesting and packing

Hi,
I’m looking for a Grasshopper script or workflow to place scanned brick fragments inside a casting mold of 25 × 25 × 2.5 cm.

The goal is to find the most optimized arrangement, so that as many brick fragments as possible fit inside the mold, with minimal air gaps and no overlaps.

The fragments are irregular meshes (can be simplified if needed).
Any suggestions for components, plugins, or example definitions for this kind of optimization would be greatly appreciated.

Thanks in advance.

Nyeste 3nesting.3dm (17.0 MB)

you may start by uploading what you already have done .3dm and/or .gh files.
saves us the time cutting the bricks :wink:

regards, Eef

My bad, it´s oploaded now :smiley:

the first thing I notice is that a few bricks would not fit the 25mm height of the mold, as their shortest side is like 40mm ?

the general basic approach I would follow is to first enclose each single brick into its minimum bounding box (there are topics about that in the forum, you can use the search function to find those)

by doing so, for each box you will end up with 3 sizes: if neither of the 3 sizes is smaller than 25mm, then you can’t orient that stone in your mold and need to discard it

for any other stone which has at least one size smaller than 25mm, I would orient it in such a way the longest size smaller than 25mm becomes its height (in such a way to minimize its XY shade for the next step)

last step, for each stone that passed the first check and was succesfully oriented, get its projection/shade on XY plane, and proceed to nest those shade outlines (something like OpenNest should be absolutely fine for that)

this way you will get a 2D nesting of oriented 3D shapes, and can use Transforms to bring the real 3D stones on their final nested locations

  • I took just one brick (mid-sized) and made a bounding box around. This box is only about 30% filled. There are probably x ways to turn the brick inside the box, and 1 or more will be the best. But still the percentage will not be much higher.
  • Calculating the volume of this brick and dividing on the volume of 25 X 25 X 2.5 probably more then hundreds of bricks will fit in there.
  • All those bricks differ in size and and can be turned in x ways around.

Maybe kangaroo or another plugin can be used to optimize this a bit. Then call it the “most optimized” and be happy :slight_smile:

My suggestion: look at the builders in countries like Nepal. They find a big stone and place it on the most flat side. And find another brick to go against it.
Then search for some smaller ones to fill one of more gaps, and use a lot of grout to glue it together.

Success, regards, Eef