From 2154eaa8df555b17f72558d748c04bfe1c9c144b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 23 Dec 2007 01:05:36 +0000
Subject: pst-3dplot 1.78 (23dec07)

git-svn-id: svn://tug.org/texlive/trunk@5827 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/generic/pst-3dplot/pst-3dplot.tex          | 90 +++++++++++++++-------
 1 file changed, 64 insertions(+), 26 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex')

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 e28d3c0564f..8669b0e7433 100644
--- a/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
+++ b/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
@@ -6,6 +6,7 @@
 %% Package `pst-3dplot.tex'
 %%
 %% Herbert Voss <voss _at_ perce.de>
+%% with contributions of Darrell Lamm <darrell.lamm _at_ gtri.gatech.edu<
 %%
 %% This program can be redistributed and/or modified under the terms
 %% of the LaTeX Project Public License Distributed from CTAN archives
@@ -25,9 +26,9 @@
 \ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi
 \ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
 %
-\def\fileversion{1.77}
-\def\filedate{2007/10/03}
-\message{`PST-3dplot' v\fileversion, \filedate\space (HV)}
+\def\fileversion{1.78}
+\def\filedate{2007/12/22}
+\message{`PST-3dplot' v\fileversion, \filedate\space (HV,DL)}
 %
 \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
 \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
@@ -60,6 +61,7 @@
 %
 % ---------------- the if's -----------------
 %
+\define@boolkey[psset]{pst-3dplot}[Pst@]{Debug}[true]{}% 
 \define@boolkey[psset]{pst-3dplot}[Pst@]{drawing}[true]{}% draw the coordinates?
 \define@boolkey[psset]{pst-3dplot}[Pst@]{drawCoor}[true]{}% draw the coordinates of a dot?
 \define@boolkey[psset]{pst-3dplot}[Pst@]{hiddenLine}[true]{}% emulate hidden line surface?
@@ -68,21 +70,24 @@
 \define@boolkey[psset]{pst-3dplot}[Pst@]{CylindricalCoor}[true]{}% (r,phi,z)
 %    \Pst@SphericalCoorfalse}% 
 \define@boolkey[psset]{pst-3dplot}[Pst@]{leftHanded}[true]{}% left-Handed coor
+\define@boolkey[psset]{pst-3dplot}[Pst@]{eulerRotation}[true]{}% Use Euler rotation definition
 \define@key[psset]{pst-3dplot}{coorType}{%
     \pst@getint{#1}\psk@ThreeDplot@coorType
     \ifcase\psk@ThreeDplot@coorType
         % 0 is the default
       \or
 %        \def\psk@ThreeDplot@Beta{0}
-      \or
+      \or  %2 
         \def\psk@ThreeDplot@Alpha{135}
 %        \def\psk@ThreeDplot@Beta{0}
+      \or %3
+        \def\psk@ThreeDplot@Alpha{45}
     \fi}
 % 0 default
 % 1 z y are orthogonal and angle x|y is Alpha, Beta has no meaning 
 % 1 z y are orthogonal and angle Alpha is always 135, x-axis shortened by 1/sqrt(2), Beta has no meaning 
 \psset[pst-3dplot]{drawing,drawCoor,hiddenLine=false,SphericalCoor=false,
-    leftHanded=false,coorType=0}
+    leftHanded=false,eulerRotation=false,coorType=0}
 %
 % ------- the global definitions for the pspicture frame ------
 %
@@ -95,6 +100,9 @@
 \define@key[psset]{pst-3dplot}{xThreeDunit}{\pst@checknum{#1}\psk@ThreeDplot@xThreeDunit }
 \define@key[psset]{pst-3dplot}{yThreeDunit}{\pst@checknum{#1}\psk@ThreeDplot@yThreeDunit }
 \define@key[psset]{pst-3dplot}{zThreeDunit}{\pst@checknum{#1}\psk@ThreeDplot@zThreeDunit }
+\define@key[psset]{pst-3dplot}{xRotVec}{\pst@checknum{#1}\psk@ThreeDplot@xRotVec } % Rotation vector x
+\define@key[psset]{pst-3dplot}{yRotVec}{\pst@checknum{#1}\psk@ThreeDplot@yRotVec } % Rotation vector y
+\define@key[psset]{pst-3dplot}{zRotVec}{\pst@checknum{#1}\psk@ThreeDplot@zRotVec } % Rotation vector z
 \define@key[psset]{pst-3dplot}{deltax}{\pst@checknum{#1}\psk@ThreeDplot@deltax }
 \define@key[psset]{pst-3dplot}{deltay}{\pst@checknum{#1}\psk@ThreeDplot@deltay }
 \define@key[psset]{pst-3dplot}{deltaz}{\pst@checknum{#1}\psk@ThreeDplot@deltaz }
@@ -108,8 +116,11 @@
 \define@key[psset]{pst-3dplot}{Beta}{\pst@getangle{#1}\psk@ThreeDplot@Beta }%	Vertical turn
 \define@key[psset]{pst-3dplot}{RotX}{\pst@getangle{#1}\psk@ThreeD@RotX }% x rotation 
 \define@key[psset]{pst-3dplot}{RotY}{\pst@getangle{#1}\psk@ThreeD@RotY }% y rotation
-\define@key[psset]{pst-3dplot}{RotZ}{\pst@getangle{#1}\psk@ThreeD@RotZ }% z 
+\define@key[psset]{pst-3dplot}{RotZ}{\pst@getangle{#1}\psk@ThreeD@RotZ }% z rotation
+\define@key[psset]{pst-3dplot}{RotAngle}{\pst@getangle{#1}\psk@ThreeD@RotAngle }% General rotation angle
 \define@key[psset]{pst-3dplot}{RotSequence}{\def\psk@ThreeD@RotS{#1 }}%
+% Set or Concat
+\define@key[psset]{pst-3dplot}{RotSet}{\def\psk@ThreeD@RotSet{#1 }}%
 \define@key[psset]{pst-3dplot}{PlaneSequence}{\def\psk@ThreeD@PlaneSequence{#1 }}%
 \define@key[psset]{pst-3dplot}{zCoor}{\pst@checknum{#1}\psk@ThreeDplot@zCoor } 
 \psset[pst-3dplot]{zCoor=0}
@@ -235,10 +246,14 @@
 %
 \def\setIIIDplotDefaults{%
   \psset[pst-3dplot]{
-  drawing=true,hiddenLine=false,xMin=-1,xMax=4,yMin=-1,yMax=4,zMin=-1,zMax=4,
+  Debug=false,
+  drawing=true,hiddenLine=false,eulerRotation=false,
+  xMin=-1,xMax=4,yMin=-1,yMax=4,zMin=-1,zMax=4,
   xThreeDunit=1.0,yThreeDunit=1.0,zThreeDunit=1.0,Alpha=45,Beta=30,
   deltax=1,deltay=1,deltaz=1,Deltax=1,Deltay=1,Deltaz=1,
-  RotX=0,RotY=0,RotZ=0,RotSequence=xyz,PlaneSequence={},
+  RotX=0,RotY=0,RotZ=0,RotSequence=xyz,RotSet=set,
+  xRotVec=1,yRotVec=0,zRotVec=0,RotAngle=0,
+  PlaneSequence={},
   drawStyle=xLines,xPlotpoints=25,yPlotpoints=25,beginAngle=0,endAngle=360,
   linejoin=1,XO=0,YO=0,angleStep=1,posStart=0,length=2,arrowOffset=0,
   visibleLineStyle=solid,invisibleLineStyle=dashed,nameX=$x$,spotX=180,
@@ -259,10 +274,15 @@
   /RotX \psk@ThreeD@RotX\space def
   /RotY \psk@ThreeD@RotY\space def
   /RotZ \psk@ThreeD@RotZ\space def
+  /RotAngle \psk@ThreeD@RotAngle\space def
+  /xRotVec \psk@ThreeDplot@xRotVec\space def
+  /yRotVec \psk@ThreeDplot@yRotVec\space def
+  /zRotVec \psk@ThreeDplot@zRotVec\space def
   /dxUnit \psk@ThreeDplot@xThreeDunit\space def
   /dyUnit \psk@ThreeDplot@yThreeDunit\space def
   /dzUnit \psk@ThreeDplot@zThreeDunit\space def
   /RotSequence (\psk@ThreeD@RotS) def
+  /RotSet (\psk@ThreeD@RotSet) def
   /Alpha \psk@ThreeDplot@Alpha\space def
   /Beta \psk@ThreeDplot@Beta\space def
   /Sin1 Beta sin def
@@ -273,15 +293,18 @@
   /Sin1Sin2 Sin1 Sin2 mul def
   /Cos1Cos2 Cos1 Cos2 mul def
   /Sin1Cos2 Sin1 Cos2 mul def
-  /M11 RotZ cos RotY cos mul def
-  /M12 RotZ cos RotY sin mul RotX sin mul RotZ sin RotX cos mul sub def
-  /M13 RotZ cos RotY sin mul RotX cos mul RotZ sin RotX sin mul add def
-  /M21 RotZ sin RotY cos mul def
-  /M22 RotZ sin RotY sin RotX sin mul mul RotZ cos RotX cos mul add def
-  /M23 RotZ sin RotY sin mul RotX cos mul RotZ cos RotX sin mul sub def
-  /M31 RotY sin neg def
-  /M32 RotX sin RotY cos mul def
-  /M33 RotX cos RotY cos mul def
+  currentdict tx@3DPlotDict ne dup 
+  {tx@3DPlotDict begin} if % Begin the correct dict if necessary
+   /eulerRotation \ifPst@eulerRotation true \else false \fi def
+   RotSet (set ) eq currentdict /MnewTOold known not or
+   {/PROCMXYZ /SetMxyz def /PROCMQUATERNION /SetMQuaternion def}
+   {RotSet (concat ) eq 
+    {/PROCMXYZ /ConcatMxyz def /PROCMQUATERNION /ConcatMQuaternion def}
+    {/PROCMXYZ ()          def /PROCMQUATERNION ()                 def} ifelse 
+   } ifelse
+    RotSequence (quaternion ) ne {PROCMXYZ} {PROCMQUATERNION} ifelse cvx exec
+   /RotSet (keep ) def
+ {end} if % End the correct dict if necessary
   /leftHanded \ifPst@leftHanded true \else false \fi def
   /coorType \psk@ThreeDplot@coorType\space def
   \psk@ThreeDplot@xyzLight\space 
@@ -331,6 +354,7 @@
   \addbefore@par{linewidth=0.5pt,linecolor=red,arrows=->,dotstyle=|}%
   \use@par%
   \pstThreeDNode(\psk@ThreeDplot@xMin,0,0){xMin}%
+  \psset[pst-3dplot]{RotSet=keep}% Keep the current rotation matrix
   \pstThreeDNode(\psk@ThreeDplot@xMax,0,0){xMax}%
   \pstThreeDNode(0,\psk@ThreeDplot@yMin,0){yMin}%
   \pstThreeDNode(0,\psk@ThreeDplot@yMax,0){yMax}%
@@ -510,6 +534,7 @@
   \addto@pscode{%
     \pst@3ddict
       \variablesIIID
+      \psk@ThreeDplot@linejoin setlinejoin
       /dxUnit \psk@ThreeDplot@xThreeDunit\space def
       /dyUnit \psk@ThreeDplot@yThreeDunit\space def
       /dzUnit \psk@ThreeDplot@zThreeDunit\space def 
@@ -540,6 +565,7 @@
     \addto@pscode{
        \pst@3ddict
        \variablesIIID
+       \psk@ThreeDplot@linejoin setlinejoin
        \pst@tempThreeDDot
        \ifPst@SphericalCoor  
          ConvertToCartesian  
@@ -684,6 +710,7 @@
     \addto@pscode{%
       \pst@3ddict
         \variablesIIID
+        \psk@ThreeDplot@linejoin setlinejoin
         /P1 { \pst@tempAA } def % x y z or Radius longitude lattitude
         /P2 { \pst@tempBB } def %
         /P3 { \pst@tempCC } def %
@@ -747,6 +774,7 @@
     \addto@pscode{%
       \pst@3ddict
         \variablesIIID
+        \psk@ThreeDplot@linejoin setlinejoin
         /P1 { \pst@tempAA } def % x y z or Radius longitude lattitude
         /P2 { \pst@tempBB } def %
         /P3 { \pst@tempCC } def %
@@ -843,6 +871,7 @@
   \getThreeDCoor{#3}\pst@tempB%  b
   \addto@pscode{%
     \pst@3ddict \variablesIIID end
+    \psk@ThreeDplot@linejoin setlinejoin
     \ifPst@SphericalCoor 
       \pst@tempC\space \tx@ConvertToCartesian 
         /zM \tx@Z def /yM \tx@Y def /xM \tx@X def % center
@@ -918,6 +947,7 @@
   \addto@pscode{
     \pst@3ddict
     \variablesIIID
+    \psk@ThreeDplot@linejoin setlinejoin
     /xUnit { \pst@number\psxunit\space mul } def
     /yUnit { \pst@number\psyunit\space mul } def
     /SphericalCoor \ifPst@SphericalCoor true \else false \fi def %
@@ -979,7 +1009,7 @@
       3 1 roll 
       \psk@ThreeDplot@Alpha\space cos add 3 1 roll 
       \psk@ThreeDplot@Alpha\space sin add 3 1 roll 
-    \or
+    \else
       3 1 roll 45 cos add 3 1 roll 45 sin add 3 1 roll 
     \fi
   } def
@@ -1029,6 +1059,7 @@
 \begin@SpecialObj%
 \use@par
 \addto@pscode{%
+  \psk@ThreeDplot@linejoin setlinejoin
   /viewpoint {% to make it compatible with parallel projection
     \psk@viewpoint
     \ifcase\psk@ThreeDplot@coorType
@@ -1039,7 +1070,7 @@
       3 1 roll 
       \psk@ThreeDplot@Alpha\space cos add 3 1 roll 
       \psk@ThreeDplot@Alpha\space sin add 3 1 roll 
-    \or
+    \else
       3 1 roll 45 cos add 3 1 roll 45 sin add 3 1 roll 
     \fi
   } def
@@ -1065,6 +1096,7 @@
   \begin@ClosedObj
   \addto@pscode{%
     \pst@3ddict \variablesIIID end
+    \psk@ThreeDplot@linejoin setlinejoin
     /POrig {
       #1 #2 #3 \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
       \pst@number\psunit mul 3 1 roll 
@@ -1082,6 +1114,7 @@
   \begin@SpecialObj
   \addto@pscode{%
     \pst@3ddict \variablesIIID end
+    \psk@ThreeDplot@linejoin setlinejoin
     /POrig {
       #1 #2 #3 \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
       \pst@number\psunit mul 3 1 roll 
@@ -1102,6 +1135,7 @@
   \begin@ClosedObj
   \addto@pscode{%
     \pst@3ddict \variablesIIID end
+    \psk@ThreeDplot@linejoin setlinejoin
     /POrig {
       #1 #2 #3 #5 add \ifPst@CylindricalCoor \tx@ConvCylToCartesian \fi
       \pst@number\psunit mul 3 1 roll 
@@ -1138,7 +1172,7 @@
       3 1 roll 
       \psk@ThreeDplot@Alpha\space cos add 3 1 roll 
       \psk@ThreeDplot@Alpha\space sin add 3 1 roll 
-    \or
+    \else
       3 1 roll 45 cos add 3 1 roll 45 sin add 3 1 roll 
     \fi
   } def
@@ -1200,7 +1234,7 @@
       3 1 roll 
       \psk@ThreeDplot@Alpha\space cos add 3 1 roll 
       \psk@ThreeDplot@Alpha\space sin add 3 1 roll 
-    \or
+    \else
       3 1 roll 45 cos add 3 1 roll 45 sin add 3 1 roll 
     \fi
   } def
@@ -1458,11 +1492,14 @@
 }
 \def\parametricPlotThreeD@ii(#1,#2)(#3,#4)#5{{%
   \pst@killglue%
+  \pst@dima=#3pt\pst@dimb=#4pt	% #3=#4, then we have a 3d line
+  \ifdim\pst@dima=\pst@dimb\psset{yPlotpoints=1}\fi% and set yPlotpoints=1
   \use@par%
   \@pstfalse%
   \@nameuse{beginplot@\psplotstyle}%
   \@nameuse{testqp@\psplotstyle}% quick plot or something special
   \if@pst%
+    \ifPst@Debug\typeout{===>Quick plot}\fi
     \def\pslinetype{0}%
     \addto@pscode{%
       \variablesIIID
@@ -1483,10 +1520,9 @@
    }%
    \parametricPlotThreeD@iii%
   \else%
-    \def\pslinetype{-3}%
+    \ifPst@Debug\typeout{===>Special plot}\fi
+    \def\pslinetype{0}%
     \endgroup%
-    \pst@dima=#3pt\pst@dimb=#4pt
-    \ifdim\pst@dima=\pst@dimb\psset{yPlotpoints=1}\fi% #3=#4 ??
     \multido{\n@Y=0+1}{\psk@ThreeDplot@yPlotpoints}{%
       \@nameuse{beginplot@\psplotstyle}%
       \addto@pscode{%
@@ -1513,13 +1549,15 @@
 %
 \def\parametricPlotThreeD@iii{%   without arrows (quickplot)
   \addto@pscode{%
-    \psk@ThreeDplot@yPlotpoints\space {
+    \psk@ThreeDplot@yPlotpoints {
       /t tMin def
       xyz \@nameuse{beginqp@\psplotstyle}
-      \psk@ThreeDplot@xPlotpoints {
+      /t t dt add def
+      \psk@ThreeDplot@xPlotpoints\space 1 sub {
         xyz \@nameuse{doqp@\psplotstyle}
         /t t dt add def
       } repeat
+      /t t dt sub def
       /u u du add def
     } repeat
   }%
-- 
cgit v1.2.3

