[pstricks] Retrieving a 2D point from 3d

Clemens Schäfermeier XC-lemens at web.de
Sat Jun 30 10:45:41 CEST 2012


Sorry I've made a mistake when shortening the code. Here's the correct 
one with a picture of how it looks at the moment, so you easily could 
guess what I described below and know why I tried pscustom...

\documentclass[a4paper,fleqn,dvips]{article}

\usepackage{pstricks}
\usepackage{pst-solides3d}
\usepackage{pst-3dplot}
\usepackage{pstricks-add}

\defineTColor{tgreen}{green}
\defineTColor{tred}{red}

\begin{document}
\begin{pspicture}(-2,-4)(6,2.5)

	\def\freqA{3\space}
	\def\pntB{1.5 \pstPI1 mul\space}
	\def\pntC{3 \pstPI1 mul\space}
	
	\psset{RotSequence=xyz,RotZ=-90,RotY=-90,RotX=0,Alpha=40,Beta=50,RotSet=set}
	\pstThreeDCoor[xMin=-1.5,yMin=-1.5,zMin=-1,xMax=1.5,yMax=1.5,zMax=.5 
\pntC add]

	\parametricplotThreeD[style=tgreen,xPlotpoints=100,plotstyle=line](\pntB,\pntC)
	{0 \freqA t \pntB sub mul Sin t}
	
	\parametricplotThreeD[style=tred,xPlotpoints=100,plotstyle=line](\pntB,\pntC)
	{\freqA t mul Sin 0 t}

\end{pspicture}
\end{document}


Am 29.06.2012 23:39, schrieb Clemens Schäfermeier:
> Dear PStricks team,
> I'd like to improve the following code:
>
> \documentclass[a4paper,fleqn,dvips]{article}
> \usepackage[T1]{fontenc}
> \usepackage[ansinew]{inputenc}
>
> \usepackage{pstricks}
> \usepackage{pst-solides3d}
> \usepackage{pst-3dplot}
> \usepackage{pstricks-add}
>
> \defineTColor{tgreen}{green}
> \defineTColor{tred}{red}
>
> \begin{document}
>
> \begin{pspicture}(-2,-4)(6,2.5)
>
>      \def\freqA{3\space}
>
>      \def\pntB{1.5 \pstPI1 mul\space}
>      \def\pntC{3 \pstPI1 mul\space}
>
>
>      \pstThreeDCoor
>
> \psset{RotSequence=xyz,RotZ=-90,RotY=-90,RotX=0,Alpha=40,Beta=50,RotSet=set}
>
>
>      \parametricplotThreeD[style=tgreen,xPlotpoints=100,plotstyle=line](\pntB,\pntC)
>      {0 \freqA t \pntB sub mul Sin t}
>
>      \parametricplotThreeD[style=tred,xPlotpoints=100,plotstyle=line](\pntB,\pntC)
>      {\freqA t mul Sin 0 t}
>
> \end{pspicture}
>
> \end{document}
>
> In this, I'd like to fill both plots with the z axis. Instead, the
> filling is between the end and the start of it. This is because the
> starting (respectively the end) point of one of the plots is not on the
> z axis.
> I've tried to use pscustom instead, with the "moveto" command first,
> then drawed the plot without the line, and finally, the filling. But
> that didn't work good since I'm not able to retrieve the endpoint in 2D.
> Here's the idea:
>
> \pscustom[linestyle=none]{
>      \newpath
>      \moveto(!
> %    (0,0,\pntC) -> x'
> %    (0,0,\pntC) -> y')
>      \gsave
>      \parametricplotThreeD[xPlotpoints=100,plotstyle=line](\pntB,\pntC)
>      {0 \freqA t \pntB sub mul Sin t}
>      \fill[style=tred]
>      \grestore
>      \closepath
> }
>
> Looking into the pst-3dplot manual didn't help me either, since there is
> not the appropriate transformation given. (on one off the first pages
> there is one, but this is not correct for my case, since the x'
> coordinate is due to the first and second 0's (0,0,\pntC) always 0.
>
> Thanks for any help
> Clemens
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.PNG
Type: image/png
Size: 12118 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20120630/0167b6e9/attachment.png>


More information about the PSTricks mailing list