diff options
author | Karl Berry <karl@freefriends.org> | 2007-04-02 18:59:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-04-02 18:59:04 +0000 |
commit | c2f8ac41e588904a397b2648a31712eae01c942f (patch) | |
tree | 63c637e4ea55c14ab03227c0c3f650e737fb5a54 /Master/texmf-dist/tex | |
parent | 182e0db3c4b16562035d72d4859125662fa81014 (diff) |
pst-vue3d (26mar07)
git-svn-id: svn://tug.org/texlive/trunk@4098 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-vue3d/pst-vue3d.tex | 200 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-vue3d/pst-vue3d.sty | 7 |
2 files changed, 191 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-vue3d/pst-vue3d.tex b/Master/texmf-dist/tex/generic/pst-vue3d/pst-vue3d.tex index 07ae96eb41e..1b23e7b75c8 100644 --- a/Master/texmf-dist/tex/generic/pst-vue3d/pst-vue3d.tex +++ b/Master/texmf-dist/tex/generic/pst-vue3d/pst-vue3d.tex @@ -1,4 +1,3 @@ - %% This is file `pst-vue3d.tex', %% %% IMPORTANT NOTICE: @@ -23,14 +22,14 @@ % Require PSTricks and pst-node packages \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi -\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi +\ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi +\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey\fi % -\def\fileversion{1.21}% -\def\filedate{2005/02/21}% -\message{`PST-VUE3D v\fileversion, \filedate\space (ML)(hv)}% -\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax +\def\fileversion{1.23}% +\def\filedate{2007/03/26}% +\message{`pst-vue3d v\fileversion, \filedate\space (ML)(hv)}% +\edef\PstAtCode{\the\catcode`\@}\catcode`\@=11\relax \pst@addfams{pst-vue3d}% for pst-xkey - %%%% \define@key[psset]{pst-vue3d}{scale}{\def\psk@TroisD@scale{#1}} % echelle \define@key[psset]{pst-vue3d}{RotX}{\def\psk@TroisD@RotX{#1}} % rotation autour de Ox en degrés @@ -107,6 +106,10 @@ % \def\variablesTroisD{% 0 0 translate +% hv 2005-04-30 --->beg + /xUnit \pst@number\psxunit def + /yUnit \pst@number\psyunit def +% hv 2005-04-30 <---end /reduction \psk@TroisD@scale\space def /RotX \psk@TroisD@RotX\space def /RotY \psk@TroisD@RotY\space def @@ -161,7 +164,7 @@ % hv 2003-12-20 % -------------- Utilities ----------------- \SpecialCoor -\pstheader{3D.pro} +\pstheader{pst-vue3d.pro} \def\face{% \pscurve(1;160)(0.8;180)(1;200) @@ -298,10 +301,10 @@ } % % -\def\CubeThreeD{\pst@object{CubeThreeD}} +\def\CubeThreeD{\def\pst@par{}\pst@object{CubeThreeD}} \def\CubeThreeD@i(#1,#2,#3){{ \begin@ClosedObj - \use@par +% \use@par \addto@pscode{% \variablesTroisD \ifPst@SphericalCoor @@ -324,7 +327,7 @@ /CubeColorFaceFour {\psk@TroisD@CubeColorFaceFour} def /CubeColorFaceSix {\psk@TroisD@CubeColorFaceSix} def tx@3DDict begin - /Condition1 {PS1 0 le } def + /Condition1 { PS1 0 le } def Cube end }% fin du code ps @@ -666,6 +669,34 @@ end){\@NodeNameThreeD}% } % + +\iffalse +% hv 2005-12-04 +\def\pnodeThreeD{\pst@object{pnodeThreeD}} +\def\pnodeThreeD@i(#1,#2,#3)#4{% + \pst@killglue + \begingroup + \use@par + \pnode(! + \psk@embedangle + \psk@viewpoint + \psk@viewangle + \tx@SetMatrixThreeD + \ifPst@SphericalCoor + /Radius #1 def + /longitude #2 def + /latitude #3 def + Radius longitude cos mul latitude cos mul % x + Radius longitude sin mul latitude cos mul % y + Radius latitude sin mul % z + \else + #1 #2 #3 + \fi + \tx@ProjThreeD){#4}% + \endgroup} +% +\let\pNodeThreeD\pnodeThreeD +\fi % \def\TetraedreThreeD{\pst@object{TetraedreThreeD}} \def\TetraedreThreeD@i(#1,#2,#3){{% @@ -1016,7 +1047,7 @@ % % \def\ConeThreeD{\pst@object{ConeThreeD}} -\def\ConeThreeD@i(#1,#2,#3)#4#5{{% +\def\ConeThreeD@i(#1,#2,#3)#4#5{% % Le centre de la base sera placé avec % (#2,#3,#4) les paramètres CX,CY et CZ % #5 rayon @@ -1047,7 +1078,7 @@ }% fin du code ps \showpointsfalse \end@ClosedObj -}\ignorespaces}% +\ignorespaces}% % \def\CircleThreeD{\pst@object{CircleThreeD}} \def\CircleThreeD@i(#1,#2,#3)#4{{% @@ -1245,6 +1276,147 @@ \end@OpenObj }\ignorespaces}% % fin de la commande PSTricks % +\newif\ifPstThreeDplot@showInside +\define@key[psset]{pst-vue3d}{showInside}[true]{\@nameuse{PstThreeDplot@showInside@#1}} +\define@key[psset]{pst-vue3d}{SegmentColor}{\pst@getcolor{#1}\psk@ThreeDplot@SegmentColor} +\define@key[psset]{pst-vue3d}{increment}{\pst@getint{#1}\psk@ThreeDplot@increment} +\psset[pst-vue3d]{showInside,SegmentColor={[cmyk]{0.2,0.6,1,0}},increment=10} +% +\def\ParaboloidThreeD{\pst@object{ParaboloidThreeD}} +\def\ParaboloidThreeD@i#1#2{% +\begin@SpecialObj% +\addto@pscode{% + \psk@embedangle + \psk@viewpoint + \psk@viewangle + \tx@SetMatrixThreeD +% Vecteur ViewPoint + \psk@viewpoint + /vZ ED + /vY ED + /vX ED + /increment \psk@ThreeDplot@increment\space def + /height #1 def + /radius #2 #1 sqrt div def + /cmyk {} def + 1 setlinejoin + % les rayons de lumière + /xLight 1 def + /yLight 0.1 def + /zLight 0.2 def + % précision du tracé + /pas 0.5 def + /pas10 {pas 10 div} bind def +% + /NormeLight {xLight dup mul yLight dup mul zLight dup mul add add sqrt} bind def +% l'ellipse du plan de coupe : le contour + /calculate2DPoint { % four values on stack; x2D y2D are returned + /V0 ED /Z0 ED /U20 ED /U10 ED + U10 cos V0 mul radius mul \pst@number\psunit mul + U20 sin V0 mul radius mul \pst@number\psunit mul + Z0 \pst@number\psunit mul \tx@ProjThreeD + } def + /PlanCoupe { + /Z height store + /V {Z sqrt} bind def + /TableauxPoints [ + 0 1 359 { + /U exch def [ U U Z V caclculate2DPoint ] % on décrit le cercle + } for + ] def + newpath + TableauxPoints 0 get aload pop moveto + 0 1 359 { + /compteur exch def + TableauxPoints compteur get aload pop + lineto } for + closepath + } def +% + /facette { + newpath + U U Z V calculate2DPoint moveto + U 1 U increment add {% + /U1 exch def + U1 U1 Z V calculate2DPoint lineto + } for + Z pas10 Z pas add pas10 add{ + /Z1 exch def + /V {Z1 sqrt} bind def + U1 U1 Z1 V calculate2DPoint lineto + } for + U increment add -1 U {% + /U2 exch def + U2 U2 Z pas add V calculate2DPoint lineto + } for + Z pas add pas10 sub pas10 neg Z pas10 sub{ + /Z2 exch def + /V {Z2 abs sqrt} bind def + U U Z2 V calculate2DPoint lineto + } for + closepath + } def % facette +% + /MaillageParaboloid { + 0 pas height pas sub{% + /Z ED + /V {Z sqrt} bind def + 0 increment 360 increment sub {% + /U exch def +% Centre de la facette + /Ucentre {U increment 2 div add} bind def + /Vcentre {Z pas 2 div add sqrt} bind def +% normale à la facette + /nXfacette {2 Vcentre dup mul mul Ucentre cos mul radius mul} bind def + /nYfacette {2 Vcentre dup mul mul Ucentre sin mul radius mul} bind def + /nZfacette {Vcentre neg radius dup mul mul} bind def + /NormeN { + nXfacette dup mul + nYfacette dup mul + nZfacette dup mul + add add sqrt} bind def + NormeN 0 eq {/NormeN 1e-10 def} if +% test de visibilité + /PSfacette vX nXfacette mul + vY nYfacette mul add + vZ nZfacette mul add def + condition { + facette + /cosV {1 xLight nXfacette mul + yLight nYfacette mul + zLight nZfacette mul + add add + NormeLight + NormeN mul div sub} bind def + \psk@ThreeDplot@SegmentColor\space + cosV mul 4 1 roll cosV mul 4 1 roll cosV dup mul mul 4 1 roll cosV dup mul mul 4 1 roll + setcmykcolor fill + 0 setgray + facette + stroke + } if + } for + } for + } def + /conditionGE {PSfacette 0 ge} def + /conditionLE {PSfacette 0 le} def + \ifPstThreeDplot@showInside + /condition {conditionGE} def + MaillageParaboloid + vZ 0 ge {% + PlanCoupe 1 0.5 0.5 setrgbcolor fill + PlanCoupe 0 setgray stroke} if + \else + /condition {conditionLE} def + MaillageParaboloid + /condition {conditionGE} def + MaillageParaboloid% + \fi +} +% fin du code ps +\showpointsfalse +\end@SpecialObj} +% % % 11 novembre \def\DemiSphereThreeD{\pst@object{DemiSphereThreeD}} @@ -1463,6 +1635,8 @@ \end@ClosedObj% }\ignorespaces}% % fin de la commande PSTricks % +\catcode`\@=\PstAtCode\relax +% %% END: pst-vue3D.tex \endinput diff --git a/Master/texmf-dist/tex/latex/pst-vue3d/pst-vue3d.sty b/Master/texmf-dist/tex/latex/pst-vue3d/pst-vue3d.sty index 30875625bb8..3895513e2af 100644 --- a/Master/texmf-dist/tex/latex/pst-vue3d/pst-vue3d.sty +++ b/Master/texmf-dist/tex/latex/pst-vue3d/pst-vue3d.sty @@ -1,7 +1,8 @@ \RequirePackage{pstricks} -\ProvidesPackage{pst-vue3d}[2000/07/15 package wrapper for - pst-vue3d.tex (ML)] +\ProvidesPackage{pst-vue3d}[2007/03/26 package wrapper for + pst-vue3d.tex (hv)] \input{pst-vue3d.tex} +\IfFileExists{pst-vue3d.pro}{\@addtofilelist{pst-vue3d.pro}}{}% \ProvidesFile{pst-vue3d.tex} - [\filedate\space v\fileversion\space `PST-VUE3D' (ML)] + [\filedate\space v\fileversion\space `pst-vue3d' (ML,hv)] \endinput |