请考虑以下示例:
代码
\documentclass{article}
\usepackage{auto-pst-pdf,pst-solides3d}
\begin{document}
\begin{figure}
\psset{
viewpoint=15 -30 11,
Decran=10
}
\begin{pspicture}[solidmemory]
\psSolid[object=point,args=15 0 8.5,name=L]
\psSolid[object=point,args=-60 5 5,name=R]
\psSolid[object=line,linecolor=red!50,linestyle=dashed,linewidth=2pt,args=R L]
\psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,fillcolor=blue!50,
name=parallelepipedum,action=draw*](0 0 2)
\multido{\iA=0+1}{8}{%
\psSolid[object=point,linecolor=black,definition=solidgetsommet,
args=parallelepipedum \iA,name=C\iA]
\psset{
object=line,
linecolor=darkgray!50,
linestyle=dotted
}
\psSolid[args=L C\iA]
\psSolid[args=R C\iA]
}
\psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,
name=parallelipipidum,action=draw](0 0 2)
\end{pspicture}
\end{figure}
\end{document}
输出
问题
如何用实心黑线在框顶部画出两条对角线?此外,我想用点标记对角线的交点。
答案1
请提供最小例子。虚线对于您的问题并不重要。
\documentclass{minimal}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint=15 -30 11,Decran=10}
\begin{pspicture}[
% showgrid,
solidmemory,
% num=all
](-2,-1)(2,3)
\psSolid[object=parallelepiped,a=6.1,b=6.3,c=7.3,RotZ=-8,
name=parallelipipidum,fillcolor=blue!40,action=draw*](0 0 2)
\multido{\iA=0+1}{4}{%
\psSolid[object=point,definition=solidgetsommet,
args=parallelipipidum \iA,name=Top\iA,action=none]}
\psSolid[object=line,args=Top0 Top2]
\psSolid[object=line,args=Top1 Top3]
\psSolid[object=point,definition=solidcentreface,args=parallelipipidum 0]
\end{pspicture}
\end{document}
这些点在内部定义为<objectname> <no>
。<no>
可以使用可选参数找到num=all
。对于顶部,它们是0 1 2 3