Grâce à la collaboration d'
Herbert Voss, la commande
\psImplicitSurface[options] est désormais intégrée au package
pst-solides3d. De plus, elle a été améliorée par Herbert sur deux points :
- mode algebraic ou postscript ;
- limites des variables définies directement dans les options.
Les exemples traités avec l'ancienne commande devront donc être adaptés. La mise à jour de pst-solides3d est disponible sur :
version 2 :
Le listing pour obtenir toutes les images. La compilation (LaTeX=>dvips=>ps2pdf) est très longue : plus de 1 h !
\documentclass{article}
\usepackage[paperwidth=16cm,paperheight=11cm,hmargin={0cm,0cm},vmargin={0cm,0cm},dvips]{geometry}
\usepackage{pst-solides3d}
\pagestyle{empty}
\begin{document}
\begin{center}
\psset{unit=1}%
\multido{\iZ=0+8}{15}{%
\begin{pspicture}(-8,-7)(8,4)
\psframe[fillstyle=hlines,hatchangle=0](-8,-7)(8,4)
\pstVerb{/GREEN {0 0.7 0 setrgbcolor} def}%
\psset{lightsrc=100 30 60 rtp2xyz,viewpoint=100 60 35 rtp2xyz,Decran=150}
\psSolid[object=grille,base=-5 5 -5 5,ngrid=1. 1.,unit=0.75,
fcol=0 20 80 { /i exch def
0 2 8 {/j exch def
j i add (white)
j i 1 add add (GREEN)
} for
} for
10 20 90 { /i exch def
0 2 8 {/j exch def
j i add (GREEN)
j i 1 add add (white)
} for
} for
](0,0,-2)
\pstVerb{
/R 1 def
/r 0.25 def
/torusImplicit {
X dup mul Y dup mul add z dup mul add dup mul
-2 R dup mul r dup mul add mul X dup mul Y dup mul add mul
add
2 R dup mul r dup mul sub mul z dup mul mul
add
R dup mul r dup mul sub add
} def
/tripleTorus {
0 120 240 {/i exch def
/X {x 1.5 i cos mul sub} def
/Y {y 1.5 i sin mul sub} def
torusImplicit
} for
mul mul
10 sub
} def}%
\pstVerb{
100 0 90 rtp2xyz
/zV exch def
/yV exch def
/xV exch def
/hZ 0 def
/Hshadow {
5 dict begin
/z exch def
/y exch def
/x exch def
/lambda hZ zV sub z zV sub div def
xV lambda x xV sub mul add % x
yV lambda y yV sub mul add % y
-1.5 % z
end
} def }%
{\psset{lightsrc=}
\psImplicitSurface[ImplFunction=tripleTorus,
fillcolor={[rgb]{0 0.4 0}},linecolor={[rgb]{0 0.4 0}},
RotZ=\iZ,linewidth=0,
transform=Hshadow,opacity=0.8,
XMinMax=-3 3 0.1,YMinMax=-3 3 0.1,ZMinMax=-0.5 0.5 0.1]}%
\psImplicitSurface[ImplFunction=tripleTorus,linewidth=0,
hue=1 0 1 1,RotZ=\iZ,
lightintensity=5,
XMinMax=-3 3 0.1,YMinMax=-3 3 0.1,ZMinMax=-0.5 0.5 0.1]
\psSolid[object=vecteur,
definition={[.1 .5]}, %% radius height
linecolor=black,
args=0 0 2](0, 0, 0.25)
\end{pspicture}\newpage}
\end{center}
\end{document}
\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}
\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psset{lightsrc=viewpoint,viewpoint=50 -20 30 rtp2xyz,Decran=50}
\psSolid[object=grille,base=-3 3 -3 3,ngrid=6 6,
fcol=0 12 24 { /i exch def
0 2 4 {/j exch def
j i add (white)
j i 1 add add (red)
} for
} for
6 12 30 { /i exch def
0 2 4 {/j exch def
j i add (red)
j i 1 add add (white)
} for
} for](0,0,-2)
\pstVerb{
/r 2 sqrt def
/r1 r 2 div def
/z1 r 1.5 mul 60 cos mul def
/z2 z1 def
/y1 r 1.5 mul 60 sin mul neg def
/y2 r 1.5 mul 60 sin mul def
/iface 0 store
/nbFaces {Faces length} def
}%
\psImplicitSurface[algebraic,ImplFunction=(x^2+y^2+z^2-2)*(x^2+(y-y1)^2+(z-z1)^2-r1^2)*(x^2+(y-y2)^2+(z-z2)^2-r1^2)-2,
XMinMax=-4 4 0.2,YMinMax=-4 4 0.2,ZMinMax=-4 4 0.2,
hue=1 0 0.5 1,
linewidth=0.01,linecolor={[rgb]{0 0 0.5}}]%
\gridIIID[Zmin=-2,Zmax=2,showAxes=false](-3,3)(-3,3)%
\end{pspicture}
\end{center}
\end{document}