我想使用PSTricks
和在表面上绘制一个点pst-solides3d
。我的意思是,该点应该看起来像是附着在表面上。这意味着从不同角度看,该点不应该看起来像一个点。我的尝试如下,使用\psProjection
,但它不起作用:
\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}
答案1
您必须先定义平面:
\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}
对于投影点使用
\psProjection[object=cercle,args=0 0 0.05,range=0 360,
fillcolor=blue,fillstyle=solid,plan=my_plan]