Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / .svn / text-base / par-affinage-en.tex.svn-base
1 \section{\Index{Hollowing out} a solid's faces}
2
3 We call \textit{hollowing by the ratio $k$} an operation, which for a given
4 face with the center $G$, executes a dilation on that face with the ratio
5 $k$, then divides the original face with using this new face.
6
7 For example, a cube with a hollow of its top face with a ratio of $0.8$:
8
9 \begin{center}
10 \psset{unit=0.5}
11 \psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
12 \begin{pspicture*}(-4,-4)(4,4)
13 %\psframe(-4,-4)(4,4)
14 \psSolid[object=cube,
15    fillcolor=red,
16    affinagerm,
17    fcolor=Yellow,
18    affinage=0]
19 \end{pspicture*}
20 \end{center}
21
22 The option \Lkeyword{affinage} allows us to hollow a solid's faces either globally or
23 individually. This option uses the key \Lkeyword{affinagecoeff}
24 (value $0.8$ by default) which indicates the ratio $k$ used for the
25 hollow ($0<k<1$).
26 %
27 \begin{compactitem}
28  \item \texttt{\Lkeyword{affinage}=\Lkeyval{all}} hollows all the faces;
29  \item \texttt{\Lkeyword{affinage}=0 1 2 3} hollows the faces 0, 1, 2 and 3;
30 \end{compactitem}
31
32 When a face is hollowed out, the default behaviour suppresses the resulting central
33 face. However, the option \Lkeyword{affinagerm} allows us to conserve that central face.
34
35 When we conserve the centre face, it is---by default---drawn with the same colour
36 as the original. The option \Lkeyword{fcolor} permits to specify another colour.
37
38 %\newpage
39 \psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
40 \begin{LTXexample}[width=6cm]
41 \psset{unit=0.5}
42 \begin{pspicture*}(-5,-4)(6,5)
43 \psSolid[object=cube,
44    fillcolor=cyan,
45    incolor=red,
46    hollow,
47    affinage=0]
48 \end{pspicture*}
49 \end{LTXexample}
50 %
51
52 \psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
53 \begin{LTXexample}[width=6cm]
54 \psset{unit=0.5}
55 \begin{pspicture*}(-5,-4)(6,5)
56 \psSolid[object=cube,
57    fillcolor=cyan,
58    affinagecoeff=.5,
59    affinagerm,
60    fcolor=.5 setfillopacity Yellow,
61    hollow,
62    affinage=all]
63 \end{pspicture*}
64 \end{LTXexample}
65
66 \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.