Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc / .svn / text-base / par-ligne3D.tex.svn-base
1 \section{Tracer une ligne brisée}
2
3 Cette commande est adaptée de la macro \verb+\pstThreeDLine+ du package \texttt{pst-3dplot} de H.Voss\footnote{\url{http://tug.ctan.org/tex-archive/graphics/pstricks/contrib/pst-3dplot}.}
4
5 On l'utilise : \psframebox[fillstyle=solid,fillcolor=yellow,linecolor=yellow]{\texttt{$\backslash$psLineIIID[options](x0,y0,z0)(x1,y1,z1)\ldots(xn,yn,zn)}},
6 avec les options suivantes possibles :
7 \begin{itemize}
8   \item \texttt{linecolor=couleur} ;
9   \item \texttt{doubleline=true} ;
10   \item \texttt{linearc=valeur}.
11 \end{itemize}
12 On ne peut pas flécher les extrémités d'une ligne.
13
14 \psset{viewpoint=50 20 30 rtp2xyz,Decran=50}
15 \begin{LTXexample}[width=6.5cm]
16 \begin{pspicture}(-3,-4)(4,4)
17 \psframe(-3,-4)(4,4)
18 \psSolid[object=cube,a=4,action=draw*,fillcolor=magenta!20]%
19 \psLineIIID[linecolor=blue,linewidth=0.1,linearc=0.5,doubleline=true](-2,-2,-2)(2,2,2)(2,2,-2)(2,-2,0)
20 \psPoint(2,-2,0){A}\psPoint(-2,-2,-2){B}
21 \psPoint(2,2,2){C}\psPoint(2,2,-2){D}
22 \psdot[dotsize=0.2](A)\psdot[dotsize=0.2](B)
23 \psdot[dotsize=0.2](C)\psdot[dotsize=0.2](D)
24 \psLineIIID[linecolor=green](-2,-2,-2)(2,2,2)(2,2,-2)(2,-2,0)
25 \psPolygonIIID[linecolor=red,fillstyle=vlines,linearc=0.5,linewidth=0.1](-2,-2,2)(-2,2,2)(2,2,2)(2,-2,2)
26 \axesIIID(2,2,2)(4,4,4)
27 \end{pspicture}
28 \end{LTXexample}
29
30 %% \section{Tracer une ligne brisée}
31 %% 
32 %% Cette commande est adaptée de la macro \verb+\pstThreeDLine+ du package \texttt{pst-3dplot} de H.Voss\footnote{\url{http://tug.ctan.org/tex-archive/graphics/pstricks/contrib/pst-3dplot}.}
33 %% 
34 %% On l'utilise : \psframebox[fillstyle=solid,fillcolor=yellow,linecolor=yellow]{\texttt{$\backslash$psLineIIID[options](x0,y0,z0)(x1,y1,z1)\ldots(xn,yn,zn)}},
35 %% avec les options suivantes possibles :
36 %% \begin{itemize}
37 %%   \item \texttt{linecolor=couleur} ;
38 %%   \item \texttt{doubleline=true} ;
39 %%   \item \texttt{linearc=valeur}.
40 %% \end{itemize}
41 %% On ne peut pas flécher les extrémités d'une ligne.
42 %% 
43 %% \psset{viewpoint=50 20 30 rtp2xyz,Decran=50}
44 %% \begin{LTXexample}[width=6.5cm]
45 %% \begin{pspicture}(-3,-4)(4,4)
46 %% \psframe(-3,-4)(4,4)
47 %% \psSolid[object=cube,a=4,action=draw*,fillcolor=magenta!20]%
48 %% \psLineIIID[linecolor=blue,linewidth=0.1,linearc=0.5,doubleline=true](-2,-2,-2)(2,2,2)(2,2,-2)(2,-2,0)
49 %% \psPoint(2,-2,0){A}\psPoint(-2,-2,-2){B}
50 %% \psPoint(2,2,2){C}\psPoint(2,2,-2){D}
51 %% \psdot[dotsize=0.2](A)\psdot[dotsize=0.2](B)
52 %% \psdot[dotsize=0.2](C)\psdot[dotsize=0.2](D)
53 %% \psLineIIID[linecolor=green](-2,-2,-2)(2,2,2)(2,2,-2)(2,-2,0)
54 %% \psPolygonIIID[linecolor=red,fillstyle=vlines,linearc=0.5,linewidth=0.1](-2,-2,2)(-2,2,2)(2,2,2)(2,-2,2)
55 %% \axesIIID(2,2,2)(4,4,4)
56 %% \end{pspicture}
57 %% \end{LTXexample}
58 %% 
59 %% \section{Tracer un polygone}
60 %% On utilise : \psframebox[fillstyle=solid,fillcolor=yellow,linecolor=yellow]{\texttt{$\backslash$psPolygonIIID[options](x0,y0,z0)(x1,y1,z1)\ldots(xn,yn,zn)}},
61 %% avec les options suivantes possibles :
62 %% \begin{itemize}
63 %%   \item \texttt{linecolor=couleur} ;
64 %%   \item \texttt{doubleline=true} ;
65 %%   \item \texttt{linearc=valeur} ;
66 %%   \item \texttt{fillstyle=solid} ;
67 %%   \item \texttt{fillstyle=vlines} ou \texttt{fillstyle=hlines} ou \texttt{fillstyle=crosshatch}.
68 %% \end{itemize}
69 %% \newpage
70 %% 
71 %% \section{Transformer un point et le mémoriser}
72 %% Soit un point initial $A(x,y,z)$. On fait subir à ce point des rotations autour des axes $Ox$, $Oy$ et $Oz$ d'angles respectifs :
73 %% \texttt{[RotX=valeurX,RotX=valeurY,RotX=valeurZ]}, dans cet ordre, puis on opère une translation de vecteur $(v_x,v_y,v_z)$. Le problème a été de récupérer les
74 %% coordonnées du point final $A'(x',y',z')$.
75 %% 
76 %% La commande \psframebox[fillstyle=solid,fillcolor=yellow,linecolor=yellow]{\texttt{$\backslash$psTransformPoint[RotX=valeurX,RotX=valeurY,RotX=valeurZ](x y z)(vx,vy,vz)\{A'\}}}
77 %%  permet de stocker dans le n\oe{}ud $A'$, les coordonnées du point transformé.
78 %% 
79 %% Dans l'exemple suivant $A(2,2,2)$ est l'un des sommets du cube initial, dont le centre est placé à l'origine du repère.
80 %% {\red
81 %% \begin{verbatim}
82 %% \psSolid[object=cube,a=4,action=draw*,linecolor=red]%
83 %% \end{verbatim}
84 %% }
85 %% Ce cube subit différentes transformations :
86 %% {\red
87 %% \begin{verbatim}
88 %% \psSolid[object=cube,a=4,action=draw*,RotX=-30,RotY=60,RotZ=-60](7.5,11.25,10)%
89 %% \end{verbatim}
90 %% }
91 %% Pour obtenir l'image de $A$, on applique la commande suivante :
92 %% {\red
93 %% \begin{verbatim}
94 %% \psTransformPoint[RotX=-30,RotY=60,RotZ=-60](2 2 2)(7.5,11.25,10){A'}
95 %% \end{verbatim}
96 %% }
97 %% Ce qui permet, par exemple, de nommer ces points et de dessiner le vecteur $\overrightarrow{AA'}$.
98 %% \begin{center}
99 %% \begin{pspicture}(-2,-4)(6,6)
100 %% \psframe(-2,-4)(6,6)
101 %% \psset{unit=0.5}
102 %% %\psSolid[object=cube,a=4,action=draw,linecolor=red,fontsize=40,numfaces=all]%
103 %% \psSolid[object=cube,a=4,action=draw*,linecolor=red]%
104 %% \psPoint(2,2,2){A}\psdot(A)
105 %% %\psSolid[object=cube,a=4,action=draw,RotX=-30,RotY=60,RotZ=-60,fontsize=40,numfaces=all](7.5,11.25,10)%
106 %% \psSolid[object=cube,a=4,action=draw*,RotX=-30,RotY=60,RotZ=-60](7.5,11.25,10)%
107 %% \psTransformPoint[RotX=-30,RotY=60,RotZ=-60](2 2 2)(7.5,11.25,10){A'}
108 %% \psdot(A')\psline[linecolor=blue,arrowsize=0.3]{{o-v}}(A)(A')
109 %% \uput[u](A'){$A'$}\uput[u](A){$A$}
110 %% \psset{solidmemory}
111 %% \psSolid[object=cube,a=4,
112 %%    name=A1,
113 %%    action=none](0,0,0)
114 %% \psset{fontsize=100,
115 %%    phi=90,
116 %%    no=0,
117 %%    solidname=A1}
118 %% \psProjection[object=texte,linecolor=red,text=A]%
119 %% \psset{fontsize=100,
120 %%    phi=180,
121 %%    no=1,
122 %%    solidname=A1}
123 %% \psProjection[object=texte,linecolor=red,text=B]%
124 %% \psset{fontsize=100,
125 %%    phi=90,
126 %%    no=4,
127 %%    solidname=A1}
128 %% \psProjection[object=texte,linecolor=red,text=E]%
129 %% %
130 %% \psset{solidmemory}
131 %% \psSolid[object=cube,a=4,RotX=-30,RotY=60,RotZ=-60,
132 %%    name=A2,
133 %%    action=none](7.5,11.25,10)
134 %% \psset{fontsize=100,
135 %%    phi=20,
136 %%    no=0,
137 %%    solidname=A2}
138 %% \psProjection[object=texte,text=A]%
139 %% \psset{fontsize=100,
140 %%    phi=160,
141 %%    no=2,
142 %%    solidname=A2}
143 %% \psProjection[object=texte,text=B]%
144 %% \psset{fontsize=100,
145 %%    phi=160,
146 %%    no=1,
147 %%    solidname=A2}
148 %% \psProjection[object=texte,text=C]%
149 %% \axesIIID(2,2,2)(10,10,8)
150 %% \end{pspicture}
151 %% \end{center}

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.