# Plotting the intersection of a ball and a plane

I want to draw a semi-transparent ball and highlight its intersection with a plane.

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

r3d =
RegionPlot3D[ℛ,
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.6, 1.6}},
PlotPoints -> 30]

inter =
Region[RegionIntersection[ℛ, InfinitePlane[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]]]


Now why won't this work?

RegionPlot3D[inter,
PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}, {-1.6, 1.6}},
PlotPoints -> 30]


I have a implicit region and a plane, I form the intersection, but I'm unable to plot it.

On the one hand inter is already a Region and need not be wrapped by RegionPlot3D. RegionPlot3D wants to have a boolean expression as first argument; since an ImplicitRegion essentially consists of such a boolean expression, RegionPlot3D was also overloaded for ImplicitRegions.

On the other hand, ℛ is a ImplicitRegion; these are not plotted automatically. But you can turn it into a Region with Region[ℛ] to obtain a preview or apply DiscretizeRegion or DiscretizeBoundaryRegion to compute polyhedral approximations.

As side remark: RegionPlot3D was introduced in version 6.0 while Region was introduced in version 11.1. So RegionPlot3D follows an older mechanic; it was not meant as displaying/plotting function for Regions, even if the name might suggest that.

The why was answered long ago. This covers the mechanical details for visualizing the regions.

Clear["Global*"];
ℛ = ImplicitRegion[x^2 + y^2 + z^2 <= 1, {x, y, z}];
ℛshell =
ImplicitRegion[x^2 + y^2 + z^2 == 1, {x, y, z}];

plane = InfinitePlane[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];
inter = RegionIntersection[ℛ, plane];
outer = RegionIntersection[
ℛshell, plane
];

To visualize:

Show[
Region[Style[ℛ, Opacity[0.4, White]]
, SphericalRegion -> True]
, Region[Style[inter, Opacity[0.3, Green]]]
, Region[Style[outer, {Thick, Red}]]
, Region[Style[plane, Opacity[0.4, Orange]]]
, Graphics3D[{Point@RandomPoint[DiscretizeRegion@ℛshell, 100]}]
]


To view the circle inside the sphere with a dashed or hatched pattern, use the following variation:

Show[
Region[Style[ℛ, Opacity[0.4, White]]
, SphericalRegion -> True]
, Region[Style[outer, {Thick, Red}]]
, Region[Style[plane, Opacity[0.4, Orange]]]
, Graphics3D[{Point@RandomPoint[DiscretizeRegion@ℛshell, 100]}]
, RegionPlot3D[DiscretizeRegion@inter
, Mesh -> 10
, MeshFunctions -> {#1 &, #2 &}
, MeshShading -> {{Black, Yellow}, {Pink, Red}}
]
]
`

• Can I view dashed of the circle inside of sphere? Commented Jan 2 at 6:46