4

I would like to draw a Point on a surface using PSTricks and pst-solides3d. What I mean by that is, that the point should look like it is attached onto the surface. That means that the point should not look like a point from different views. My attempt is the following, using \psProjection, but it does not work:

\documentclass{minimal}
\usepackage{pst-solides3d}

\begin{document}

\begin{pspicture}[solidmemory](-10,-10)(10,10)
\psset{
    Decran=50,
    viewpoint=25 25 15 rtp2xyz
}
\psSolid[
    object=octahedron,
    a=2,
    trunc=all,
    trunccoeff=.3333,
    fillcolor=grey!20!,
    name=my_octahedron,
    action=draw*
]
% The following draws a point.
\psSolid[
    object=point,
    definition=solidcentreface,
    args=my_octahedron 10,
    linecolor=red,
    text=X,
    pos=uc
]
% The following is my attempt to plot the same point but looking as it would be attached to the plane of the octahedron.
\psProjection[
    object=point,
    args=0 0,
    linecolor=red,
    pos=uc,
    text=H,
    plan=my_octahedron 10
]
\axesIIID*(1.5,1.45,1.4)(2.7,2,2)
\end{pspicture}

\end{document}
  • 2
    Somewhat unrelated comments: It's not necessary to load other packages than pst-solides3d. Also, in general it's a bad idea to have blank lines within a pspicture environment. – Svend Tveskæg Mar 3 '14 at 15:17
  • @SvendTveskæg: Why do you think it's a bad idea having blank lines? – Marco Daniel Mar 3 '14 at 16:54
  • @MarcoDaniel I can't remeber the exact reason but a rather long time ago, Herbert told me this, if I'm not mistaken (which I could very well be). – Svend Tveskæg Mar 3 '14 at 17:05
8

You have to define the plane first:

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}    
\begin{document}

\begin{pspicture}[solidmemory](-4,-4)(5,5)
\psset{Decran=50,viewpoint=25 25 15 rtp2xyz}
\psSolid[object=octahedron,a=2,trunc=all,trunccoeff=.3333,
    fillcolor=gray!20!,name=my_octahedron,action=draw*]
% The following draws a point.
\psSolid[object=point,definition=solidcentreface,args=my_octahedron 10,
    linecolor=red,text=X,pos=uc]
\psSolid[object=plan,definition=solidface,args=my_octahedron 10,
    action=none,name=my_plan]% dont draw it
\psProjection[object=point,args=0 0,
    linecolor=blue,pos=uc,text=H,plan=my_plan]
\axesIIID*(1.5,1.45,1.4)(2.7,2,2)
\end{pspicture}

\end{document}

enter image description here

for a projected dot use

\psProjection[object=cercle,args=0 0 0.05,range=0 360,
    fillcolor=blue,fillstyle=solid,plan=my_plan]

enter image description here

  • This draws the point just the way before and only change the text right? I am interested in changing the appearance of the point itself. – DaPhil Mar 3 '14 at 20:20
  • Then you have to draw a filled circle or ellipse. See my edit. – user2478 Mar 3 '14 at 20:25

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.