I have done a research on the forum but apparently it has not been asked before.
Is there a “quick way” to do a sphere packing on a volume in the same way we do for the circle packing?
Let’s say that I have a volumetric field and I want the sphere to adapt to the stress when they get close to a low value field or get bigger to an high value field (same as circle packing based on image basically)
I have red this thread but it is not really want I am looking for.
I am pretty sure that it is possible but before I start writing some code, I am wondering if you are interested in sharing your solution first
That project is fairly complex though, and if you just want spheres of different sizes things can be much simpler as you just have scalars to interpolate instead of the tensors for orientation and anisotropy.
The key bit is how you want to input your radius field. Do you have values at regular grid points?
As a quick way using only existing components without scripting, you can also simply create a stack of coloured meshes (or rather a single disjoint mesh).
It should be fairly quick to make a new goal that would let you actually input a grid of points and values though for if you need also vertical interpolation of values instead of just closest in a discrete sampling as happens with this mesh stack approach. It could also optionally include collision with a boundary mesh, for if you wanted the spheres inside the volume, instead of just their centers inside.
I also posted recently an example of circle packing with adaptive radius, so the sizing is adjusted inside the goal calculation itself, which I think is a lot faster than what you’d get by putting the whole solver in some external loop.
That was for equal radius, but I think could probably be adapted to adjust a global multiplier for a range of radii from some image or 3d field.