1
$\begingroup$

So in the following code, I would like to make the following animation. First: "t1" the blue line in the bottom together with "x,y,z" the blue lines in the top. So when "t1" finishes "z" finishes. This means "x,y,z" are 3 times faster than "t1"

Second: after that the red line "t2" in the bottom starts together with red lines "x1,y1,z1" in the top and finishes with "z1" as above.

I need also the lines to enter "b" (the second cylinder in the top) from the opposite direction. Thank you very much!

Dense skew lines

    x = ParametricPlot3D[{Cos[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Pi t]}, {t, 0, 10}, 
PlotStyle -> {Blue, Opacity[7]},MeshFunctions-> {#1 &}, Mesh -> {{0, Pi/2 - 100}}, MeshShading -> {None, Automatic, None}]

y = ParametricPlot3D[{Cos[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Pi t] + 4}, {t, 0, 10}, 
  PlotStyle -> {Blue, Opacity[7]}, MeshFunctions -> {#1 &}, Mesh -> {{0, Pi/2 - 100}}, MeshShading -> {None, Automatic, None}]

z = ParametricPlot3D[{Cos[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Sqrt[2] Pi t] (3 + Cos[Pi t]), Sin[Pi t] + 8}, {t, 0, 10}, 
PlotStyle -> {Blue, Opacity[7]}, MeshFunctions -> {#1 &},Mesh -> {{0, Pi/2 - 100}}, MeshShading -> {None, Automatic, None}]

x1 = ParametricPlot3D[{Cos[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]),Sin[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]), Sin[Pi t]}, {t, 0, 10}, PlotStyle -> {Red, Opacity[7]}, MeshFunctions -> {#1 &}, 
Mesh -> {{0, Pi/2 - 100}}, MeshShading ->{None, Automatic, None}]

y1 = ParametricPlot3D[{Cos[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]), Sin[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]), Sin[Pi t] + 4}, {t, 0, 10},PlotStyle -> {Red, Opacity[7]}, MeshFunctions -> {#1 &}, 
Mesh -> {{0, Pi/2 - 100}}, MeshShading -> {None, Automatic, None}]

z1 = ParametricPlot3D[{Cos[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]), 
Sin[1/2 Sqrt[3] Pi t] (3 + Cos[Pi t]), Sin[Pi t] + 8}, {t, 0, 10}, 
 PlotStyle -> {Red, Opacity[7]}, MeshFunctions -> {#1 &}, Mesh -> {{0, Pi/2 - 100}}, MeshShading -> {None, Automatic, None}]

a = ParametricPlot3D[{(3 + Cos[v]) Sin[u], (3 + Cos[v]) Cos[u],Sin[v]}, {u, -Pi, Pi}, {v, 0, 2 Pi}, MeshFunctions -> {#4 &},Mesh -> {{ -3 - Pi/16, -1 + Pi/16}},MeshShading -> {None, Automatic, None}]

b = ParametricPlot3D[{(3 + Cos[v]) Sin[u], (3 + Cos[v]) Cos[u], 
Sin[v] + 4}, {u, -Pi, Pi}, {v, 0, 2 Pi},MeshFunctions -> {#4 &},Mesh -> {{ -3 - Pi/16, -1 + Pi/16}}, MeshShading -> {None, Automatic, None}]

c = ParametricPlot3D[{(3 + Cos[v]) Sin[u], (3 + Cos[v]) Cos[u], Sin[v] + 8}, {u, -Pi, Pi}, {v, 0, 2 Pi}, MeshFunctions ->{#4 &},Mesh -> {{ -3 - Pi/16, -1 + Pi/16}}, 
MeshShading -> {None, Automatic, None}]


q = Graphics3D[{Thick,  Black, {Arrowheads[Large], Arrow[{{0, 0, -4}, {0, 0, -8}}]}}]t = ParametricPlot3D[{ (5 + 2 Cos[v]) Sin[u], (5 + 2 Cos[v]) Cos[u], 2 Sin[v] - 12}, {u, 0, 2 Pi}, {v, 0, 2 Pi},PlotStyle -> {Green, Opacity[0.5]}, MeshStyle -> None]t1 = ParametricPlot3D[{Cos[Sqrt[2] t] (5 + 2 Cos[t]),Sin[Sqrt[2] t] ( 5 + 2 Cos[t]), 2 Sin[t] - 12}, {t, 0, 40},PlotStyle -> {Blue, Opacity[1]}]
t2 = ParametricPlot3D[{Cos[0.7 Sqrt[3] t] (5 + 2 Cos[t]),Sin[0.7 Sqrt[3] t] (5 + 2 Cos[t]), 2 Sin[t] - 12}, {t, 0, 40}, PlotStyle -> {Red, Opacity[1]}]Show[a, b, c, x, y, z, x1, y1, z1, t, t1, t2, q, Axes -> False,Boxed -> False]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.