[pstricks] Retrieving a 2D point from 3d

Clemens Schäfermeier XC-lemens at web.de
Fri Jun 29 23:39:56 CEST 2012


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


More information about the PSTricks mailing list