How to plot a hole in a hole in a hole?

706 Views Asked by At

There is an image from this book.(page 22)

I want to plot it, but I don't know equation of this surface.

enter image description here

Anyone have an idea about it and how to plot it with Mathematica?

1

There are 1 best solutions below

3
On

I was planning to answer this on Mathematica.stackexchange but it was migrated before I finished :(

Fortunately it still asks for Mathematica coding tips and additionally my answer contains some formulas so it should be on topic :)

I imagined I will give a neat example of region related features but it is quicker to write parameters manually than to wait for TransformedRegion with Scaling/RotationTransform to return.

torus = ImplicitRegion[(Sqrt[x^2 + y^2] - .7)^2 + z^2 < .2^2, {x, y, z}];

tube = ImplicitRegion[x^2 + y^2 < .1 z^2 + .1, {x, y, z}];

smallTube =  ImplicitRegion[
   x^2 + z^2 < .05 (y - 1.2)^2 + .01 && .6 <= y <= 2.5, 
   {x, y, z}
];

RegionPlot3D[
    Fold[
        RegionDifference
      , Ball[{0, 0, 0}, 2]
      , {torus, tube, smallTube
          , TransformedRegion[smallTube, ReflectionTransform[{0, 1, 0}]]
        }
    ]
  , BaseStyle -> Opacity[.5]
  , PlotPoints -> 60
]

enter image description here