[pstricks] Exiting a parametricplot

Poul Riis Poul.Riis at skolekom.dk
Sun Nov 23 08:20:02 CET 2008


Surprisingly, my simple exit command seems to work with
\parametricplotThreeD (see below)!?

Poul Riis



\documentclass[a4paper,12pt]{article}
\usepackage{inputenc}
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage{amsmath}
\usepackage[usenames,dvipsnames,x11names]{xcolor}
\usepackage{ifthen}
\usepackage{geometry}
\usepackage{multido}
\usepackage{pst-func}
\usepackage{pst-3dplot}
\usepackage{pstricks-add}

\def\getColor#1{\ifcase#1 Red1\or magenta\or Gold1\or Green1\or Orange\or
Blue1\or
Red1\or magenta\or Gold1\or Green1\or Orange\or Blue1\or
Red1\or magenta\or Gold1\or Green1\or Orange\or Blue1\or
Red1\or magenta\or Gold1\or Green1\or Orange\or Blue1\fi}

\begin{document}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psset{unit=2cm}
\psset{Alpha=195,Beta=10,Dx=10,Dy=10,Dz=10,drawing=true}
\pstThreeDPlaneGrid[linecolor=Green1,subticks=20](-4,-2)(4,2)
\pstThreeDCoor[xMin=-4,xMax=4,yMin=-2,yMax=2,zMin=0,zMax=2.5,IIIDticks=true]
\pstPlanePut[plane=xy](-3.5,0.8,0){\fbox{\Huge\color{Red2} Spinning ball}}
\pstVerb{
	/gg 9.82 def
	/v0 20 def
	/c0w 0.2 def
	/costhetac c0w v0 mul gg div 2 div neg def
	/sinthetac costhetac dup mul neg 1 add sqrt def
	/thetac sinthetac costhetac atan def
	/x2 gg c0w div def
	/pi 3.141592 def
}%
\multido{\nn=0+1}{16}{%
\parametricplotThreeD[linecolor=\getColor{\nn},xPlotpoints=200,linewidth=0.5pt,plotstyle=curve](0,60){	/theta
thetac \nn\space 4 sub 5 mul sub def	/x1 theta sin v0 mul def /x2 theta
cos v0 mul def /tt t 180 div pi mul c0w div def /zz tt x1 mul tt dup mul
gg mul 2 div sub def zz 0 lt {exit} if	t sin x2 mul c0w div 10 div    t
cos neg 1 add x2 mul c0w div 10 div    zz 10 div }%
}%
\end{pspicture}
\end{center}
\end{document}



More information about the PSTricks mailing list