3DContainerPacking
3DContainerPacking copied to clipboard
How do you include padding?
How do you include padding, keeping a minimum distance between boxes?
Trick: You need to virtually increase all box dimensions by half the space you need between all the boxes, increase your container dimensions by 1 time the space, perform your calculation, and display your boxes with their original sizes.
Yes, that's a good idea, I thought about that. But it also adds padding where boxes connect to the room, which I don't want. Only between boxes. Because I use it for 3D nesting to remove elements and to separate the pieces I have a minimum space.
I do that in https://github.com/treeDiM/StackBuilder and it works great.
Before making your palletization computation, you need to increase by 1 space the length +width dimensions of your container, but after the computation, you need to offset every box position by -0.5*space.
x -= 0.5 * space;
y = -0.5 * space;
Then, you do have a set of boxes with spaces that do lean on your stacking area boundaries.