Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / .svn / text-base / par-ruban-en.tex.svn-base
1 \section{\Index{Solid strip}}
2
3 The strip is a folding screen positioned horizontally on the floor. The base of the folding screen is defined in the plane $Oxy$ by the coordinates of its vertices by the parameter \Lkeyword{base}:
4 \begin{verbatim}
5 \psSolid[object=ruban,h=3,base=x1 y1 x2 y2 x3 y3 ...xn yn,ngrid=n](0,0,0)%
6 \end{verbatim}
7
8 \subsection{A simple \Index{folding screen}}
9 \begin{LTXexample}[width=9.5cm]
10 \psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50,unit=0.75}
11 \begin{pspicture}(-5.5,-4.5)(7,5)
12 \psSolid[object=grille,base=-4 6 -4 4,action=draw,linecolor=gray](0,0,0)
13 \psSolid[object=ruban,h=3,fillcolor=red!50,
14       base=0 0 2 2 4 0 6 2,
15       num=0 1 2 3,
16       show=0 1 2 3,
17       ngrid=3
18       ](0,0,0)
19 \axesIIID(0,2,0)(6,6,4.5)
20 \end{pspicture}
21 \end{LTXexample}
22
23
24 \subsection{A sinusoidal folding screen}
25 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=50}
26 \begin{LTXexample}
27 \psset{unit=0.35}
28 \begin{pspicture}(-10,-6)(12,8)
29 \defFunction{F}(t){2 t 4 mul cos mul}{t 20 div}{}
30 \psSolid[object=grille,base=-6 6 -10 10,action=draw,linecolor=gray](0,0,0)
31 \psSolid[object=ruban,h=2,fillcolor=red!50,
32       resolution=72,
33       base=-200 200 {F} CourbeR2+,  %% -200 5 200 {/Angle ED 2 Angle 4 mul cos mul Angle 20 div } for,
34       ngrid=4](0,0,0)
35 \axesIIID(5,10,0)(7,11,6)
36 \end{pspicture}
37 \end{LTXexample}
38
39
40 \subsection{A \Index{corrugated surface}}
41 This is the same object as before with an additional rotation of $90^{\mathrm{o}}$ around $Oy$.
42
43 \psset{lightsrc=10 30 10,viewpoint=50 50 20 rtp2xyz,Decran=30}
44 \begin{LTXexample}
45 \psset{unit=0.4}
46 \begin{pspicture}(-14,-7)(8,5)
47 \defFunction{F}(t){t 4 mul cos}{t 20 div}{}
48 \psSolid[object=grille,base=0 16 -10 10,action=draw,linecolor=gray](0,0,0)
49 \psSolid[object=ruban,h=16,fillcolor=red!50,RotY=90,incolor=green!20,
50       resolution=72,
51       base=-200 200 {F} CourbeR2+,
52       ngrid=16](0,0,1)
53 \axesIIID(16,10,0)(20,12,6)
54 \end{pspicture}
55 \end{LTXexample}
56
57 We can then imagine it to be like a corrugated iron roof of a shed.
58
59
60 \subsection{An asteroidal folding screen: version 1}
61
62 The contour of the folding screen is defined within a loop:
63 \begin{verbatim}
64        base=0 72 360 {/Angle ED 5 Angle cos mul 5 Angle sin mul
65             3 Angle 36 add cos mul 3 Angle 36 add sin mul} for
66 \end{verbatim}
67 the blueish surface on the bottom is defined with the help of a polygon, where the vertices are calculated by the command\\
68 \verb+\psPoint(x,y,z){P}+
69 \begin{verbatim}
70 \multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
71     \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
72     \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
73     }%
74 \pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)
75                                              (P3)(p3)(P4)(p4)(P5)(p5)
76 \end{verbatim}
77
78 \psset{lightsrc=10 0 10,viewpoint=50 20 30 rtp2xyz,Decran=50}
79 \begin{LTXexample}[width=7.5cm]
80 \psset{unit=0.45}
81 \begin{pspicture}(-9,-5)(9,7)
82 \multido{\iA=0+72,\iB=36+72,\i=0+1}{6}{%
83     \psPoint(\iA\space cos 5 mul,\iA\space sin 5 mul,0){P\i}
84     \psPoint(\iB\space cos 3 mul,\iB\space sin 3 mul,0){p\i}
85     }%
86 \pspolygon[fillstyle=solid,fillcolor=blue!50](P0)(p0)(P1)(p1)(P2)(p2)(P3)(p3)(P4)(p4)(P5)(p5)
87 \defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
88 \defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
89 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
90 \psSolid[object=ruban,h=1,fillcolor=red!50,
91       base=0 72 360 {/Angle exch def Angle F Angle G} for,
92       num=0 1 2 3,show=0 1 2 3,ngrid=2](0,0,0)
93 \axesIIID(5,5,0)(6,6,6)
94 \end{pspicture}
95 \end{LTXexample}
96
97
98 \subsection{An asteroidal folding screen: version 2}
99
100 The bottom of the pot is defined by the object \Lkeyword{face} with the option
101 \Lkeyword{biface}:
102
103 \psset{lightsrc=10 0 10,viewpoint=50 -20 20 rtp2xyz,Decran=50}
104 \begin{LTXexample}[width=7.5cm]
105 \psset{unit=0.4}
106 \begin{pspicture}(-9,-4)(9,7)
107 \defFunction{F}(t){t cos 5 mul}{t sin 5 mul}{}
108 \defFunction{G}(t){t 36 add cos 3 mul}{t 36 add sin 3 mul}{}
109 \psSolid[object=face,fillcolor=blue!50,biface,
110       base=0 72 360 {/Angle exch def Angle F Angle G} for,](0,0,0)
111 \psSolid[object=grille,base=-6 6 -6 6,action=draw,linecolor=gray](0,0,0)
112 \psSolid[object=ruban,h=1,fillcolor=red!50,
113       base=0 72 360 {/Angle exch def Angle F Angle G} for,
114       ngrid=2](0,0,0)
115 \axesIIID(5,5,0)(6,6,6)
116 \end{pspicture}
117 \end{LTXexample}
118
119
120 \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.