Hello, I'm trying to find a way to efficiently scatter boxes inside a static object in such a way that they can cover as much of its volume as they possibly can.
Conditions for boxes I'm trying to meet:
- they may overlap, but their size should be proportional to the volume to be covered (e.g. 1 larger box rather than 100 small boxes for a given volume ),
- should cover as much volume as possible without straying too far outside of a geometry (coverage can be approximate),
- cannot be skewed, in the end, they need to stay orthogonal.
I've tried scattering boxes inside the volume first and then expanding them until they hit the boundary, but this method is slow and inefficient. I also tried clustering voxelized object, but this method is inefficient as well with complex geometry meshes (e.g. long, thin parts placed at an angle require small voxel size to catch the shape).
The closest I could get to the result I wanted was to use the convex decomposition to decompose mesh into convex shapes and then replace them with boxes. This works decent as a starting point, but often creates excess shapes that I'm struggling to find a way to cluster.
If anyone knows a better logic for approaching this problem or has a different idea I should try, I would be grateful.
pack_000.hiplc