diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-ob3d/pst-ob3d.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-ob3d/pst-ob3d.tex | 320 |
1 files changed, 320 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-ob3d/pst-ob3d.tex b/Master/texmf-dist/tex/generic/pst-ob3d/pst-ob3d.tex new file mode 100644 index 00000000000..3bd16decf80 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pst-ob3d/pst-ob3d.tex @@ -0,0 +1,320 @@ +%% +%% This is file `pst-ob3d.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pst-ob3d.dtx (with options: `pst-ob3d') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from pst-ob3d.tex. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file pst-ob3d.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% +%% Package `pst-ob3d.dtx' +%% +%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> +%% Herbert Voss <hvoss@tug.org> +%% +%% August 22, 2007 +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-ob3d' is a PSTricks package to draw basic three dimensional +%% objects with various customizations. +%% +\def\fileversion{0.21} +\def\filedate{2007/08/22} +\message{`Pst-Objects3d' v\fileversion, \filedate\space (DG,hv)} +\csname PstObjectsThreeDLoaded\endcsname +\let\PstObjectsThreeDLoaded\endinput +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi +\ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi +\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi +\input random.tex +\edef\PstAtCode{\the\catcode`\@} +\catcode`\@=11\relax +\pst@addfams{pst-ob3d} +\define@boolkey[psset]{pst-ob3d}[PstObjectsThreeD@]{OnlyVisibleFaces}[true]{} +\define@boolkey[psset]{pst-ob3d}[PstObjectsThreeD@]{RandomFaces}[true]{} +\define@boolkey[psset]{pst-ob3d}[PstObjectsThreeD@]{Corners}[true]{} +\define@key[psset]{pst-ob3d}{CornersColor}{\def\PstObjectsThreeD@CornersColor{#1}} +\define@key[psset]{pst-ob3d}{CornersLength}{% + \def\PstObjectsThreeD@CornersLength{#1}% + \def\PstObjectsThreeD@CornersLengthTmpA{#1}% + \def\PstObjectsThreeD@CornersLengthTmpB{#1}} +\psset[pst-ob3d]{OnlyVisibleFaces=false,RandomFaces=false, + Corners=false,CornersColor=black,CornersLength=0.15} +\def\PstCube{\@ifnextchar[{\PstCube@i}{\PstCube@i[]}} +\def\PstCube@i[#1]{\@ifnextchar({\PstCube@ii[#1]}{\PstCube@ii[#1](0,0,0)}} +\def\PstCube@ii[#1](#2,#3,#4)#5#6#7{{% +\psset{dimen=middle}% +\psset{#1}% +\ifnum\Pst@Debug=\@ne + \def\PstObjectsThreeDFaceCenterA{A}% + \def\PstObjectsThreeDFaceCenterB{B}% + \def\PstObjectsThreeDFaceCenterC{C}% + \def\PstObjectsThreeDFaceCenterD{D}% + \def\PstObjectsThreeDFaceCenterE{E}% + \def\PstObjectsThreeDFaceCenterF{F}% +\fi +\pst@expandafter\psget@@viewpoint\psk@viewpoint {} {} {} \@nil +\ifPstObjectsThreeD@Corners + \let\PstObjectsThreeD@Shape\PstObjectsThreeD@Octogon +\else + \let\PstObjectsThreeD@Shape\psframe +\fi +\ifdim\pst@dimc>\z@ + \ifdim\pst@dima>\z@ + \ifdim\pst@dimb>\z@ + \PstCube@DrawFaces{A}{E}{C}{B}{D}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \else + \PstCube@DrawFaces{E}{D}{C}{A}{B}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \fi + \else + \ifdim\pst@dimb>\z@ + \PstCube@DrawFaces{A}{B}{C}{E}{D}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \else + \PstCube@DrawFaces{D}{B}{C}{E}{A}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \fi + \fi +\else + \ifdim\pst@dima>\z@ + \ifdim\pst@dimb>\z@ + \PstCube@DrawFaces{B}{D}{C}{A}{E}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \else + \PstCube@DrawFaces{A}{B}{C}{E}{D}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \fi + \else + \ifdim\pst@dimb>\z@ + \PstCube@DrawFaces{D}{E}{C}{A}{B}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \else + \PstCube@DrawFaces{E}{A}{C}{D}{B}{F}{(#2,#3,#4)}{(#5,#6,#7)}% + \fi + \fi +\fi}} +\def\PstDie{\@ifnextchar[{\PstDie@i}{\PstDie@i[]}} +\def\PstDie@i[#1]{\@ifnextchar({\PstDie@ii[#1]}{\PstDie@ii[#1](0,0,0)}} +\def\PstDie@ii[#1](#2,#3,#4){{% +\psset{dimen=middle}% +\psset{#1}% +\ifPstObjectsThreeD@RandomFaces + \setrannum{\pst@cnth}{1}{6}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.5,.5)}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.2,.2)(.8,.8)}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.2,.2)(.5,.5)(.8,.8)}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.2,.2)(.2,.5)(.2,.8)(.8,.2)(.8,.5)(.8,.8)}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.2,.2)(.2,.8)(.5,.5)(.8,.2)(.8,.8)}% + \PstDie@Letter{\pst@cnth}{\@tempa}% + \expandafter\def\csname PstObjectsThreeDFace\@tempa\endcsname{% + \psdots(.2,.2)(.2,.8)(.8,.2)(.8,.8)}% +\else + \def\PstObjectsThreeDFaceA{\psdots(.5,.5)}% + \def\PstObjectsThreeDFaceB{\psdots(.2,.2)(.8,.8)}% + \def\PstObjectsThreeDFaceC{\psdots(.2,.2)(.5,.5)(.8,.8)}% + \def\PstObjectsThreeDFaceD{% + \psdots(.2,.2)(.2,.5)(.2,.8)(.8,.2)(.8,.5)(.8,.8)}% + \def\PstObjectsThreeDFaceE{\psdots(.2,.2)(.2,.8)(.5,.5)(.8,.2)(.8,.8)}% + \def\PstObjectsThreeDFaceF{\psdots(.2,.2)(.2,.8)(.8,.2)(.8,.8)}% +\fi +\ifPstObjectsThreeD@Corners +\else + \PstObjectsThreeD@OnlyVisibleFacestrue +\fi +\PstCube(#2,#3,#4){1}{1}{1}}} +\def\PstCube@DrawFaces#1#2#3#4#5#6#7#8{% +\ifPstObjectsThreeD@OnlyVisibleFaces +\else + \bgroup + \ifPstObjectsThreeD@Corners + \psset{linecolor=\PstObjectsThreeD@CornersColor, + fillcolor=\PstObjectsThreeD@CornersColor}% + \fi + \bgroup + \ifPstObjectsThreeD@Corners + \def\PstObjectsThreeD@CornersLengthTmpA{0}% + \fi + \expandafter\csname PstCube@DrawFace#1\endcsname#7#8 + \expandafter\csname PstCube@DrawFace#2\endcsname#7#8 + \egroup + \bgroup + \ifPstObjectsThreeD@Corners + \def\PstObjectsThreeD@CornersLengthTmpB{0}% + \fi + \expandafter\csname PstCube@DrawFace#3\endcsname#7#8 + \egroup + \egroup +\fi +\expandafter\csname PstCube@DrawFace#4\endcsname#7#8 +\expandafter\csname PstCube@DrawFace#5\endcsname#7#8 +\expandafter\csname PstCube@DrawFace#6\endcsname#7#8} +\def\PstCube@DrawFaceA(#1,#2,#3)(#4,#5,#6){% +\pst@dima=-#4\psxunit +\divide\pst@dima\tw@ +\pst@dimc=#6\psyunit +\divide\pst@dimc\tw@ +\ThreeDput[normal=0 -1 0](#1,#2,#3){% + \PstObjectsThreeD@Shape(-#4,#6) + \ifx\PstObjectsThreeDFaceA\@undefined + \else + \rput[bl](-#4,0){\PstObjectsThreeDFaceA} + \fi + \ifx\PstObjectsThreeDFaceCenterA\@undefined + \else + \rput[c](\pst@dima,\pst@dimc){\PstObjectsThreeDFaceCenterA} + \fi}} +\def\PstCube@DrawFaceB(#1,#2,#3)(#4,#5,#6){% +\pst@dimb=#5\psxunit +\divide\pst@dimb\tw@ +\pst@dimc=#6\psyunit +\divide\pst@dimc\tw@ +\ThreeDput[normal=1 0 0](#1,#2,#3){% + \PstObjectsThreeD@Shape(#5,#6) + \ifx\PstObjectsThreeDFaceB\@undefined + \else + \rput[bl](0,0){\PstObjectsThreeDFaceB} + \fi + \ifx\PstObjectsThreeDFaceCenterB\@undefined + \else + \rput[c](\pst@dimb,\pst@dimc){\PstObjectsThreeDFaceCenterB} + \fi}} +\def\PstCube@DrawFaceC(#1,#2,#3)(#4,#5,#6){% +\pst@dimg=-#4\psxunit +\advance \pst@dimg by #1\psxunit +\pst@dima=#4\psxunit +\divide\pst@dima\tw@ +\pst@dimb=#5\psxunit +\divide\pst@dimb\tw@ +\ThreeDput[normal=0 0 1](\pst@dimg,#2,#3){{% + \psyunit=\psxunit + \PstObjectsThreeD@Shape(#4,#5) + \ifx\PstObjectsThreeDFaceC\@undefined + \else + \rput[bl](0,0){\PstObjectsThreeDFaceC} + \fi + \ifx\PstObjectsThreeDFaceCenterC\@undefined + \else + \rput[c](\pst@dima,\pst@dimb){\PstObjectsThreeDFaceCenterC} + \fi}}} +\def\PstCube@DrawFaceD(#1,#2,#3)(#4,#5,#6){% +\pst@dimg=#5\psxunit +\advance \pst@dimg by #2\psyunit +\pst@dima=-#4\psxunit +\divide\pst@dima\tw@ +\pst@dimc=#6\psyunit +\divide\pst@dimc\tw@ +\ThreeDput[normal=0 -1 0](#1,\pst@dimg,#3){% + \PstObjectsThreeD@Shape(-#4,#6) + \ifx\PstObjectsThreeDFaceD\@undefined + \else + \rput[bl](-#4,0){\PstObjectsThreeDFaceD} + \fi + \ifx\PstObjectsThreeDFaceCenterD\@undefined + \else + \rput[c](\pst@dima,\pst@dimc){\PstObjectsThreeDFaceCenterD} + \fi}} +\def\PstCube@DrawFaceE(#1,#2,#3)(#4,#5,#6){% +\pst@dimg=-#4\psxunit +\advance \pst@dimg by #1\psxunit +\pst@dimb=#5\psxunit +\divide\pst@dimb\tw@ +\pst@dimc=#6\psyunit +\divide\pst@dimc\tw@ +\ThreeDput[normal=1 0 0](\pst@dimg,#2,#3){% + \PstObjectsThreeD@Shape(#5,#6) + \ifx\PstObjectsThreeDFaceE\@undefined + \else + \rput[bl](0,0){\PstObjectsThreeDFaceE} + \fi + \ifx\PstObjectsThreeDFaceCenterE\@undefined + \else + \rput[c](\pst@dimb,\pst@dimc){\PstObjectsThreeDFaceCenterE} + \fi}} +\def\PstCube@DrawFaceF(#1,#2,#3)(#4,#5,#6){% +\pst@dimg=-#4\psxunit +\advance \pst@dimg by #1\psxunit +\pst@dimh=#6\psyunit +\advance \pst@dimh by #3\psyunit +\pst@dima=#4\psxunit +\divide\pst@dima\tw@ +\pst@dimb=#5\psxunit +\divide\pst@dimb\tw@ +\ThreeDput[normal=0 0 1](\pst@dimg,#2,\pst@dimh){{% + \psyunit=\psxunit + \PstObjectsThreeD@Shape(#4,#5) + \ifx\PstObjectsThreeDFaceF\@undefined + \else + \rput[bl](0,0){\PstObjectsThreeDFaceF} + \fi + \ifx\PstObjectsThreeDFaceCenterF\@undefined + \else + \rput[c](\pst@dima,\pst@dimb){\PstObjectsThreeDFaceCenterF} + \fi}}} +\def\psget@@viewpoint#1 #2 #3 #4\@nil{% +\pssetxlength{\pst@dima}{#1}% +\pssetylength{\pst@dimb}{#2}% +\pssetzlength{\pst@dimc}{#3}} +\def\PstObjectsThreeD@Octogon(#1,#2){% +\pst@dimh=\PstObjectsThreeD@CornersLength pt +\multiply\pst@dimh#1 +\pst@dimtonum{\pst@dimh}{\pst@tempa}% +\pst@dimh=\PstObjectsThreeD@CornersLengthTmpB pt +\multiply\pst@dimh#1 +\pst@dimtonum{\pst@dimh}{\pst@tempg}% +\pst@dimh=\@ne pt +\advance\pst@dimh-\PstObjectsThreeD@CornersLength pt +\multiply\pst@dimh#1 +\pst@dimtonum{\pst@dimh}{\pst@tempb}% +\pst@dimh=\@ne pt +\advance\pst@dimh-\PstObjectsThreeD@CornersLengthTmpA pt +\multiply\pst@dimh#1 +\pst@dimtonum{\pst@dimh}{\pst@tempe}% +\pst@dimh=\PstObjectsThreeD@CornersLength pt +\multiply\pst@dimh#2 +\pst@dimtonum{\pst@dimh}{\pst@tempc}% +\pst@dimh=\PstObjectsThreeD@CornersLengthTmpA pt +\multiply\pst@dimh#2 +\pst@dimtonum{\pst@dimh}{\pst@tempf}% +\pst@dimh=\@ne pt +\advance\pst@dimh-\PstObjectsThreeD@CornersLength pt +\multiply\pst@dimh#2 +\pst@dimtonum{\pst@dimh}{\pst@tempd}% +\pst@dimh=\@ne pt +\advance\pst@dimh-\PstObjectsThreeD@CornersLengthTmpB pt +\multiply\pst@dimh#2 +\pst@dimtonum{\pst@dimh}{\pst@temph}% +\pspolygon(\pst@tempa,0)(\pst@tempe,0)(#1,\pst@tempf)(#1,\pst@tempd) + (\pst@tempb,#2)(\pst@tempg,#2)(0,\pst@temph)(0,\pst@tempc)} +\def\PstDie@Letter#1#2{% +\advance#1\@ne +\ifnum#1>6 + #1=\@ne +\fi +\def#2{\ifcase#1\or A\or B\or C\or D\or E\or F\fi}} +\catcode`\@=\PstAtCode\relax +\endinput +%% +%% End of file `pst-ob3d.tex'. |