Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc / par-ruban.tex
1 \section {Solide ruban}
2
3 Le ruban est un paravent posé sur le sol horizontal. La base du paravent
4 est définie sur le plan $Oxy$ par les coordonnées des sommets placés dans
5 le sens trigonométrique par le paramètre \texttt{base} :
6 \begin{verbatim}
7 \psSolid[object=ruban,h=3,base=x1 y1 x2 y2 x3 y3 ...xn yn,ngrid=n](0,0,0)%
8 \end{verbatim}
9
10 \subsection{Un simple paravent}
11 \begin{minipage}{0.6\linewidth}
12 \psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50,unit=0.75}
13 \begin{pspicture}(-5.5,-4.5)(7,5)
14 \psframe(-5.5,-4.5)(7,5)
15 \psSolid[object=grille,base=-4 6 -4 4,action=draw,linecolor=gray](0,0,0)
16 \psSolid[object=ruban,h=3,fillcolor=red!50,
17 base=0 0 2 2 4 0 6 2,
18 num=0 1 2 3,
19 show=0 1 2 3,
20 ngrid=3
21 ](0,0,0)
22 \axesIIID(0,2,0)(6,6,4.5)
23 \end{pspicture}
24 \end{minipage}
25 %
26 \begin{minipage}{0.49\linewidth}
27 \begin{verbatim}
28 \begin{pspicture}(-5,-4)(6,7)
29 \psframe(-5,-4)(6,7)
30 \psSolid[
31 object=grille,base=-4 6 -4 4,
32 action=draw](0,0,0)
33 \psSolid[
34 object=ruban,h=3,
35 fillcolor=red!50,
36 base=0 0 2 2 4 0 6 2,
37 num=0 1 2 3,
38 show=0 1 2 3,
39 ngrid=3
40 ](0,0,0)
41 \axesIIID(0,2,0)(6,6,6)
42 \end{pspicture}
43 \end{verbatim}
44 \end{minipage}
45
46
47 \subsection{Un paravent sinusoïdal}
48
49 \begin{center}
50 \psset{unit=0.6}
51 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=50}
52 \begin{pspicture}(-10,-6)(12,8)
53 \psframe(-10,-6)(12,7)
54 \defFunction{funcF}(t){2 t 4 mul cos mul}{t 20 div}{}
55 \psSolid[object=grille,base=-6 6 -10 10,action=draw,linecolor=gray](0,0,0)
56 \psSolid[object=ruban,h=2,fillcolor=red!50,
57 resolution=72,
58 base=-200 200 {funcF} CourbeR2+, %% -200 5 200 {/Angle ED 2 Angle 4 mul cos mul Angle 20 div } for,
59 ngrid=4](0,0,0)
60 \axesIIID(5,10,0)(7,11,6)
61 \end{pspicture}
62 \end{center}
63
64 \begin{verbatim}
65 \psset{unit=0.6}
66 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=50}
67 \begin{pspicture}(-10,-5)(12,7)
68 \psframe(-10,-5)(12,7)
69 \defFunction{funcF}(t){2 t 4 mul cos mul}{t 20 div}{}
70 \psSolid[object=grille,base=-6 6 -10 10,action=draw,linecolor=gray](0,0,0)
71 \psSolid[object=ruban,h=2,fillcolor=red!50,
72 resolution=72,
73 base=-200 200 {funcF} CourbeR2+,
74 ngrid=4](0,0,0)
75 \axesIIID(5,10,0)(7,11,6)
76 \end{pspicture}
77 \end{verbatim}
78
79
80
81 \subsection{Une surface ondulée}
82
83 C'est le même objet que précédemment en lui faisant subir une rotation de
84 $90^{\mathrm{o}}$ autour de $Oy$.
85 \begin{center}
86 \psset{unit=0.6}
87 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=30}
88 \begin{pspicture}(-14,-7)(8,5)
89 \psframe(-14,-7)(8,5)
90 \defFunction{funcF}(t){t 4 mul cos}{t 20 div}{}
91 \psSolid[object=grille,base=0 16 -10 10,action=draw,linecolor=gray](0,0,0)
92 \psSolid[object=ruban,h=16,fillcolor=red!50,RotY=90,incolor=green!20,
93 resolution=72,
94 base=-200 200 {funcF} CourbeR2+,
95 ngrid=16](0,0,1)
96 \axesIIID(16,10,0)(20,12,6)
97 \end{pspicture}
98 \end{center}
99 \begin{verbatim}
100 \psset{unit=0.6}
101 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=30}
102 \begin{pspicture}(-14,-7)(8,7)
103 \defFunction{funcF}(t){t 4 mul cos}{t 20 div}{}
104 \psSolid[object=grille,base=0 16 -10 10,action=draw,linecolor=gray](0,0,0)
105 \psSolid[object=ruban,h=16,fillcolor=red!50,RotY=90,incolor=green!20,
106 resolution=72,
107 base=-200 200 {funcF} CourbeR2+,
108 ngrid=16](0,0,1)
109 \psframe(-14,-7)(8,7)
110 \axesIIID(16,10,0)(20,12,6)
111 \end{pspicture}
112 \end{verbatim}
113 On peut ensuite l'imaginer comme toit en tôle ondulée d'un abri quelconque.
114
115
116 \subsection{Un paravent étoilé : version 1}
117 Le contour du paravent est défini dans une boucle :
118 \begin{verbatim}
119 base=0 72 360 {/Angle ED 5 Angle cos mul 5 Angle sin mul
120 3 Angle 36 add cos mul 3 Angle 36 add sin mul} for
121 \end{verbatim}
122 la surface bleutée du fond est définie à l'aide d'un polygone dont les
123 sommets sont calculés par la commande \\\verb+\psPoint(x,y,z){P}+
124 \begin{verbatim}
125 \multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
126 \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
127 \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
128 }%
129 \pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)
130 (P3)(p3)(P4)(p4)(P5)(p5)
131 \end{verbatim}
132 \begin{center}
133 \psset{unit=0.55}
134 \psset{lightsrc=10 0 10,viewpoint=50 20 30 rtp2xyz,Decran=50}
135 \begin{pspicture}(-9,-5)(9,7)
136 \psframe(-9,-5)(9,7)
137 \multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
138 \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
139 \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
140 }%
141 \pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)(P3)(p3)(P4)(p4)(P5)(p5)
142 \defFunction{funcF}(t){t cos 5 mul}{t sin 5 mul}{}
143 \defFunction{funcG}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
144 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
145 \psSolid[object=ruban,h=1,fillcolor=red!50,
146 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
147 num=0 1 2 3,
148 show=0 1 2 3,
149 ngrid=2](0,0,0)
150 \axesIIID(5,5,0)(6,6,6)
151 \end{pspicture}
152 \end{center}
153 \begin{verbatim}
154 \begin{pspicture}(-9,-5)(9,7)
155 \psframe(-9,-5)(9,7)
156 \multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
157 \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
158 \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
159 }%
160 \pspolygon[fillstyle=solid,fillcolor=blue!50]
161 (P0)(p0)(P1)(p1)(P2)(p2)(P3)(p3)(P4)(p4)(P5)(p5)
162 \defFunction{funcF}(t){t cos 5 mul}{t sin 5 mul}{}
163 \defFunction{funcG}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
164 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
165 \psSolid[object=ruban,h=1,fillcolor=red!50,
166 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
167 num=0 1 2 3, show=0 1 2 3, ngrid=2](0,0,0)
168 \axesIIID(5,5,0)(6,6,6)
169 \end{pspicture}
170 \end{verbatim}
171
172
173 \subsection{Un paravent étoilé : version 2}
174
175 Le fond du récipient est défini par l'objet \texttt{face} avec l'option
176 \texttt{biface}~:
177 \begin{center}
178 \psset{unit=0.55}
179 \psset{lightsrc=10 0 10,viewpoint=50 -20 20 rtp2xyz,Decran=50}
180 \begin{pspicture}(-9,-4)(9,7)
181 \psframe(-9,-4)(9,7)
182 \defFunction{funcF}(t){t cos 5 mul}{t sin 5 mul}{}
183 \defFunction{funcG}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
184 \psSolid[object=face,fillcolor=blue!50,
185 biface,
186 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
187 ](0,0,0)
188 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
189 \psSolid[object=ruban,h=1,fillcolor=red!50,
190 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
191 ngrid=2](0,0,0)
192 \axesIIID(5,5,0)(6,6,6)
193 \end{pspicture}
194 \end{center}
195
196 \begin{verbatim}
197 \psset{lightsrc=10 0 10,viewpoint=50 -20 20 rtp2xyz,Decran=50}
198 \begin{pspicture}(-9,-4)(9,7)
199 \psframe(-9,-4)(9,7)
200 \defFunction{funcF}(t){t cos 5 mul}{t sin 5 mul}{}
201 \defFunction{funcG}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
202 \psSolid[object=face,fillcolor=blue!50,
203 biface,
204 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
205 ](0,0,0)
206 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
207 \psSolid[object=ruban,h=1,fillcolor=red!50,
208 base=0 72 360 {/Angle exch def Angle funcF Angle funcG} for,
209 ngrid=2](0,0,0)
210 \axesIIID(5,5,0)(6,6,6)
211 \end{pspicture}
212 \end{verbatim}
213
214
215 \endinput

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.