[pstricks] Countor lines withe pst-3dplot

Herbert Voss LaTeX at zedat.fu-berlin.de
Sat Jul 23 22:00:54 CEST 2005


Herbert Voss wrote:
> Denis Vergès wrote:
> 
>> I have do draw the surface $z = 2x + 0.5y^2 + 4$. You can open :
>>
>> www.fis.edu.hk/News/files/Bac%202005%20Maths%20Spec%20ES.pdf
>>
>> (page 6)
>>
>> How can I draw the countor lines 20-40, 60-80, 100-120 ?
> 
> 
> that is the problem, especially for the line with z=20.
> You can define some 3d nodes and then the 2d \pscurve(A)(B)...
> An option z= for the 3d plot maybe a good idea.

in the beta of http://perce.de/LaTeX/pst-3dplot/pst-3dplot.tex
is a new option zCoor. If it has a value, then psplotThreeD
uses only the x value, counts y from the given formula and
takes zCoor for (x; y(x); z) as vector triple. The syntax is the
same, e.g.

\psplotThreeD[zCoor=4,plotstyle=curve,liftpen=1](18,0)(0,12){ 72 x 4 mul 
sub sqrt }

the y intervall,e.g. (0,12), must be given, but is senseless.

attached the code and a png, but I do not think, that this new
option is really a good idea ...

Herbert


\documentclass{article}

\usepackage{pstricks}%
\usepackage{pst-3dplot}%
\SpecialCoor
\begin{document}

\psscalebox{0.5}{
\begin{pspicture}(-1,-3)(23,16)
   \psset{Beta=10,Alpha=170}
 
\pstThreeDCoor[xMin=0,yMin=0,zMin=0,xMax=20,yMax=20,zMax=12,linewidth=1pt]
   \psset{linewidth=0.1pt,linecolor=gray!40}
   \pstThreeDPlaneGrid[xsubticks=5,ysubticks=6](0,0)(20,12)
 
\pstThreeDPlaneGrid[planeGrid=xz,planeGridOffset=12,xsubticks=5,ysubticks=6](0,0)(20,12)
   \pstThreeDPlaneGrid[planeGrid=yz,xsubticks=5,ysubticks=6](0,0)(12,12)
   \psset{xPlotpoints=20,yPlotpoints=12,drawStyle=xyLines,%
	linecolor=black,linewidth=1.5pt}
 
\pscustom[fillstyle=solid,fillcolor=red!30,linecolor=red!30,linewidth=2pt]{
     \pstThreeDLine(8,0,2)(18,0,4)
     \psplotThreeD[zCoor=4,plotstyle=curve,liftpen=1](18,0)(0,12){ 72 x 
4 mul sub sqrt }
     \pstThreeDLine(0,8.485,4)(0,5.657,2)
     \psplotThreeD[zCoor=2,plotstyle=curve,liftpen=1](0,8)(0,12){ 32 x 4 
mul sub sqrt }
   }
 
\pscustom[fillstyle=solid,fillcolor=red!20,linecolor=red!20,linewidth=2pt]{
     \pstThreeDLine(20,5.657,6)(20,8.485,8)
     \psplotThreeD[zCoor=8,plotstyle=curve,liftpen=1](20,2)(0,12){ 152 x 
4 mul sub sqrt }
     \pstThreeDLine(2,12,8)(0,12,7.6)(0,10.583,6)
     \psplotThreeD[zCoor=6,plotstyle=curve,liftpen=1](0,20)(0,12){ 112 x 
4 mul sub sqrt }
   }
 
\pscustom[fillstyle=solid,fillcolor=red!10,linecolor=red!10,linewidth=2pt]{
     \pstThreeDLine(20,10.583,10)(20,12,11.6)(12,12,10)(20,10.583,10)
   }
   \psplotThreeD(0,20)(0,12){ x dup add y dup mul 2 div add 4 add 10 div}
\end{pspicture}}
\end{document}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3d.png
Type: image/png
Size: 11031 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20050723/dfaceca4/attachment.png 


More information about the PSTricks mailing list