[Tex/LaTex] 3d axis and polyhedron with line segment towards origin


I would like to make a 3d plot containing the 3d axis and a convex polyhedron or better a Dodecahedron


on the positive side for which one of its boundary edge points on its top is annotated e.g. \hat{x} "chosen" or "selected" and draw a line segment from that labeled point towards the origin. Then also highlight and annotate where this line segment intersects with the convex hull of the Dodecahedron. Would this be a nightmare to do using TikZ?

btw what's the best way to learn TikZ once and for all? are there good books? I always end up consuming TikZ one way or another 🙁

UPDATE: actually I need several plots around this same idea to illustrate in detail the behavior of an algorithm I need to document. I hope that by seeing how it is done for this case I will be able to generalize and do the others by myself … though knowing how difficult it TikZ … 🙁

Best Answer


\psset{Decran=30,viewpoint=20 40 30 rtp2xyz, lightsrc=viewpoint}
  args=my_dodecahedron 0,linecolor=blue,text=A,pos=uc,name=A]
  args=my_dodecahedron 4,linecolor=blue,text=B,pos=uc,name=B]
\psSolid[object=line,args=A B,linecolor=blue]
\psset{Decran=30,viewpoint=20 40 35 rtp2xyz, lightsrc=viewpoint}
%  numfaces=all,num=all,
   args=my_dodecahedron 2,linecolor=white,text=Centre face 2,pos=uc]
  args=my_dodecahedron 0,linecolor=white,text=A,pos=cl,name=A]
  args=my_dodecahedron 4,linecolor=white,text=B,pos=cl,name=B]
\psSolid[object=line,args=A B,linecolor=white]


enter image description here