2
$\begingroup$

I have this code:

  openCone[{{x1_, y1_, z1_}, {x2_, y2_, z2_}}, r_] := {CapForm[None], 
      Tube[{{x1, y1, z1}, {x2, y2, z2}}, {r, 0}]}
    Manipulate[
     Lcone = Graphics3D[{EdgeForm[Directive[Thick, Dashed, Black]], 
        LightGray, openCone[{{0, 0, 5}, {0, 0, 0}}, 4]}, Boxed -> False, 
       ViewPoint -> {5, 5, 2}];
     Lvec = Graphics3D[{Black, Arrowheads[0.05], 
        Arrow[Tube[{{0, 0, 0}, {Sqrt[4^2 - \[Rho]L^2], \[Rho]L, 5}}, 
          0.05]]}];
     Scone = Graphics3D[{EdgeForm[Directive[Thick, Dashed, Black]], Gray, 
        openCone[{{0, 0, 7}, {0, 0, 0}}, 3]}, Boxed -> False];
     Svec = Graphics3D[{Black, Arrowheads[0.05], 
        Arrow[Tube[{{0, 0, 0}, {Sqrt[3^2 - \[Rho]S^2], \[Rho]S, 7}}, 
          0.05]]}];
     Jvec = Graphics3D[{Black, Arrowheads[0.1], 
        Arrow[Tube[{{0, 0, 0}, {0, 0, Sqrt[5^2 + 7^2]}}, 0.05]]}];
     Show[Lcone, Lvec, Scone, Svec, Jvec], {\[Rho]L, 1.12}, {\[Rho]S, 
      2.96}]

That produces this plot: enter image description here

I would like to know whether it's possible:

  • to make the cone smoother? You can see the triangulation

  • How do I properly make the arrowhead match with the top of the arrow?

$\endgroup$

1 Answer 1

4
$\begingroup$

We can have custom arrowhead placements with the following specs:

enter image description here

The tubes can be rendered at higher fidelity with Method -> {"TubePoints" -> pts}.

openCone[{{x1_, y1_, z1_}, {x2_, y2_, z2_}}, r_] := {CapForm[None], 
  Tube[{{x1, y1, z1}, {x2, y2, z2}}, {r, 0}]}

arrowHead[size_] := Arrowheads[{{size, 0.93, 
  {Graphics3D[{EdgeForm[], Cone[{{0, 0, 0}, {1, 0, 0}}, .25]}], 0}}}]

Manipulate[
 Lcone = Graphics3D[{EdgeForm[Directive[Thick, Dashed, Black]], 
    LightGray, openCone[{{0, 0, 5}, {0, 0, 0}}, 4]}, Boxed -> False, 
   ViewPoint -> {5, 5, 2}];
 Lvec = Graphics3D[{Black, Arrowheads[0.05], 
    Arrow[Tube[{{0, 0, 0}, {Sqrt[4^2 - \[Rho]L^2], \[Rho]L, 5}}, 
      0.05]]}];
 Scone = Graphics3D[{EdgeForm[Directive[Thick, Dashed, Black]], Gray, 
    openCone[{{0, 0, 7}, {0, 0, 0}}, 3]}, Boxed -> False];
 Svec = Graphics3D[{Black, Arrowheads[0.05], 
    Arrow[Tube[{{0, 0, 0}, {Sqrt[3^2 - \[Rho]S^2], \[Rho]S, 7}}, 
      0.05]]}];
 Jvec = Graphics3D[{Black, Arrowheads[0.1], 
    Arrow[Tube[{{0, 0, 0}, {0, 0, Sqrt[5^2 + 7^2]}}, 0.05]]}];
 Show[Lcone, Lvec, Scone, Svec, Jvec, Method -> {"TubePoints" -> 400}], {\[Rho]L, 1.12}, {\[Rho]S, 
  2.96}]

enter image description here

$\endgroup$
12
  • $\begingroup$ Thanks, could you forward a documentation update request? "TubePoints" is not mentioned for Graphics3D Method. $\endgroup$
    – Kuba
    Dec 12, 2018 at 13:20
  • $\begingroup$ In my prerelease of 12 it's mentioned in the Graphics3D Details & Options, which is how I found it. i.stack.imgur.com/i5UZ0.png $\endgroup$
    – Greg Hurst
    Dec 12, 2018 at 13:25
  • $\begingroup$ Sweet! Can't use v12 at the moment because FE goes crazy on my Win10. $\endgroup$
    – Kuba
    Dec 12, 2018 at 13:32
  • $\begingroup$ Hey thanks for the answer. I literally copied and pasted your code, but my arrows still come up like in picture. With part of the body sticking out of the head... $\endgroup$ Dec 12, 2018 at 19:29
  • $\begingroup$ Hmm, does changing arrowHeads to Arrowheads[{{size, 1, ... fix things? $\endgroup$
    – Greg Hurst
    Dec 12, 2018 at 19:31

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.