I am trying to make a blob like the one shown below, but in 3D so I can rotate it. I'm trying to use ParametricPlot3D
or SphericalPlot3D
. I can make a sphere easily. But my knowledge of how to modify the sphere to make it bulge out in a few places in limited. Anyone have any suggestions? I'd like to make it non symmetric so it look like a random blob like the one below. If I can create the outside blob I'm sure I can create an inside one. I can than place the vectors in the appropriate places. I am a teacher trying to illustrate how to use the divergence theorem on a region like this. Any suggestions would be appreciated. Thank you.
Answer
This can also be made a little lumpier with spherical harmonics.
realization[r_] :=
Assuming[{0 <= θ <= π, 0 <= φ <= 2 π},
Simplify[r + Abs[ComplexExpand[Plus @@ Flatten[
Table[ RandomReal[{-1, 1}] 1/(l^2 + m^2)
SphericalHarmonicY[l, m, θ, φ],
{l, 1, 4}, {m, 0, l}]
]]]]]
Block[{inner, outer},
outer = realization[1];
inner = realization[1/2];
Show[
SphericalPlot3D[outer, {θ, 0, π}, {φ, 0, 2 π},
PlotStyle -> Directive[Orange, Opacity[0.2], Specularity[White, 10]],
Mesh -> None, PlotPoints -> 50],
SphericalPlot3D[inner, {θ, 0, π}, {φ, 0, 2 π},
PlotStyle -> Directive[GrayLevel[0.4], Opacity[0.2], Specularity[White, 10]],
Mesh -> None, PlotPoints -> 50],
Axes -> False, Boxed -> False
]]
Comments
Post a Comment