[pstricks] Retrieving a 2D point from 3d
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Sat Jun 30 07:53:57 CEST 2012
Am 29.06.2012 23:39, schrieb Clemens Schäfermeier:
>
> 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
> }
important is a closed path:
\documentclass{article}
\usepackage{pst-3dplot}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-2,-4)(6,5)
\def\freqA{3 }
\def\pntB{1.5 \pstPI1 mul }
\def\pntC{3 \pstPI1 mul }
\pstThreeDCoor[zMax=10]
\pscustom[fillstyle=solid,fillcolor=red,opacity=0.5]{
\pstThreeDLine(0, 0, \pntB)(3 \pntB mul RadtoDeg sin, 0, \pntB)
\parametricplotThreeD[xPlotpoints=100,plotstyle=line](\pntB,\pntC)
{3 t mul RadtoDeg sin 0 t}
\pstThreeDLine(3 \pntC mul RadtoDeg sin, 0, \pntC)(0, 0, \pntC)
}
\pscustom[fillstyle=solid,fillcolor=blue,opacity=0.5]{
\pstThreeDLine(0, 0, \pntB)(0, 0, \pntB)
\parametricplotThreeD[style=tgreen,xPlotpoints=100,plotstyle=line](\pntB,\pntC)
{0 \freqA t \pntB sub mul RadtoDeg sin t}
\pstThreeDLine(0, 0, \pntC)(0, 0, \pntC)
}
\end{pspicture}
\end{document}
Herbert
More information about the PSTricks
mailing list