| 1 |
\section{Fusing solids} |
| 2 |
|
| 3 |
It is possible to arrange several solids within the same |
| 4 |
structure: this is done with the operation \Lkeyword{fusion} of |
| 5 |
solids. This technique uses the painting algorithm for the whole |
| 6 |
scene. |
| 7 |
|
| 8 |
To do so, you must activate the option \verb+\psset{solidmemory}+ |
| 9 |
to memorize the structures of the different solids within |
| 10 |
\Lcs{psSolid}, with each of them given a separate name. |
| 11 |
|
| 12 |
You use the object \Lkeyword{fusion} of \Lcs{psSolid}, by indicating in |
| 13 |
the parameter \Lkeyword{base} the list of names of the solids to be |
| 14 |
fused. |
| 15 |
|
| 16 |
To draw the scene, don't forget to conclude the code with |
| 17 |
\verb+\composeSolid+. |
| 18 |
|
| 19 |
\psset{lightsrc=50 -50 50,viewpoint=40 16 32 rtp2xyz,Decran=40} |
| 20 |
\begin{LTXexample}[width=7.5cm] |
| 21 |
\psset{unit=.6} |
| 22 |
\begin{pspicture}(-6,-5)(6,7) |
| 23 |
\psset{solidmemory} |
| 24 |
\psSolid[object=cylindre,h=6,fillcolor=blue, |
| 25 |
r=1.5, |
| 26 |
ngrid=4 16, |
| 27 |
action=none, |
| 28 |
name=A1, |
| 29 |
](0,0,-4) |
| 30 |
\psSolid[object=anneau,h=6,fillcolor=red!50, |
| 31 |
R=4,r=3,h=1, |
| 32 |
action=none, |
| 33 |
name=B1, |
| 34 |
](0,0,-1) |
| 35 |
\psSolid[object=fusion, |
| 36 |
action=draw**, |
| 37 |
base=A1 B1, |
| 38 |
](0,0,0) |
| 39 |
\composeSolid |
| 40 |
\end{pspicture} |
| 41 |
\end{LTXexample} |
| 42 |
|
| 43 |
|
| 44 |
\begin{LTXexample}[width=6.5cm] |
| 45 |
\psset{unit=0.5} |
| 46 |
\begin{pspicture}(-6,-5)(6,5) |
| 47 |
\psset{solidmemory} |
| 48 |
\psset{lightsrc=50 -50 50,viewpoint=100 -30 40, |
| 49 |
Decran=100,linewidth=0.5\pslinewidth, |
| 50 |
ngrid=18 18,fillcolor=white, |
| 51 |
h=12,r=2,RotX=90} |
| 52 |
\psframe*[linecolor=black](-6,-5)(6,5) |
| 53 |
\psSolid[object=cylindrecreux, |
| 54 |
action=none, |
| 55 |
name=cylindre1](0, 6, 0) |
| 56 |
\psSolid[object=cylindrecreux, |
| 57 |
RotZ=90, |
| 58 |
action=none, |
| 59 |
name=cylindre2](-6, 0, 0) |
| 60 |
\psSolid[object=fusion, |
| 61 |
base=cylindre1 cylindre2,RotX=0] |
| 62 |
\composeSolid |
| 63 |
\end{pspicture} |
| 64 |
\end{LTXexample} |
| 65 |
|
| 66 |
\endinput |