Trying to make a nice three-dimensional graphics of cone intersected by a plane I choose a slight rearrangement of an existing approach in Mathematica (i.e. books by S.Mangano and S.Wagon). The code beneath is assumed to show so-called Dandelin construction : the inner and outer spheres tangent internally to a cone and also to a plane intersecting the cone. Tangency points of spheres to the plane at the same time are foci of the ellipse.
Block[{r1, r2, m, h1, h2, C1, C2, M, MC1, MC2, T1, T2, cone, slope, plane},
{r1, r2} = {1.4, 3.4};
m = Tan[70.*Degree];
h1 := r1*Sqrt[1 + m^2];
h2 := r2*Sqrt[1 + m^2];
C1 := {0, 0, h1};
C2 := {0, 0, h2};
M = {0, MC1 + h1};
MC2 = MC1*(r2/r1);
MC1 = (r1*(h2 - h1))/(r1 + r2);
T1 = C1 + r1*{-Sqrt[1 - r1^2/MC1^2], 0, r1/MC1};
T2 = C2 + r2*{Sqrt[1 - r2^2/MC2^2], 0, -(r2/MC2)};
cone[m_, h_] := RevolutionPlot3D[{t, m*t}, {t, 0, h/m}, Mesh -> False][[1]];
slope = (T2[[3]] - T1[[3]])/(T2[[1]] - T1[[1]]);
plane = ParametricPlot3D[{t, u, slope*t + M[[2]]}, {t, -2*m, 12/m}, {u, -3, 3},
Boxed -> False, Axes -> False][[1]];
Graphics3D[{{Gray, Opacity[0.39], cone[m, 1.2*(h2 + r2)]},
{Opacity[0.5], Sphere[C1, r1], Sphere[C2, r2]},
{LightBlue, Opacity[0.6], plane},
PointSize[0.0175], Point[T1], Point[T2]},
Boxed -> False, Lighting -> "Neutral",
ViewPoint -> {-1.8, -2.5, 1.5}, ImageSize -> 950]]
Here is the graphics :
The problem is with the white spots around the both spheres near tangency points. Putting the above code to Manipulate[...GrayLevel[z]...{z,0,1} ]
we can easliy "remove" the spots as z tends to 1.
Can anyone see a different approach to removing the white spots ? I prefer
GrayLevel[z]
with z < 0.5.I have been intrigued with a slightly different pattern of the spots on the lower and upper spheres on the graphics . Have you got any ideas how this could be explained ?
You might want to make the spheres a tiny bit smaller:
It's a hack, but it avoids the intersection problem.
Alternatively, you can up the PlotPoints on the cone:
but that will make the rendering slower.
Edit: Or a combination of these to help with speed and quality.
Why has no one suggested to just use the built-in
Cone[]
primitive?This works fine here (no white spots). Also, it's not a hack or workaround. The purpose of the empty
EdgeForm[]
is to remove the black outline of the cone base.I just realized that
Cone[]
has a solid base, also very visible on the included image. So this is not exactly the same as the originalRevolutionPlot
version.You could construct the cone using a
Tube
with varying radii: