From 2927003e80f56661b8f50c41aa5d7bc9e856c715 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 24 Mar 2014 20:40:33 +0000 Subject: pst-solides3d (24mar14) git-svn-id: svn://tug.org/texlive/trunk@33273 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/pst-solides3d/pst-solides3d.tex | 148 ++++++++++++++++++++- 1 file changed, 143 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/generic/pst-solides3d/pst-solides3d.tex b/Master/texmf-dist/tex/generic/pst-solides3d/pst-solides3d.tex index 9a8341709e3..0401260af19 100644 --- a/Master/texmf-dist/tex/generic/pst-solides3d/pst-solides3d.tex +++ b/Master/texmf-dist/tex/generic/pst-solides3d/pst-solides3d.tex @@ -1,5 +1,5 @@ %% -%% COPYRIGHT 2008-2010 by Manuel Luque, Arnaud Schmittbuhl, +%% COPYRIGHT 2008-2014 by Manuel Luque, Arnaud Schmittbuhl, %% Jean-Paul Vignault, Herbert Voss. %% %% This work may be distributed and/or modified under the @@ -33,8 +33,8 @@ \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi \ifx\MultidoLoaded\endinput\else \input multido.tex \fi % JPV & ML & AS & HV -\def\fileversion{4.24} -\def\filedate{2011/07/13} +\def\fileversion{4.25} +\def\filedate{2014/03/22} \message{`PSTSOLIDESIIID' v\fileversion, \filedate} % \pstheader{pst-solides3d.pro} @@ -816,10 +816,10 @@ XpointVue YpointVue ZpointVue /viewpoint defpoint3d %% creation des variables pour PSTricks \define@boolkey[psset]{pst-solides3d}[Pst@]{visibility}[false]{} \psset{visibility=true} -\define@key[psset]{pst-solides3d}{normal}{\def\pst@solides@normal{#1}} +\define@key[psset]{pst-solides3d}{normal}{\def\pst@solides@normal{#1 }} \psset[pst-solides3d]{normal=0 0 1} % origine du plan -\define@key[psset]{pst-solides3d}{origine}{\def\pst@solides@origin{#1}} % origine du plan +\define@key[psset]{pst-solides3d}{origine}{\def\pst@solides@origin{#1 }} % origine du plan \psset[pst-solides3d]{origine=0 0 0 }% %% le range pour les fonctions numeriques \define@key[psset]{pst-solides3d}{range}{\def\pst@solides@range{#1}} @@ -969,6 +969,144 @@ XpointVue YpointVue ZpointVue /viewpoint defpoint3d \SpecialCoor% } % +%% === Chemin pour les dessins --------------------------------------------- +%\define@key[psset]{pst-solides3d}{fichier}{\edef\psk@solides@fichier{#1}} % chemin des dessins +%\psset{fichier=} +%% === Echelle pour l'image ----------------------------------------------- +\define@key[psset]{pst-solides3d}{unitPicture}{\edef\psk@solides@unitPicture{#1 }} +\psset{unitPicture=28.45} +%% === nombre de divisions des segments ----------------------------------------------- +\define@key[psset]{pst-solides3d}{divisions}{\edef\psk@solides@divisions{#1 }} +\psset{divisions=5} +% +\def\psImage{\pst@object{psImage}} +\def\psImage@i{\@ifnextchar({\psImage@ii}{\psImage@ii(0,0)}} +\def\psImage@ii(#1,#2){{% + \ifPst@solidmemory\use@par\else\begin@ClosedObj\fi% +\addto@pscode{ +%% === adapté de Jean-Michel Sarlat dans pst-anamorphosis ---------------------- +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% === Capture de commandes de systemdict -------------------------------------- +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +/LINETO { systemdict /lineto get exec } def +/MOVETO { systemdict /moveto get exec } def +/CURVETO { systemdict /curveto get exec } def +/CLOSEPATH { systemdict /closepath get exec } def +/RLINETO { systemdict /rlineto get exec } def +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% === Transformation des commandes de construction des path(s) ---------------- +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +/tx@projectionDict 20 dict def +tx@projectionDict begin +/moveto { + /s@y ED /s@x ED /c@x s@x def /c@y s@y def + s@x unit_image div + s@y unit_image div + 2 copy + sinPhi mul neg exch cosPhi mul add % x' + 3 1 roll + cosPhi mul exch sinPhi mul add % y' + /Ypoint exch def + /Xpoint exch def + projectionimage + MOVETO +} bind def +/lineto { + /c@yt ED /c@xt ED /dx c@xt c@x sub ND div def /dy c@yt c@y sub ND div def + 1 1 ND {dup dx mul c@x add exch dy mul c@y add +%/Ypoint exch unit_image div def +%/Xpoint exch unit_image div def + unit_image div exch + unit_image div exch + 2 copy + sinPhi mul neg exch cosPhi mul add % x' + 3 1 roll + cosPhi mul exch sinPhi mul add % y' + /Ypoint exch def + /Xpoint exch def + projectionimage + LINETO} for + /c@x c@xt def /c@y c@yt def +} bind def +/closepath { + s@x s@y lineto CLOSEPATH +} bind def +/curveto { + /c@yt ED /c@xt ED + /c@yb ED /c@xb ED + /c@ya ED /c@xa ED + 1 1 NDC { + NDC div /s ED 1 s sub /t ED + t c@x mul 3 s c@xa mul mul add t mul 3 s s c@xb mul mul mul add t mul s 3 exp c@xt mul add + t c@y mul 3 s c@ya mul mul add t mul 3 s s c@yb mul mul mul add t mul s 3 exp c@yt mul add + unit_image div exch + unit_image div exch + 2 copy + sinPhi mul neg exch cosPhi mul add % x' + 3 1 roll + cosPhi mul exch sinPhi mul add % y' + /Ypoint exch def + /Xpoint exch def + projectionimage + LINETO + } for + /c@x c@xt def /c@y c@yt def +} bind def +end +/Atan { /atan load stopped { pop pop 0 } if } def +save +\tx@optionssolides + SolidesDict begin +/cm {\pst@number\psunit mul } bind def +/cm_1 {\pst@number\psunit div } bind def +/unit_image \psk@solides@unitPicture def +/fichier (\pst@solides@file) def +/Normale {\pst@solides@normal\space unitaire3d } bind def +/ND \psk@solides@divisions def +/NDC {\psk@solides@divisions 3 mul} bind def +/origin {\pst@solides@origin\space } def +/cosPhi {phi cos} bind def +/sinPhi {phi sin} bind def +Normale +/nz exch def +/ny exch def +/nx exch def +/Phi {90 nz arccos sub} bind def +/Theta {ny nx Atan} bind def +/sinT {Theta sin} bind def +/cosT {Theta cos} bind def +/sinP {Phi sin} bind def +/cosP {Phi cos} bind def +origin + /zO' exch def + /yO' exch def + /xO' exch def +/projectionimage { +% projection sur le plan +Xpoint sinT mul neg Ypoint sinP cosT mul mul sub xO' add % x' +Xpoint cosT mul Ypoint sinP mul sinT mul sub yO' add % y' +Ypoint cosP mul zO' add % z' +3dto2d % + } def + projectionsifacevisible not origin Normale planvisible? or { + /showpage {} def +gsave +tx@projectionDict begin +#1 sinT mul neg #2 sinP cosT mul mul sub +#1 cosT mul #2 sinP mul sinT mul sub +#2 cosP mul +3dto2d +translate +fichier run +end +grestore + } if +end +restore +}% + \ifPst@solidmemory\else\end@ClosedObj\fi}\ignorespaces% +} +% \def\psResetSolidKeys{% \psset[pst-solides3d]{% action=draw**,% -- cgit v1.2.3