0
$\begingroup$

The following image represents two worlds drawn as tori with one door on each world. I would like to draw a bidirectional red arrow --- if possible as a tube for the fun --- going from one door to the other.

But my tentative solution is very poor. Any idea?

torus2 = First[
       ParametricPlot3D[{(4 + Cos[2 π v]) Sin[
           2 π u], (4 + Cos[2 π v]) Cos[2 π u], 
         Sin[2 π v]}, {u, 0, 1}, {v, 0, 1}, Boxed -> False, 
        Axes -> False, MeshFunctions -> {#3 &}, Mesh -> 0, 
        ColorFunction -> "BrownCyanTones"]];
    p2 = {LightBlue, AbsolutePointSize[20], Point[{2.5, 4, 1}]};
    g3D2 = Graphics3D[{p2, torus2}, Boxed -> False];
    torus1 = First[
       ParametricPlot3D[{(4 + Cos[2 π v]) Sin[
           2 π u], (4 + Cos[2 π v]) Cos[2 π u], 
         Sin[2 π v]}, {u, 0, 1}, {v, 0, 1}, Boxed -> False, 
        Axes -> False, MeshFunctions -> {#3 &}, Mesh -> 0, 
        ColorFunction -> "AlpineColors"]];
    p1 = {LightRed, AbsolutePointSize[20], Point[{-2.5, -4, 1}]};
    g3D1 = Graphics3D[{p1, torus1}, Boxed -> False];
    a1 = Graphics[{{Thick, 
        Arrow[BezierCurve[{{-2, 3}, {1, 3.5}, {2, 2}}]]}}]
    GraphicsRow[{, g3D2, a1, g3D1,}]

enter image description here

$\endgroup$
  • $\begingroup$ The third example in Arrow docs is way closer to what you describe than what your attempt shows. $\endgroup$ – Kuba Apr 10 '17 at 6:51
2
$\begingroup$
Graph[{1 -> 2}, VertexShape -> {1 -> g3D1, 2 -> g3D2}, 
 VertexCoordinates -> {{0, 0}, {1, 0}}, 
 EdgeShapeFunction -> ({Arrowheads[{Large}], Thick, 
     Arrow[GraphElementData[{"CurvedArc",  "Curvature" -> 1}][##], .1]} &), 
 VertexSize -> Large]

Mathematica graphics

or, using Graphics3D

Graphics3D[{g3D1[[1]], Translate[g3D2[[1]], {20, 0, 0}], Opacity[.5], Red, 
  Arrow[Tube[#, .25]&@BSplineCurve[{{3, 6, 0}, {7, 15, 0.}, {15, 5, .0}}], 0.1]}, 
  Boxed -> False]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Super Exactly what I was searching. $\endgroup$ – cyrille.piatecki May 4 '17 at 4:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.