Retour

doc_pst-rubans.tex

Télécharger le fichier Fichier PDF
% \PassOptionsToPackage{colorlinks=true}{hyperref}
\documentclass{article}
\usepackage{pst-rubans}
\usepackage[colorlinks=true]{hyperref}
\let\PSTfileversion\fileversion
\let\PSTfiledate\filedate
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[garamond]{mathdesign}
\renewcommand{\ttdefault}{lmtt}
\usepackage[a4paper,left=2cm,right=2cm]{geometry}
\usepackage{showexpl}
\usepackage[french]{babel}
%\parindent=0pt
\title{pst-rubans : une extension de pst-solides3d
\begin{center}
\begin{pspicture}(-10,0)(0,0.2)
\pshelices[lightsrc=30 5 17,incolor=yellow!50,R=0.3,h=12,spires=10,dZ=0.2,RotX=90,viewpoint=100 45 0,resolution=180,Decran=100]%
\end{pspicture}
\end{center}
{\normalsize v. \PSTfileversion\ (\PSTfiledate)}}
\date{14 décembre 2\,007}
\begin{document}
\maketitle
\begin{abstract}
\texttt{pst-rubans} est une extension de \texttt{pst-solides3d} qui permet de tracer des rubans sur
certains solides de révolution. La largeur du ruban, le nombre de spires, la couleur de la face externe ainsi que celle
de la face interne peuvent être paramétrées. Dans le cas de l'hélice circulaire, on peut aussi choisir le nombre de rubans.
\end{abstract}
\tableofcontents
\newpage
\section{Ruban enroulé autour d'un cylindre}
On peut paramétrer le rayon \verb+[R=2]+, la hauteur \verb+[h=6]+, l'épaisseur du ruban \verb+[dZ=0.5]+, le nombre de spires \verb+[spires=10]+
de chaque hélice, le nombre de rubans \verb+[rubans=1]+, le nombre d'éléments par ruban \verb+[resolution=36]+, la couleur de l'intérieur et de l'extérieur du ruban.
 
La base et le couvercle ne font pas partie de la commande.
\subsection{Nombre de rubans \texttt[rubans=1]}
{\psset{lightsrc=30 5 17,SphericalCoor,viewpoint=50 45 30,Decran=50,dZ=0.2,resolution=36,spires=2,unit=0.5}
\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-1)(2,8)
\psframe(-2,-1)(2,7)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,-0.2)
\pshelices[incolor=yellow!50,R=1.5,h=6,hue=0 1,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,6)
\end{pspicture}
\end{LTXexample}
\subsection{Nombre de rubans \texttt[rubans=2]}
\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-1)(2,8)
\psframe(-2,-1)(2,7)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,-0.2)
\pshelices[incolor=yellow!50,R=1.5,h=6,hue=0 1,rubans=2,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,6)
\end{pspicture}
\end{LTXexample}
\subsection{Nombre de rubans \texttt[rubans=3]}
\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-1)(2,8)
\psframe[linewidth=2\pslinewidth](-2,-1)(2,7)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,-0.2)
\pshelices[incolor=yellow!50,R=1.5,h=6,hue=0 1,rubans=3,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,6)
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-1)(2,8)
\psframe[linewidth=2\pslinewidth](-2,-1)(2,7)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,-0.2)%
\pshelices[incolor=yellow!50,R=1.5,h=6,hue=0 1,rubans=4,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36](0,0,6)%
\end{pspicture}
\end{LTXexample}
}
 
\subsection{Nombre de rubans \texttt{[rubans=4]}, on fait varier la hauteur \texttt{[h=2,3,4,5]}}
{\psset{lightsrc=30 5 17,SphericalCoor,viewpoint=50 45 10,Decran=50,resolution=90,spires=2}
\multido{\nH=2+1}{4}{%
\begin{pspicture}(-2,-1)(2,6)
\psframe*(-2,-1)(2,6)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36,grid](0,0,-0.2)%
\pshelices[incolor=yellow!50,R=1.5,h=\nH,linewidth=0.5\pslinewidth,dZ=0.15,hue=0 1,rubans=4,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36,grid](0,0,\nH\space dz add)%
\end{pspicture}}}
\begin{verbatim}
\multido{\nH=2+1}{4}{%
\begin{pspicture}(-2,-1)(2,6)
\psframe*(-2,-1)(2,6)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36,grid](0,0,-0.2)%
\pshelices[incolor=yellow!50,R=1.5,h=\nH,dZ=0.15,hue=0 1,rubans=4,grid](0,0,0)
\psSolid[object=cylindre,r=1.5,h=0.2,ngrid=1 36,grid](0,0,\nH\space dz add)%
\end{pspicture}}
\end{verbatim}
\subsection{Rubans disposés sur un plan}
{\psset{unit=0.8}
\begin{LTXexample}[width=8cm]
\psset{lightsrc=30 5 17,SphericalCoor,Decran=50,resolution=90,spires=2}
\begin{pspicture}(-4,-1)(4,4)
\psset{R=1,h=2,dZ=0.2,linewidth=0.5\pslinewidth,viewpoint=50 60 10}
\psSolid[object=grille,base=-5 5 -5 5]%
\psSolid[object=cylindre,r=1,h=0.2,ngrid=1 36](-3,-3,0)
\psSolid[object=cylindre,r=1,h=0.2,ngrid=1 36](-3,3,0)
\psSolid[object=cylindre,r=1,h=0.2,ngrid=1 36](3,3,0)
\psSolid[object=cylindre,r=1,h=0.2,ngrid=1 36](3,-3,0)
\pshelices[incolor=red!50,rubans=2](-3,-3,0.2)
\pshelices[incolor=yellow!50,rubans=2](-3,3,0.2)
\pshelices[incolor=green!50,rubans=2](3,3,0.2)
\pshelices[incolor=gray!50,rubans=2](3,-3,0.2)
\end{pspicture}
\end{LTXexample}}
\section{Ruban enroulé autour d'un tore}
\begin{verbatim}
\psSpiralRing[incolor=yellow!50,r1=4,r0=1,hue,lightsrc=30 5 17](x,y,z)
\end{verbatim}
On peut paramétrer le rayon moyen \verb+[r1=2]+, le rayon intérieur \verb+[r0=1]+, l'épaisseur du ruban \verb+[dPHI=2]+, en degrés suivant la latitude, le nombre de spires \verb+[spires=10]+
du ruban, le nombre de brins du ruban \verb+resolution=[36]+, la couleur de l'intérieur et de l'extérieur du ruban.
\psset{SphericalCoor,viewpoint=20 20 60,Decran=20,lightsrc=10 20 5,resolution=360}
 
\begin{LTXexample}[width=10cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psSpiralRing[incolor=yellow!50,
              r1=4,r0=1,hue=0 1]%
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=10cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psframe*(-5,-5)(5,5)
\psSpiralRing[incolor=yellow!20,r1=4,r0=1,
              fillcolor=orange,grid,
              dPHI=10,spires=5]%
\end{pspicture}
\end{LTXexample}
 
 
\begin{LTXexample}[width=10cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psset{lightsrc=10 20 20}
\psframe(-5,-5)(5,5)
\psSpiralRing[r1=4,r0=1,fillcolor=blue,
              incolor=gray!50,grid,
              dPHI=2,spires=20,
              resolution=720,
              viewpoint=20 20 60]%
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=9cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psSolid[object=tore,r0=1,r1=4,action=draw*,ngrid=18 36]%
\defFunction[algebraic]{solenoidetorique}(t){(4+cos(10*t))*cos(t)}{(4+cos(10*t))*sin(t)}{sin(10*t)}
\psSolid[object=courbe,linecolor=blue,
        resolution=720,range=0 2 pi mul,
       function=solenoidetorique]%
\end{pspicture}
\end{LTXexample}
\section{Ruban enroulé autour d'un paraboloïde}
On peut paramétrer la hauteur du paraboloïde \verb+[h=6]+, l'épaisseur du ruban \verb+[dz=.25]+, le nombre de spires \verb+[spires=10]+
du ruban, le nombre de brins du ruban \verb+[resolution=36]+, le paramètre de la parabole \verb+[p=2]+, la couleur de l'intérieur et de l'extérieur du ruban.
 
{\small
\begin{LTXexample}[width=11cm]
\psset{lightsrc=40 25 17,SphericalCoor}
\psset{unit=0.75,viewpoint=50 30 20,Decran=50}
\begin{pspicture}(-7,-4)(7,10)
\psframe*(-8,-4)(8,10)
\psSpiralParaboloid[incolor=yellow!50,h=6,hue=0 1,resolution=360,spires=5,grid,dZ=0.5]%
\psset{linecolor=white}\white%
\gridIIID[QZ=3,Zmin=0,Zmax=6](-5,5)(-5,5)
\end{pspicture}
\end{LTXexample}}
 
 
{\psset{lightsrc=40 25 17,SphericalCoor,viewpoint=50 30 20,Decran=50}
\begin{LTXexample}[width=9cm]
\psset{unit=0.60}
\begin{pspicture}(-5,-4)(5,9)
\defFunction[algebraic]{spiraleparabolique}(t){2*(sqrt(t))*cos(10*t)}{2*(sqrt(t))*sin(10*t)}{t}
\psSolid[object=courbe,linecolor=blue,
        resolution=720,range=0 6,
       function=spiraleparabolique]%
\gridIIID[QZ=3,Zmin=0,Zmax=6](-5,5)(-5,5)
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=9cm]
\psset{unit=0.60}
\begin{pspicture}(-7,-4)(7,9)
\psSpiralParaboloid[incolor=yellow!50,h=6,hue=0 1,resolution=360,dZ=0.25]%
\gridIIID[QZ=3,Zmin=0,Zmax=6](-5,5)(-5,5)
\end{pspicture}
\end{LTXexample}
}
\section{Ruban enroulé autour d'une sphère}
\begin{verbatim}
\psSphericalSpiral[incolor=yellow!50,R=4,hue=0 1,dPHI=2,spires=10](x,y,z)
\end{verbatim}
On peut paramétrer le rayon \verb+[R=2]+, l'épaisseur du ruban \verb+[dPHI=2]+, en degrés suivant la latitude, le nombre de spires \verb+[spires=10]+
de chaque hélice, le nombre de brins du ruban \verb+resolution=[36]+, la couleur de l'intérieur et de l'extérieur du ruban.
 
\psset{SphericalCoor,viewpoint=50 20 10,Decran=50,resolution=180}
\begin{LTXexample}[width=9cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\defFunction[algebraic]{helicespherique}(t){4*cos(10*t)*cos(t)}{4*sin(10*t)*cos(t)}{4*sin(t)}
\psSolid[object=courbe,linecolor=blue,
        resolution=720,range=pi 2 div neg pi 2 div,
       function=helicespherique]%
\psSolid[object=sphere,r=4,action=draw,ngrid=18 18]%
\gridIIID[Zmin=-4,Zmax=4](-4,4)(-4,4)
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=9cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psset{SphericalCoor,viewpoint=50 20 10,Decran=50,resolution=180}
\psSphericalSpiral[incolor=yellow!50,R=4,hue=0 1,lightsrc=30 5 17]%
\gridIIID[Zmin=-4,Zmax=4](-4,4)(-4,4)
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=9cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psframe*(-5,-5)(5,5)
\psset{SphericalCoor,viewpoint=50 20 30,Decran=50,resolution=360}
\psSphericalSpiral[incolor=yellow!20,R=4,fillcolor=orange,lightsrc=40 15 25,grid,dPHI=10](0,0,0)
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=9cm]
\begin{pspicture}(-4,-4)(4,4)
\psframe*(-4,-4)(4,4)
\psset{unit=0.6}
\psset{SphericalCoor,viewpoint=50 20 10,Decran=50,resolution=360}
\psSphericalSpiral[incolor=yellow!50,R=4,fillcolor=green!50,lightsrc=32 38 -10,grid]
\white%
\gridIIID[Zmin=-4,Zmax=4,linecolor=white](-4,4)(-4,4)
\end{pspicture}
\end{LTXexample}
 
\end{document}