summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc-en/par-affinage_en_corr.tex
blob: 922b7020fc26766f1a334a9ff3a1ac6c5390cf67 (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
\section{Hollowing out a solid's faces}

We call \textit{hollowing by the ratio $k$} an operation, which for a given 
face with the center $G$, executes a dilation on that face with the ratio  
$k$, then divides the original face with using this new face.

For example, a cube with a hollow of its top face with a ratio of $0.8$:

\begin{center}
\psset{unit=0.5}
\psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
\begin{pspicture*}(-4,-4)(4,4)
\psframe(-4,-4)(4,4)
\psSolid[object=cube,
   fillcolor=red,
   affinagerm,
   fcolor=Yellow,
   affinage=0]
\end{pspicture*}
\end{center}

The option \verb+affinage+ allows to hollow a solid's faces either globally or
individually. This option uses the key \verb+affinagecoeff+
(value $0.8$ by default) which indicates the ratio $k$ used for the
hollow ($0<k<1$).
%
\begin{itemize}
 \item \verb+[affinage=all]+ hollows all the faces;
 \item \verb+[affinage=0 1 2 3]+ hollows the faces \texttt{[0,1,2 and 3]};
\end{itemize}

When a face is hollowed out, the default behaviour suppresses the resulting central 
face. However, the option \verb+affinagerm+ allows us to conserve that central face.

When we conserve the centre face, it is---by default---drawn with the same colour 
as the original. The option \verb+fcolor+ permits to specify another colour.

%\newpage
\psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
\begin{LTXexample}[width=6cm]
\psset{unit=0.5}
\begin{pspicture*}(-5,-4)(6,5)
\psSolid[object=cube,
   fillcolor=cyan,
   incolor=red,
   hollow,
   affinage=0]
\end{pspicture*}
\end{LTXexample}
%

\psset{lightsrc=10 0 10,viewpoint=50 -20 30 rtp2xyz,Decran=50}
\begin{LTXexample}[width=6cm]
\psset{unit=0.5}
\begin{pspicture*}(-5,-4)(6,5)
\psSolid[object=cube,
   fillcolor=cyan,
   affinagecoeff=.5,
   affinagerm,
   fcolor=.5 setfillopacity Yellow,
   hollow,
   affinage=all]
\end{pspicture*}
\end{LTXexample} 

\endinput