1 \section{Definition of grating}
3 The user can specify the \Index{grating} of the solid with the option
4 \Lkeyword{ngrid} within the command \Lcs{psSolid}.
10 the syntax is \Lkeyword{ngrid}=$n_1$ where $n_1$ represents the number of vertical \Index{gridlines}.
14 \Lkeyval{cylindrecreux},
18 \Lkeyval{troncconecreux},
20 the syntax is \texttt{\Lkeyword{ngrid}=$n_1$~$n_2$} where $n_1$ is an integer greater or equal
21 to 1 ($2$ for \Lkeyval{tore}) representing the number of the vertical gridlines, and $n_2$ is an integer
22 representing the number of divisions on the circle.
26 the syntax is \texttt{\Lkeyword{ngrid}=$n_1$~$n_2$} where $n_1$ is an integer, representing the number of divisions on the vertical axis, and
27 $n_2$ is an integer representing the number of divisions on the circle
32 the syntax is \texttt{\Lkeyword{ngrid}=$n_1$~$n_2$} where $n_1$ and $n_2$
35 Here are some examples:
41 \begin{pspicture}(-7,-7)(7,7)
43 \psset[pst-solides3d]{viewpoint=50 40 20,Decran=50,lightsrc=10 10 10}
44 \psSolid[a=8,object=cube,ngrid=4,fillcolor=yellow]%
45 %\psSolid[a=8,object=cube,linewidth=2pt,action=draw]%
62 %\psline[linestyle=dashed](O)(Ai)
63 %\psline[linestyle=dashed](O)(Aj)
64 %\psline[linestyle=dashed](O)(Ak)
65 \psline[linecolor=green,arrowsize=2mm,arrowinset=0.2]{->}(Aj)(Ay)
66 \psline[linecolor=blue,arrowsize=2mm,arrowinset=0.2]{->}(Ai)(Ax)
67 \psline[linecolor=red,arrowsize=2mm,arrowinset=0.2]{->}(Ak)(Az)
68 \psdot[linecolor=green](Aj)
69 \psdot[linecolor=blue](Ai)
70 \psdot[linecolor=red](Ak)
73 \begin{pspicture}(-7,-7)(7,7)
75 \psset[pst-solides3d]{viewpoint=50 45 10 rtp2xyz,Decran=40,lightsrc=30 45 0}
76 \psSolid[a=8,object=cube,ngrid=3,fcol=\colorfaces,RotY=45,RotX=30,RotZ=20]%
81 For the first example, the grid is fixed to $4\times4$
82 facettes/faces and the command is the following:
84 \psSolid[a=8,object=cube,ngrid=4,fillcolor=yellow]%
86 In the second example, the face grid is set to $3\times3$
87 and the colours of the faces are different.
89 \texttt{arrayjob} to easily save the colours:
96 The list of the colours is given by the command:
99 \multido{\i=0+1}{67}{%
102 \colorfaces\i\space(\cachedata)\space}
105 One sets up:~\Lkeyword{fcol}\verb+=\colorfaces+.
106 The gridded cube now is called with:
108 \psSolid[a=8,object=cube,ngrid=3,%
110 RotY=45,RotX=30,RotZ=20]%
112 The option \Lkeyword{grid} suppresses the drawing of the gridlines.
117 \begin{LTXexample}[width=6cm]
118 \begin{pspicture}(-3,-3)(3,3)
119 \psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
120 \psset{color1=cyan,color2=red}
122 fcol=251 (OliveGreen) 232 (color1) 214 (color2),
129 \begin{LTXexample}[width=6cm]
130 \begin{pspicture}(-3,-3)(3,3)
131 \psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
132 \psset{color1=cyan,color2=red}
135 fcol=0 (OliveGreen) 2 (color1) 3 (color2),
142 \subsection{Cylinders}
144 \begin{LTXexample}[width=6cm]
146 \begin{pspicture}(-3,-4)(3,4)
147 \psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
148 \psset{color1=cyan,color2=red}
150 fcol=0 (OliveGreen) 2 (color1) 3 (color2),
152 object=cylindrecreux,
159 \begin{LTXexample}[width=7cm]
160 \begin{pspicture}(-3,-4)(4,4)
161 \psset{viewpoint=50 50 20 rtp2xyz,Decran=50,lightsrc=viewpoint}
162 \psset{color1=cyan,color2=red}
165 fcol=0 (OliveGreen) 2 (color1) 3 (color2),
178 \begin{LTXexample}[width=6cm]
179 \begin{pspicture}(-3,-2)(3,2)
180 \psset{viewpoint=50 50 30 rtp2xyz,Decran=25,lightsrc=viewpoint}
181 \psSolid[r1=2.5,r0=1.5,
186 \axesIIID(4,4,0)(5,5,4)
190 \begin{LTXexample}[width=6cm]
191 \begin{pspicture}(-3,-2)(3,2)
192 \psset{viewpoint=50 50 30 rtp2xyz,Decran=25,lightsrc=viewpoint}
193 \psSolid[r1=3.5,r0=1,
196 fillcolor=magenta!30,
198 \axesIIID(4.5,4.5,0)(5,5,4)