9
$\begingroup$

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?

$\endgroup$

1 Answer 1

12
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ And I would have bet that casting a shadow wouldn't be possible :) $\endgroup$
    – eldo
    Oct 3, 2023 at 11:26
  • $\begingroup$ 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. $\endgroup$
    – kglr
    Oct 3, 2023 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.