Bread has a bubbly texture that I would like to be able to recreate using Mathematica.
Here are some examples of bubble textures:
- Bread
- Swiss cheese
- Foam
Note that most of the bubbles are ellipsoids or more complex 3D forms (only 'isolated' bubbles in the second case are approximately spherical). Bubbles generally do not intersect but are deformable by each other (and by the original 'pre-cut' boundary of the object - e.g. in the case of bread). Closely spaced bubbles approach polyhedrons with a minimum curvature at the 'vertices' (like 3D Voronoi texture).
I can generate a bunch of spheres intersecting a cube easily using something like:
Graphics3D[{Cuboid[{-2, -2, -5}, {8, 10, 10}],
Sphere[RandomReal[10, {500, 3}], RandomReal[{0.1, 1}]]}]
But I can't see how to variably change their shape or allow them to deform without intersecting. Ultimately I'm looking to make bubbles that are deformed by each other and the 'pre-cut' boundary of the solid. I am thinking that one way to visualise this would be generate the bubbles (for example, within a 'pre-cut loaf' shape) and combining this with a surface slice using ParametricPlot3D
to end up with something like this:
(but with nice bubbles inside!)
I realise that it may be non-trivial to work out how the bubbles deform...
Also, it would be nice to be able to add colours and 2D textures to the different surfaces to, for example, brown the crust, add wholemeal flakes etc.
How would one go about creating a semi-realistic bubble texture intersecting a 3D surface and/or volume?
(P.S - Not entirely relevant but there are some inspiring forms here and here)
ExampleData[{"TestImage3D", "CTengine"}]
$\endgroup$