3D graphics overlaying with show function

I’d like to combine 3D curve and surface with Show in Mathematica 13.3. It is strange that the curve could not be hiden by the surface effectively even though the curve is behind the surface. The code is given as following,

\[CurlyPhi] = \[Pi] {1/4, 1/2, 3/4};
x[t_] := 2 + Cos[t];
z[t_] := Sin[t];
g1 = RevolutionPlot3D[{x[t], z[t]}, {t, 0, 2 \[Pi]}, {\[Phi], 0, 
    2 \[Pi]}, PlotPoints -> 100, Mesh -> None];
g2 = Table[
   ParametricPlot3D[{x[t] Cos[\[CurlyPhi][[i]]], 
     x[t] Sin[\[CurlyPhi][[i]]], z[t]}, {t, 0, 2 \[Pi]}], {i, 3}];
Show[g2, g1, ViewVector -> {{2.8, 0, 0}, {0, 2.5, 0}}, 
 ViewAngle -> 70 °, Boxed -> False, Axes -> False, PlotRange -> All]

The result is shown in the attached figure. Beside that there is no different If the curve is replaced by Mesh method as mesh thickness is set explicitly.

I guess the problem is the mixing of objects of different dimensions. If you use a Tube[] instead of a Line[] it seems to work correctly. I would do it like so:

\[CurlyPhi] = \[Pi] {1/4, 1/2, 3/4};
x[t_] := 2 + Cos[t];
z[t_] := Sin[t];
g1 = RevolutionPlot3D[{x[t], z[t]}, {t, 0, 2 \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotPoints -> 100, Mesh -> None, Axes -> False];
g2 = ParametricPlot3D[Table[{x[t] Cos[\[CurlyPhi][[i]]], x[t] Sin[\[CurlyPhi][[i]]], 
      z[t]}, {i, 3}], {t, 0, 2 \[Pi]}, PlotStyle -> Automatic] /. Line[p__] :> Tube[p, .05];
Show[g2, g1, Boxed -> False, Axes -> False, PlotRange -> All, ViewVector -> {{2.8, 0, 0}, {0, 2.5, 0}}, ViewAngle -> 70 °]

Thank you very much for your reply. Yes, it works good! But there is a new problem. If the radius of the tube is two small, it sames that the “curve” is dashed. For example, if to set Line[p__] :> Tube[p, .005], the result is showing in the attached figure. I don’t know how to deal with it as the radius of the tube should be fixed in my applying.

In Mathematica version 12.3 the rendering is as expected:

I see! One possibility would be to make sure that the tube runs completely just inside the big torus:

\[CurlyPhi] = \[Pi] {1/4, 1/2, 3/4};
rTube = .005;  (* radius of tube *)
x[t_] := 2 + Cos[t];
z[t_] := Sin[t];
g1 = RevolutionPlot3D[{x[t], z[t]}, {t, 0, 2 \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotPoints -> 100, Mesh -> None, Axes -> False];
g2 = ParametricPlot3D[Table[{(2 + (1 - rTube) Cos[t]) Cos[\[CurlyPhi][[i]]], (2 + (1 - rTube) Cos[t]) Sin[\[CurlyPhi][[i]]], (1 - rTube) z[t]}, {i, 3}], {t, 0, 2 \[Pi]}] /. Line[p__] :> Tube[p, rTube];
Show[g2, g1, Boxed -> False, Axes -> False, PlotRange -> All, ViewVector -> {{2.8, 0, 0}, {0, 2.5, 0}}, ViewAngle -> 70 °]

Does that help?

Hello Hans,

In Mathematica version 12.3 the rendering is as expected:

yes, at first I thought so too. But it appears not to be robust. E.g. try

ParametricPlot3D[...,  PlotStyle -> Thickness[.05]]

Yes, it is. The problem appears to be related with the view direction from inside to outside of the torus. There is no issue when the view direction in the opposite side.