# Most convenient way to visualize the internal structure of a three-dimensional manifold

Let's say we have a 3D spherical shell specified by the command:

Regionplot3D[1/2<x^2+y^2+z^2<1,{x,-2,2},{y,-2,2},{z,-2,2},BoxRatios->Automatic]


When looking at this manifold from the outside, we see a sphere. Even projections of a sphere on a plane will not give information that this is not a sphere, but a spherical shell with a certain thickness of the shell.

I became interested in the most convenient way to display the internal structure of this manifold. It comes to mind to use ContourSlice. But the graph, even with the number of slices for each of the planes $$=3$$, can look very cumbersome and unreadable. ScatterPlot does not display information about the internal structure of the manifold.

Are there any special projections, plots, commands, or other ways to display the internal structure of a three-dimensional manifold in most convenient way?

• The question title is a bit misleading. While what you have here is technically speaking a three-dimensional manifold with boundary, it is hardly a typical example of 3D manifolds. Most 3D manifolds can't be embedded in $\mathbb{R}^3$, for the same reason e.g. a torus can't be embedded in $\mathbb{R}^2$. Commented Jan 12, 2023 at 17:16
• @leftaroundabout Thanks for the clarification. I will keep this in mind in the following questions. I have tried to find mathematical tools (maybe some kind of transformation) that would allow us to explore the internal structure of three-dimensional objects (formed by functions or inequalities), but so far without success.
– ayr
Commented Jan 15, 2023 at 8:29

Instead of using a predicate you could use a binary function and either "SliceDensityPlot3D" or "SliceContourPlot3D":

SliceContourPlot3D[
If[1/2 < x^2 + y^2 + z^2 < 1, 1, 0], {x, -2, 2}, {y, -2, 2}, {z, -2,
2}, BoxRatios -> Automatic, PlotPoints -> 80]


• I liked the idea of dividing the scope of a function using slices. For some time I tried to figure out how to do this in Math and I got this code. surf = {{"XStackedPlanes", Range[-1, 1, 0.25]}}; Show[SliceContourPlot3D[If[1/2 < x^2 + y^2 + z^2 < 1, 1, 0], surf, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, ColorFunction -> Function[{z}, Opacity[0.1, #] &@ColorData["TemperatureMap"][z]], BoundaryStyle -> None, ContourStyle -> PlotTheme -> "Detailed", ContourStyle -> None]]
– ayr
Commented Jan 11, 2023 at 17:10
• What I would like to get ideally: remove the boundary, build more slices, make them clearer, paint over the solution area of the function, and most importantly, make all the projections of the slices on the corresponding plane so that they are in one picture. I will continue to work on this. I will be glad if you suggest your own option.
– ayr
Commented Jan 11, 2023 at 17:10
• For arbitary 3D object,we can use Show+ClipPlanes to cut the 3D object and view it's internal.
Clear[plot];
plot = RegionPlot3D[
1/2 <= x^2 + y^2 + z^2 <= 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}];
Manipulate[
Show[plot, ClipPlanes -> {-1, -1, -1, c},
ViewPoint -> {2, 1, 1}], {c, 0, 3}]


• 3D object define by ParametricPlot3D.
Clear[plot];
plot = ParametricPlot3D[{Cos[u], Sin[u] + Cos[v], Sin[v]}, {u, 0,
2 π}, {v, -π, π}];
Manipulate[
Show[plot, ClipPlanes -> {-1, -1, -1, c},
ViewPoint -> {2, 1, 1}], {c, -1, 3}]


• Another example which define by region.
Clear[reg];
reg = MengerMesh[2, 3];
Manipulate[
Show[reg, ClipPlanes -> {-1, -1, -1, c}, ViewPoint -> {2, 1, 1}], {c,
1, 3}]


Clear["Global*"]


To look inside, you could cut a segment out of the sphere

RegionPlot3D[
1/2 < x^2 + y^2 + z^2 < 1 && (x < 0 || y > 0 || z < 0),
{x, -2, 2}, {y, -2, 2}, {z, -2, 2},
PlotPoints -> 100,
MaxRecursion -> 3,
Mesh -> None]


EDIT: Use Manipulate to select an octant to be removed

condList = Join[
((Or[#[[1]][x, 0], #[[2]][y, 0], #[[3]][z, 0]]) ->
(SortBy[First][Simplify[Not[
(Or[#[[1]][x, 0], #[[2]][y, 0], #[[3]][z, 0]])]]])) & /@
Tuples[{Less, Greater}, {3}], {True -> None}];

Manipulate[
RegionPlot3D[1/2 < x^2 + y^2 + z^2 < 1 && cond,
{x, -2, 2}, {y, -2, 2}, {z, -2, 2},
PlotPoints -> 100,
MaxRecursion -> 3,
Mesh -> None],
{{cond, x < 0 || y > 0 || z < 0, "removed octant"},
condList,
SynchronousUpdating -> False,
TrackedSymbols :> {cond}]
`

• This is a great option! I can experiment and then the internal structure will become more or less clear. I also like the "slice" option. See my comment on another answer.
– ayr
Commented Jan 11, 2023 at 17:14