[pstricks] multido

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Nov 22 20:59:48 CET 2008


Michael Sharpe schrieb:
> You can clip in each ThreeD plane to get something that may work. You  
> have to be very careful to not introduce glue which can mess up the  
> spacing----that's why all the % within the \multido.
> 
> \documentclass[dvips]{article}
> \usepackage{pst-3dplot}
> \usepackage{pst-all}
> \usepackage{fp}

there is no need for the fp package

 \documentclass[dvips]{article}
\usepackage{pst-3dplot}
\usepackage{multido}
\begin{document}
\psset{unit=1in}
\begin{pspicture}(-1.5,-1.5)(1.5,1.5)
\pstThreeDCoor[xMin=-2,xMax=2,yMin=-2,yMax=2,zMin=-2,zMax=2]
\multido{\nA=-1+.1}{21}{%
\begin{psclip}{%
  \pstThreeDLine[linestyle=none]%
    (\nA, 1 \nA\space dup mul sub sqrt neg,-1)%
    (\nA, 1 \nA\space dup mul sub sqrt neg,-1)%
    (\nA, 1 \nA\space dup mul sub sqrt,1)%
    (\nA, 1 \nA\space dup mul sub sqrt neg,1)%
    (\nA, 1 \nA\space dup mul sub sqrt neg,-1)}%
  \parametricplotThreeD[linecolor=red](-1,1)%
    {\nA\space t \nA\space dup mul t t  mul sub}%
\end{psclip}%
%slices with y fixed---interchange x, y
\begin{psclip}{%
  \pstThreeDLine[linestyle=none]%
    (1 \nA\space dup mul sub sqrt neg,\nA,1)%
    (1 \nA\space dup mul sub sqrt,\nA,-1)%
    (1 \nA\space dup mul sub sqrt,\nA,1)%
    (1 \nA\space dup mul sub sqrt neg,\nA,1)%
    (1 \nA\space dup mul sub sqrt neg,\nA,-1)}
 \parametricplotThreeD[linecolor=blue](-1,1)%
  {t \nA\space t t mul  \nA\space dup mul sub}%
\end{psclip}%
}
\end{pspicture}
\end{document}

Herbert


More information about the PSTricks mailing list