Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 14 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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