summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-3dplot
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-07-29 17:07:14 +0000
committerKarl Berry <karl@freefriends.org>2012-07-29 17:07:14 +0000
commite59b34a0dd79d94767052954cd3e961307edbdbe (patch)
tree721c1ef922586c7a0757371bc322dd0c7c7f10c1 /Master/texmf-dist/tex/generic/pst-3dplot
parent1fb658cc9435346a6f399e846f07f05c08260fc7 (diff)
pst-3dplot (7jun12)
git-svn-id: svn://tug.org/texlive/trunk@27233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-3dplot')
-rw-r--r--Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex89
1 files changed, 73 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex b/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
index 1eed785cf63..4f37d13deb8 100644
--- a/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
+++ b/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
@@ -1,4 +1,4 @@
-%% $Id: pst-3dplot.tex 298 2010-03-13 08:46:53Z herbert $
+%% $Id: pst-3dplot.tex 694 2012-06-07 12:07:50Z herbert $
%%
%% This is file `pst-3dplot.tex',
%%
@@ -27,8 +27,8 @@
\ifx\PSTMultidoLoaded\endinput\else \input multido.tex\fi
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
%
-\def\fileversion{1.94}
-\def\filedate{2011/03/01}
+\def\fileversion{1.97}
+\def\filedate{2012/06/07}
\message{`PST-3dplot' v\fileversion, \filedate\space (HV,DL)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -114,11 +114,11 @@
\def\drawStyle@xyLines{xyLines}% 2
\def\drawStyle@yxLines{yxLines}% 3
\define@key[psset]{pst-3dplot}{drawStyle}[xLines]{% how to draw 3D functions
- \def\pst@tempa{#1}%
- \ifx\pst@tempa\drawStyle@xLines\let\psk@ThreeDplot@drawStyle\z@\else%
- \ifx\pst@tempa\drawStyle@yLines\let\psk@ThreeDplot@drawStyle\@ne\else%
- \ifx\pst@tempa\drawStyle@xyLines\let\psk@ThreeDplot@drawStyle\tw@\else%
- \ifx\pst@tempa\drawStyle@yxLines\let\psk@ThreeDplot@drawStyle\thr@@\else%
+ \def\pst@tempA{#1}%
+ \ifx\pst@tempA\drawStyle@xLines\let\psk@ThreeDplot@drawStyle\z@\else%
+ \ifx\pst@tempA\drawStyle@yLines\let\psk@ThreeDplot@drawStyle\@ne\else%
+ \ifx\pst@tempA\drawStyle@xyLines\let\psk@ThreeDplot@drawStyle\tw@\else%
+ \ifx\pst@tempA\drawStyle@yxLines\let\psk@ThreeDplot@drawStyle\thr@@\else%
\@pstrickserr{Bad draw style: `\pst@tempa'}\@ehpa%
\fi\fi\fi\fi%
% \typeout{drawStyle: \the\psk@ThreeDplot@drawStyle}
@@ -943,6 +943,58 @@
\endgroup%
\ignorespaces%
}
+
+\define@key[psset]{pst-3dplot}{height}[5]{\def\psk@height{#1 }}
+\define@key[psset]{pst-3dplot}{move}[0 0]{\def\psk@move{#1 }}
+\psset{height=5,move=0 0}
+\def\pstThreeDPrism{\NormalIIIDCoor\def\pst@par{}\pst@object{prismIIID}}
+\def\prismIIID@i{%
+ \pst@killglue%
+ \pst@getarrows{%
+ \begin@OpenObj%
+ \pst@getcoors[\prismIIID@ii}}
+\def\prismIIID@ii{%
+ \addto@pscode{%
+ \pst@3ddict
+ \IIIDplot@variables
+ /dxUnit \psk@ThreeDplot@xThreeDunit\space def
+ /dyUnit \psk@ThreeDplot@yThreeDunit\space def
+ /dzUnit \psk@ThreeDplot@zThreeDunit\space def
+ \ifPst@SphericalCoor /SphericalCoor true def
+ \else /SphericalCoor false def
+ \fi %
+ /xUnit { \pst@number\psxunit\space mul } def
+ /yUnit { \pst@number\psyunit\space mul } def
+ counttomark array astore /3dValues ED
+ 3dValues aload pop
+ convertStackTo2D
+ end
+ \pst@cp\space \psline@iii\space \tx@Line
+ \pst@3ddict
+ \psk@move /y0 ED /x0 ED
+ [ 3dValues aload length dup /n ED 3 div cvi
+ { \psk@height add 3 1 roll y0 add 3 1 roll x0 add 3 1 roll
+ n -3 roll } repeat
+ n array astore /3dValuesMove ED
+ 3dValuesMove aload pop
+ convertStackTo2D
+ end
+ \pst@cp\space \psline@iii\space \tx@Line
+ \pst@3ddict
+ 0 3 n {
+ /Index ED
+ 3dValues Index 3 getinterval aload pop
+ SphericalCoor { ConvertToCartesian } { saveCoor } ifelse
+ ConvertTo2D x2D xUnit y2D yUnit moveto
+ 3dValuesMove Index 3 getinterval aload pop
+ SphericalCoor { ConvertToCartesian } { saveCoor } ifelse
+ ConvertTo2D x2D xUnit y2D yUnit lineto
+ } for
+ end
+ }%
+ \end@OpenObj%
+ \ignorespaces%
+ \SpecialCoor}
%
% set a 3d ellipse/circle
%
@@ -1234,11 +1286,13 @@
\psk@ThreeDplot@Alpha\space cos add \psk@ThreeDplot@Beta\space cos mul 3 1 roll
\psk@ThreeDplot@Alpha\space sin add \psk@ThreeDplot@Beta\space cos mul 3 1 roll
\or
- 3 1 roll
+ \psk@ThreeDplot@Beta\space sin add 3 1 roll
\psk@ThreeDplot@Alpha\space cos add 3 1 roll
\psk@ThreeDplot@Alpha\space sin add 3 1 roll
\else
- 3 1 roll 45 cos add 3 1 roll 45 sin add 3 1 roll
+ \psk@ThreeDplot@Beta\space sin add 3 1 roll
+ 45 cos add 3 1 roll
+ 45 sin add 3 1 roll
\fi
} def
0 viewpoint 0 \tx@SetMatrixThreeD
@@ -1266,7 +1320,8 @@
\IIIDplot@variables
#1 #2 #3 \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
saveCoor
- ConvertTo2DWithoutRotating
+ ConvertTo2D
+% ConvertTo2DWithoutRotating
x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul
translate % the lower center
#4 \pst@number\psunit mul dup 0 360 false
@@ -1276,13 +1331,14 @@
}% end of pscode
\end@ClosedObj
\let\pst@par\pst@parOrig
- \begin@SpecialObj
+ \begin@SpecialObj % bottom
\addto@pscode{%
tx@3DPlotDict begin
\IIIDplot@variables
#1 #2 #3 \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
saveCoor
- ConvertTo2DWithoutRotating
+ ConvertTo2D
+% ConvertTo2DWithoutRotating
x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul
translate
#4 \pst@number\psunit mul % radius
@@ -1295,13 +1351,14 @@
}% end of pscode
\end@SpecialObj
\let\pst@par\pst@parOrig
- \begin@ClosedObj
+ \begin@ClosedObj % top
\addto@pscode{%
tx@3DPlotDict begin
\IIIDplot@variables
#1 #2 #3 #5 add \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
- saveCoor
- ConvertTo2DWithoutRotating
+ saveCoor
+ ConvertTo2D
+% ConvertTo2DWithoutRotating
x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul
translate
#4 \pst@number\psunit mul dup 0 360 false