How can I auto-arrange / fit various small 3D Shapes without Overlap within a defined larger 3D Shape?

Seeking Algorithm can be use to auto-arrange various small 3D Shapes without Overlap within a defined larger 3D Shape. Bard Generative AI produced the following results:

  1. Axis-AlignedHeight-FieldBlockDecompositionof3DShapes
  2. Simple 3D space collision check algorithm

They look Good. However, I believe we humans can do better :slight_smile: Opened to any and all ideas specific to achieving this in Unrealengine with Blueprints. Let’s Discuss.

Algorithm #1: Overlap Check, Reorientate

1. Position Object ‘A’
2. Collision Check Overlapping Objects
3. Adjust Position (Each Axis Toggled Independently)
  1. Loop{} Move Along X Axis -n/+n increments til Collision Check Overlapping Object Count Drops below Set)
  2. Loop{} Move Along Y Axis -n/+n increments til Collision Check Overlapping Object Count Drops below Set)
  3. Loop{} Move Along Z Axis -n/+n increments til Collision Check Overlapping Object Count Drops below Set)
4. Adjust Rotation (Each Axis Toggled Independently)
  1. Loop{} Rotate X at n degrees upto 0 to 360 til Collision Check Overlapping Object Count Drops below Set Threshold
  2. Loop{} Rotate Y at n degrees upto 0 to 360 til Collision Check Overlapping Object Count Drops below Set Threshold
  3. Loop{} Rotate Z at n degrees upto 0 to 360 til Collision Check Overlapping Object Count Drops below Set Threshold
5. Adjust Scale (Last Sequence Each Axis Toggled Independently)
a. Uniform Scale
  1. Loop{} Scale Up|Down along X,Y,Z planes at specified -n/+n increments til Collision Check Overlapping Object Count Drops below Set Threshold
b. Non-Uniform Scale
  1. Loop{} Scale Up|Down along X plane at specified -n/+n increments til Collision Check Overlapping Object Count Drops below Set Threshold
  2. Loop{} Scale Up|Down along Y plane at specified -n/+n increments til Collision Check Overlapping Object Count Drops below Set Threshold
  3. Loop{} Scale Up|Down along Z plane at specified -n/+n increments til Collision Check Overlapping Object Count Drops below Set Threshold