PSTricks 3D 绘图--调整参数

PSTricks 3D 绘图--调整参数

考虑以下代码:

\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}

\psset{viewpoint = 15 -30 11, Decran = 10}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
  \psSolid[object = point, args = 15.5 3 7.3, name = L]
  \psSolid[object = point, args = -55 2 3.5,  name = R]
  \psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
  \psSolid[object = parallelepiped, a = 6.0, b = 6.0, c = 6.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
  \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.0, b = 6.0, c = 6.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
  \multido{\iB = 0+1}{4}{%
    \psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, 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}

输出

有人可以帮我调整参数,让每对虚线、灰线完美地重叠在一起吗?

我尝试了很久,但还是一无所获。:(

我应该指出,所讨论的参数是args = 15.5 3 7.3args = -55 2 3.5和。( 、、和a = 6.0, b = 6.0, c = 6.5, RotZ = -15的值对于两个对象应该相同。)abcRotZ

答案1

  1. 与地面平行的线的消失点位于眼睛的高度,因此物体z的位置point需要等于z的值viewpoint
  2. 指向水平角的线的消失点theta位于x=tan(theta)*yv + xv,其中yvxv分别是的x和分量。yviewpoint
  3. 消失点位于地平线上,即y=0

因此,对于 的视点15 -30 11和 的长方体的旋转-15 degrees,消失点位于23.04 0 11-96.96 0 11

\documentclass{article}

\usepackage{pst-solides3d}

\begin{document}

\psset{viewpoint = 15 -30 11, Decran = 6}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
  \psSolid[object = point, args = 23.04 0 11, name = L]
  \psSolid[object = point, args = -96.96 0 11,  name = R]
  \psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
  \psSolid[object = parallelepiped, a = 8.0, b = 8.0, c = 8.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
  \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 = 8.0, b = 8.0, c = 8.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
  \multido{\iB = 0+1}{4}{%
    \psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, 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}

相关内容