9

Looking at this surface, which I created with Blender / Python,

enter image description here

I asked myself how we can duplicate some aspects of the scene with Mathematica.

Thanks to its excellent documentation I could swiftly produce:

ParametricPlot3D[
 {Cos[u] * v Sqrt[1 - v], Sin[u] * v Sqrt[1 - v], v},
 {u, 0, 2 Pi}, {v, -1, 1},
 ImageSize -> Large,
 Mesh -> 25,
 MeshShading -> {{Gray, Gray}, {None, Gray}},
 MeshStyle -> None,
 PlotPoints -> 40]

enter image description here

I don't think that we can produce the shadows with Mathematica. But would it be possible

  1. to thicken the paper-thin stripes? (Blender's solidify - modifier does this automatically)

  2. to place the Ding-Dong on a plane and add a horizon to create an illusion of depth?

  3. to add some interesting lighting?

eldo
  • 67,911
  • 5
  • 60
  • 168

1 Answers1

12

Easier parts of the question can be handled using "ThickSurface" as PlotTheme (alternatively, using the option Extrusion) and MaterialShading as PlotStyle, and playing with the settings for MeshFunctions and Mesh:

amesh = Prepend[0] @
   Accumulate @ Riffle[ConstantArray[2 Pi/16, 16], Pi/32, {1, -1, 2}];

zmesh = Rescale[#, MinMax @ #, {-1 + 2/59, 1}] &@ Accumulate[Flatten @ ConstantArray[{1, 5}, 10]];

dingdong = ParametricPlot3D[ {Cos[u]v Sqrt[1 - v], Sin[u]v Sqrt[1 - v], v}, {u, 0, 2 Pi}, {v, -1, 1}, ImageSize -> Large, MeshFunctions -> {#4 &, #5 &}, Mesh -> {amesh, zmesh}, PlotStyle -> MaterialShading["Iron"], MeshShading -> {{Automatic, Automatic}, {None, Automatic}}, PlotTheme -> "ThickSurface", Lighting -> "ThreePoint", MeshStyle -> None, PlotPoints -> 40 ];

shadow = ParametricPlot3D[ {Cos[u]v Sqrt[1 - v], Sin[u]v Sqrt[1 - v], -1}, {u, 0, 2 Pi}, {v, -1, 1}, MeshFunctions -> {#4 &, #5 &}, Mesh -> {amesh, zmesh}, PlotStyle -> LightGray, MeshShading -> {{Automatic, Automatic}, {None, Automatic}}, Lighting -> "ThreePoint", MeshStyle -> None, PlotPoints -> 40];

Show[dingdong, shadow]

enter image description here

Remove PlotTheme -> "ThickSurface" and add the option Extrusion -> .1 to get

enter image description here

Use MaterialShading["Gold"] to get

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
  • And I would have bet that casting a shadow wouldn't be possible :) – eldo Oct 03 '23 at 11:26
  • shadow uses the quickest/dirtiest way (assuming a main light source at {0,0 Infinity}). Something along the lines of this answer may be used to create a better shadow. – kglr Oct 03 '23 at 11:40