Retour

anim.tex

Télécharger le fichier Fichier PDF
Image PNG
\documentclass[a4paper]{article}
\usepackage{pst-solides3d}
\pagestyle{empty}
\begin{document}
\multido{\iRotZ=0+20}{18}{%
\begin{center}
\begin{pspicture}(-5,-6)(5,4)
\psframe(-5,-6)(5,4)
\psset{lightsrc=80 30 30,SphericalCoor=true,viewpoint=60 40 20,Decran=40,linewidth=0.1pt,opacity=0.7}
\pstVerb{
/AngleRotZ \iRotZ\space def
/torsion {
2 dict begin
   /M defpoint3d % on récupère les coordonnées
   /AngleTorsion M 20 mul 3 -2 roll pop pop def
   % on tourne de 10 degrés à chaque niveau
    M 0 0 AngleTorsion rotateOpoint3d
end} def}%
\psset{solidmemory}
\psSolid[object=cylindrecreux,r=3.75,h=10,ngrid=36 24,
% transform=torsion,
 fillcolor=white,
 incolor=white,
 action=none,
 name=C1
 %hollow,
 %opacity=0.6
 ](0,0,-5)%
\defFunction[algebraic]{F}(t){t}{}{3/16*(2*t*t-16)}
\psSolid[object=ruban, h=5,
   RotX=-90,
   RotZ=-45,
   resolution=72,
   base=-5 5 {F} CourbeR2+,ngrid=8,
   fillcolor=blue!10,
   incolor=blue!10,
   name=P1,
   action=none](0,0,-0.3)
\codejps{
/rpn {tx@AlgToPs begin AlgToPs end cvx exec} def
/xcy {(4*cos(t)) rpn } def
/ycy {(4*sin(t)) rpn } def
/zcy {(3*sin(2*t)) rpn } def
/xcy' {(-4*sin(t)) rpn } def
/ycy' {(4*cos(t)) rpn } def
/zcy' {(6*cos(2*t)) rpn } def
/xcy'' {(-4*cos(t)) rpn } def
/ycy'' {(-4*sin(t)) rpn } def
/zcy'' {(-12*sin(2*t)) rpn } def
%/solidgrid false def
/g {
3 dict begin
   /t exch def
xcy ycy zcy
end
} def
/g' { % dérivée première
3 dict begin
   /t exch def
xcy' ycy' zcy'
end
} def
/g'' { % dérivée seconde
3 dict begin
   /t exch def
xcy'' ycy'' zcy''
end
} def
/A1{
% t_min t_max rayon_tube [resolution]
0 6.28 (g) .25 [100 12] newtube
dup (orange) outputcolors} def
A1 P1 solidfuz
C1 solidfuz
dup {0 0 AngleRotZ rotateOpoint3d} solidtransform
drawsolid**}
\composeSolid
\end{pspicture}
\end{center}\newpage}
\end{document}