12
$\begingroup$

Following the document, I generate a curve arrow tube using following code:

arrowtube = 
 With[{ra = .1, arhd = .25}, 
  Graphics3D[{Arrowheads[arhd], 
    Arrow[Tube[
      BSplineCurve[Table[{Cos[t], Sin[t], 0}, {t, 0, 3 Pi/2, Pi/10}]],
       ra]]}, Boxed -> False, ViewPoint -> {1, 1, 1}, 
   ImageSize -> {100, Automatic}, Method -> {"ShrinkWrap" -> True}]]

and it gives me

curve arrow tube

It seems that the arrow doesn't align with the curved path. How can I fix this?

$\endgroup$
17
$\begingroup$

The problem is that with the default cone, the pivot is not in the center, which can lead to the disconnected appearance. One solution is to specify a custom arrow tip to have more control over the pivot (which in this case is one fourth of the way from the base of the cone, where its center of mass is located):

arrowtube = With[
  {ra = .1, arhd = .25, 
   arrowtip = Graphics3D@Cone[{{-1/4, 0, 0}, {3/4, 0, 0}}, 0.3]},
  Graphics3D[
    {Arrowheads[{{arhd, 1, arrowtip}}], 
     Arrow[Tube[BSplineCurve[Table[{Cos[t], Sin[t], 0}, {t, 0, 3 Pi/2, Pi/10}]], ra]]},
     Boxed -> False, ViewPoint -> {1, 1, 1}, ImageSize -> {300, Automatic},
     Method -> {"ShrinkWrap" -> True}
  ]
]

Custom arrow tip

To get a better idea, here's a look inside: arrowtip = Graphics3D[{Opacity[0.5], Cone[{{-1/4, 0, 0}, {3/4, 0, 0}}, 0.3]}]

Custom arrow tip inside

$\endgroup$

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.