summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc/par-ruban.tex
blob: 401a378c005ec736a29a931f24816ff4204fc842 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
\section {Solide ruban}

Le ruban est un paravent posé sur le sol horizontal. La base du paravent
est définie sur le plan $Oxy$ par les coordonnées des sommets placés dans
le sens trigonométrique par le paramètre \texttt{base} :
\begin{verbatim}
\psSolid[object=ruban,h=3,base=x1 y1 x2 y2 x3 y3 ...xn yn,ngrid=n](0,0,0)%
\end{verbatim}

\subsection{Un simple paravent}
\begin{minipage}{0.6\linewidth}
\psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50,unit=0.75}
\begin{pspicture}(-5.5,-4.5)(7,5)
\psframe(-5.5,-4.5)(7,5)
\psSolid[object=grille,base=-4 6 -4 4,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=3,fillcolor=red!50,
      base=0 0 2 2 4 0 6 2,
      num=0 1 2 3,
      show=0 1 2 3,
      ngrid=3
      ](0,0,0)
\axesIIID(0,2,0)(6,6,4.5)
\end{pspicture}
\end{minipage}
%
\begin{minipage}{0.49\linewidth}
\begin{verbatim}
\begin{pspicture}(-5,-4)(6,7)
\psframe(-5,-4)(6,7)
\psSolid[
   object=grille,base=-4 6 -4 4,
   action=draw](0,0,0)
\psSolid[
   object=ruban,h=3,
   fillcolor=red!50,
   base=0 0 2 2 4 0 6 2,
   num=0 1 2 3,
   show=0 1 2 3,
   ngrid=3
   ](0,0,0)
\axesIIID(0,2,0)(6,6,6)
\end{pspicture}
\end{verbatim}
\end{minipage}


\subsection{Un paravent sinusoïdal}

\begin{center}
\psset{unit=0.6}
\psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=50}
\begin{pspicture}(-10,-6)(12,8)
\psframe(-10,-6)(12,7)
\defFunction{F}(t){2 t 4 mul cos mul}{t 20 div}{}
\psSolid[object=grille,base=-6 6 -10 10,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=2,fillcolor=red!50,
      resolution=72,
      base=-200 200 {F} CourbeR2+,  %% -200 5 200 {/Angle ED 2 Angle 4 mul cos mul Angle 20 div } for,
      ngrid=4](0,0,0)
\axesIIID(5,10,0)(7,11,6)
\end{pspicture}
\end{center}

\begin{verbatim}
\psset{unit=0.6}
\psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=50}
\begin{pspicture}(-10,-5)(12,7)
\psframe(-10,-5)(12,7)
\defFunction{F}(t){2 t 4 mul cos mul}{t 20 div}{}
\psSolid[object=grille,base=-6 6 -10 10,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=2,fillcolor=red!50,
      resolution=72,
      base=-200 200 {F} CourbeR2+, 
      ngrid=4](0,0,0)
\axesIIID(5,10,0)(7,11,6)
\end{pspicture}
\end{verbatim}



\subsection{Une surface ondulée}

C'est le même objet que précédemment en lui faisant subir une rotation de
$90^{\mathrm{o}}$ autour de $Oy$.  
\begin{center}
\psset{unit=0.6}
\psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=30}
\begin{pspicture}(-14,-7)(8,5)
\psframe(-14,-7)(8,5)
\defFunction{F}(t){t 4 mul cos}{t 20 div}{}
\psSolid[object=grille,base=0 16 -10 10,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=16,fillcolor=red!50,RotY=90,incolor=green!20,
      resolution=72,
      base=-200 200 {F} CourbeR2+, 
      ngrid=16](0,0,1)
\axesIIID(16,10,0)(20,12,6)
\end{pspicture}
\end{center}
\begin{verbatim}
\psset{unit=0.6}
\psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=30}
\begin{pspicture}(-14,-7)(8,7)
\defFunction{F}(t){t 4 mul cos}{t 20 div}{}
\psSolid[object=grille,base=0 16 -10 10,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=16,fillcolor=red!50,RotY=90,incolor=green!20,
      resolution=72,
      base=-200 200 {F} CourbeR2+, 
      ngrid=16](0,0,1)
\psframe(-14,-7)(8,7)
\axesIIID(16,10,0)(20,12,6)
\end{pspicture}
\end{verbatim}
On peut ensuite l'imaginer comme toit en tôle ondulée d'un abri quelconque.


\subsection{Un paravent étoilé : version 1}
Le contour du paravent est défini dans une boucle :
\begin{verbatim}
       base=0 72 360 {/Angle ED 5 Angle cos mul 5 Angle sin mul
            3 Angle 36 add cos mul 3 Angle 36 add sin mul} for
\end{verbatim}
la surface bleutée du fond est définie à l'aide d'un polygone dont les
sommets sont calculés par la commande \\\verb+\psPoint(x,y,z){P}+ 
\begin{verbatim}
\multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
    \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
    \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
    }%
\pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)
                                             (P3)(p3)(P4)(p4)(P5)(p5)
\end{verbatim}
\begin{center}
\psset{unit=0.55}
\psset{lightsrc=10 0 10,viewpoint=50 20 30 rtp2xyz,Decran=50}
\begin{pspicture}(-9,-5)(9,7)
\psframe(-9,-5)(9,7)
\multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
    \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
    \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
    }%
\pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)(P3)(p3)(P4)(p4)(P5)(p5)
\defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
\defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
\psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=1,fillcolor=red!50,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      num=0 1 2 3,
      show=0 1 2 3,
      ngrid=2](0,0,0)
\axesIIID(5,5,0)(6,6,6)
\end{pspicture}
\end{center}
\begin{verbatim}
\begin{pspicture}(-9,-5)(9,7)
\psframe(-9,-5)(9,7)
\multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
    \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
    \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
    }%
\pspolygon[fillstyle=solid,fillcolor=blue!50]
          (P0)(p0)(P1)(p1)(P2)(p2)(P3)(p3)(P4)(p4)(P5)(p5)
\defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
\defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
\psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=1,fillcolor=red!50,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      num=0 1 2 3, show=0 1 2 3, ngrid=2](0,0,0)
\axesIIID(5,5,0)(6,6,6)
\end{pspicture}
\end{verbatim}


\subsection{Un paravent étoilé : version 2}

Le fond du récipient est défini par l'objet \texttt{face} avec l'option
\texttt{biface}~: 
\begin{center}
\psset{unit=0.55}
\psset{lightsrc=10 0 10,viewpoint=50 -20 20 rtp2xyz,Decran=50}
\begin{pspicture}(-9,-4)(9,7)
\psframe(-9,-4)(9,7)
\defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
\defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
\psSolid[object=face,fillcolor=blue!50,
      biface,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      ](0,0,0)
\psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=1,fillcolor=red!50,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      ngrid=2](0,0,0)
\axesIIID(5,5,0)(6,6,6)
\end{pspicture}
\end{center}
\begin{verbatim}
\psset{lightsrc=10 0 10,viewpoint=50 -20 20 rtp2xyz,Decran=50}
\begin{pspicture}(-9,-4)(9,7)
\psframe(-9,-4)(9,7)
\defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
\defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
\psSolid[object=face,fillcolor=blue!50,
      biface,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      ](0,0,0)
\psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
\psSolid[object=ruban,h=1,fillcolor=red!50,
      base=0 72 360 {/Angle exch def Angle F Angle G} for,
      ngrid=2](0,0,0)
\axesIIID(5,5,0)(6,6,6)
\end{pspicture}
\end{verbatim}