Retour

par-surfacesparametrees.tex

Télécharger le fichier
\section{Les surfaces paramétrées}
\subsection{Méthode}
Les surfaces paramétrées écrites sous la forme $[x(u,v),y(u,v),z(u,v)]$
seront gérées grâce à la commande \verb+\psSolid+ par l'option
\Cadre{object=surfaceparametree} et définies soit en \textit{notation
polonaise inverse} (\texttt{RPN}, \textit{Reverse Polish Notation})~:
 
{\red
\begin{verbatim}
\defFunction{shell}(u,v){1.2 v exp u Sin dup mul v Cos mul mul}% x(u,v)
                        {1.2 v exp u Sin dup mul v Sin mul mul}% y(u,v)
                        {1.2 v exp u Sin u Cos mul mul}        %z(u,v)
\end{verbatim}
}
soit en \textit{notation algébrique} :
{\red
\begin{verbatim}
\defFunction[algebraic]{shell}(u,v){1.2^v*(sin(u)^2*cos(v))}% x(u,v)
                                   {1.2^v*(sin(u)^2*sin(v))}% y(u,v)
                                   {1.2^v*(sin(u)*cos(u))}  %z(u,v)
\end{verbatim}
}
Les plages de valeurs pour $u$ et $v$ sont définies dans l'option
\Cadre{base=$\mathtt{u_{min}}$ $\mathtt{u_{max}}$ $\mathtt{v_{min}}$
$\mathtt{v_{max}}$}.  %$
 
Le tracé de la fonction est activé par
\Cadre{function=nom\_de\_la\_fonction}, ce nom a été précisé lorsque les
équations paramétriques ont été écrites :
\verb+\defFunction{nom_de_la_fonction}...+
 
Tout autre choix que $u$ et $v$ est acceptable. Rappelons que l'argument de
\Cadre{Sin} et \Cadre{Cos} doit être en radians et celui de \Cadre{sin} et
\Cadre{cos} en degrés si vous utilisez la \textit{RPN}. En notation
algébrique, l'argument est en radians.
 
 
\subsection{Exemple 1 : dessin d'un coquillage}
\newcommand\quadrillage{%
\psset{linecolor={[cmyk]{1,0,1,0.5}}}\green
\multido{\ix=-4+1}{9}{%
    \psPoint(\ix\space,4,-3){X1}
    \psPoint(\ix\space,4 .2 add,-3){X2}
    \psline(X1)(X2)
    \uput[-120](X1){\small\ix}}
\multido{\iy=-4+1}{9}{%
    \psPoint(-4,\iy\space,-3){Y1}
    \psPoint(-4 .2 sub,\iy\space,-3){Y2}
    \psline(Y1)(Y2)
    \uput[0](Y1){\small\iy}}
\multido{\iz=-3+1}{7}{%
    \psPoint(4,4,\iz\space){Z1}
    \psPoint(4,4 .2 add,\iz\space){Z2}
    \psline(Z1)(Z2)
    \uput[l](Z1){\small\iz}}
\psPoint(0,4 0.5 add,-3){X0}
\uput[-120](X0){$x$}
    \psPoint(-4 .5 sub,0,-3){Y0}
\uput[0](Y0){$y$}}
\begin{LTXexample}[width=7.8cm]
\psset{unit=0.75}
\begin{pspicture}(-5.5,-6)(4.5,4)
\psframe*(-5.5,-6)(4.5,4)
\psset[pst-solides3d]{viewpoint=20 120 30 rtp2xyz,
  Decran=15,lightsrc=-10 15 10}
% Parametric Surfaces
\psSolid[object=grille,base=-4 4 -4 4,
  action=draw*,linecolor={[cmyk]{1,0,1,0.5}}]
  (0,0,-3)
\defFunction{shell}(u,v)
  {1.2 v exp u Sin dup mul v Cos mul mul}
  {1.2 v exp u Sin dup mul v Sin mul mul}
  {1.2 v exp u Sin u Cos mul mul}
\psSolid[object=surfaceparametree,
  linecolor={[cmyk]{1,0,1,0.5}},
  base=0 pi pi 4 div neg 5 pi mul 2 div,
  fillcolor=yellow!50,incolor=green!50,
  function=shell,linewidth=0.5\pslinewidth,ngrid=25]%
\psSolid[object=parallelepiped,a=8,b=8,c=6,
  action=draw,linecolor={[cmyk]{1,0,1,0.5}}]%
\quadrillage
\end{pspicture}
\end{LTXexample}
 
\begin{LTXexample}[width=7.8cm]
\psset{unit=0.75}
\begin{pspicture}(-5,-4)(5,6)
\psframe*(-5,-4)(5,6)
\psset[pst-solides3d]{viewpoint=20 20 -10 rtp2xyz,
  Decran=15,lightsrc=5 10 2}
% Parametric Surfaces
\psSolid[object=grille,base=-4 4 -4 4,
  action=draw*,linecolor=red](0,0,-3)
\defFunction[algebraic]{shell}(u,v)
  {1.21^v*(sin(u)*cos(u))}
  {1.21^v*(sin(u)^2*sin(v))}
  {1.21^v*(sin(u)^2*cos(v))}
\psSolid[object=surfaceparametree,
   linecolor={[cmyk]{1,0,1,0.5}},
   base=0 pi pi 4 div neg 5 pi mul 2 div,
   fillcolor=green!50,incolor=yellow!50,
   function=shell,linewidth=0.5\pslinewidth,
   ngrid=25]%
\white%
\gridIIID[Zmin=-3,Zmax=4,linecolor=white,
  QZ=0.5](-4,4)(-4,4)
\end{pspicture}
\end{LTXexample}
 
 
 
\subsection{Exemple 2 : une hélice tubulaire}
\begin{LTXexample}[width=5.5cm]
\psset{unit=0.75}
\begin{pspicture}(-3,-4)(3,6)
\psset[pst-solides3d]{viewpoint=20 10 2,Decran=20,
  lightsrc=20 10 10}
% Parametric Surfaces
\defFunction{helix}(u,v)
  {1 .4 v Cos mul sub u Cos mul 2 mul}
  {1 .4 v Cos mul sub u Sin mul 2 mul}
  {.4 v Sin mul u .3 mul add}
\psSolid[object=surfaceparametree,linewidth=0.5\pslinewidth,
  base=-10 10 0 6.28,fillcolor=yellow!50,incolor=green!50,
  function=helix,
  ngrid=60 0.4]%
\gridIIID[Zmin=-3,Zmax=3](-2,2)(-2,2)
\end{pspicture}
\end{LTXexample}
 
 
\subsection{Exemple 3 : un cône}
\begin{LTXexample}[width=10cm]
\psset{unit=0.5}
\begin{pspicture}(-9,-7)(10,12)
\psframe*(-9,-7)(10,12)
\psset[pst-solides3d]{
  viewpoint=20 5 10,
  Decran=50,lightsrc=20 10 5}
\psSolid[
  object=grille,base=-2 2 -2 2,
  linecolor=white](0,0,-2)
% Parametric Surfaces
\defFunction{cone}(u,v)
  {u v Cos mul}{u v Sin mul}{u}
\psSolid[object=surfaceparametree,
   base=-2 2 0 2 pi mul,
   fillcolor=yellow!50,
   incolor=green!50,function=cone,
   linewidth=0.5\pslinewidth,
   ngrid=25 40]%
\psset{linecolor=white}\white
\gridIIID[Zmin=-2,Zmax=2]
  (-2,2)(-2,2)
\end{pspicture}
\end{LTXexample}
 
 
\subsection{Un site}
Vous trouverez sur le site :
 
\centerline{\url{http://k3dsurf.sourceforge.net/}}
 
un excellent logiciel pour représenter les surfaces avec de nombreux
exemples de surfaces paramétrées et autres.