Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc / par-composervue.tex
1 \section {Composer une vue d'un ensemble d'objets avec \texttt{codejps}}
2
3 Le calcul des parties cachées est effectué par les routines du code
4 \texttt{PostScript} du fichier \texttt{solides.pro}, mais les lignes
5 de code sont ``encapsulées'' dans un environnement \texttt{pspicture}
6 grâce à la commande \verb+\codejps{code ps}+. Cette partie est
7 développée dans le document
8 \texttt{documentation-fusion-jps.tex(pdf)}. En voici un exemple :
9
10 \begin{minipage}{6cm}
11 \setlength{\columnseprule}{1pt}
12 \begin{pspicture}(-3,-4)(3,4)
13 \psset{lightsrc=100 -50 -10,lightintensity=3,viewpoint=200 20 10 rtp2xyz,Decran=20}
14 \psframe(-3,-3)(3,3)
15 {\psset{linewidth=0.5\pslinewidth}
16 \codejps{
17 /Cl {9.02 [18 16] newsphere
18 {-90 0 0 rotateOpoint3d} solidtransform
19 dup (Green) outputcolors} def
20 /Cl1 { Cl {10.25 10.25 10.25 translatepoint3d} solidtransform } def
21 /Cl2 { Cl {10.25 -10.25 10.25 translatepoint3d} solidtransform } def
22 /Cl3 { Cl {-10.25 -10.25 10.25 translatepoint3d} solidtransform } def
23 /Cl4 { Cl {-10.25 10.25 10.25 translatepoint3d} solidtransform } def
24 /Cl5 { Cl {10.25 10.25 -10.25 translatepoint3d} solidtransform } def
25 /Cl6 { Cl {10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
26 /Cl7 { Cl {-10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
27 /Cl8 { Cl {-10.25 10.25 -10.25 translatepoint3d} solidtransform } def
28 /Cs {8.38 [18 16] newsphere
29 dup (White) outputcolors} def
30 %
31 /Cl12{ Cl1 Cl2 solidfuz} def
32 /Cl123{ Cl12 Cl3 solidfuz} def
33 /Cl1234{ Cl123 Cl4 solidfuz} def
34 /Cl12345{ Cl1234 Cl5 solidfuz} def
35 /Cl123456{ Cl12345 Cl6 solidfuz} def
36 /Cl1234567{ Cl123456 Cl7 solidfuz} def
37 /Cl12345678{ Cl1234567 Cl8 solidfuz} def
38 /C_Cs { Cl12345678 Cs solidfuz} def
39 C_Cs drawsolid**}}%
40 %\psSolid[object=cube,a=20.5,action=draw,linestyle=dashed]%
41 \psPoint(0,0,0){P}
42 \psPoint(10.25,10.25,10.25){Cl1}
43 \psPoint(10.25,-10.25,10.25){Cl2}
44 \psPoint(-10.25,-10.25,10.25){Cl3}
45 \psPoint(-10.25,10.25,10.25){Cl4}
46 \psPoint(10.25,10.25,-10.25){Cl5}
47 \psPoint(10.25,-10.25,-10.25){Cl6}
48 \psPoint(-10.25,-10.25,-10.25){Cl7}
49 \psPoint(-10.25,10.25,-10.25){Cl8}
50 \pspolygon[linestyle=dashed](Cl1)(Cl2)(Cl3)(Cl4)
51 \pspolygon[linestyle=dashed](Cl5)(Cl6)(Cl7)(Cl8)
52 \psline[linestyle=dashed](Cl2)(Cl6)
53 \psline[linestyle=dashed](Cl3)(Cl7)
54 \psline[linestyle=dashed](Cl1)(Cl5)
55 \psline[linestyle=dashed](Cl4)(Cl8)
56 \pcline[offset=0.5]{<->}(Cl2)(Cl1)
57 \aput{:U}{a}
58 \pcline[offset=0.5]{<->}(Cl6)(Cl2)
59 \aput{:U}{a}
60 \end{pspicture}
61 \end{minipage}
62 \hfill
63 \begin{minipage}{14cm}
64 \footnotesize
65 \begin{verbatim}
66 \codejps{
67 /Cl {9.02 [12 8] newsphere
68 {-90 0 0 rotateOpoint3d} solidtransform
69 dup (Green) outputcolors} def
70 /Cl1 { Cl {10.25 10.25 10.25 translatepoint3d} solidtransform } def
71 /Cl2 { Cl {10.25 -10.25 10.25 translatepoint3d} solidtransform } def
72 /Cl3 { Cl {-10.25 -10.25 10.25 translatepoint3d} solidtransform } def
73 /Cl4 { Cl {-10.25 10.25 10.25 translatepoint3d} solidtransform } def
74 /Cl5 { Cl {10.25 10.25 -10.25 translatepoint3d} solidtransform } def
75 /Cl6 { Cl {10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
76 /Cl7 { Cl {-10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
77 /Cl8 { Cl {-10.25 10.25 -10.25 translatepoint3d} solidtransform } def
78 /Cs {8.38 [12 8] newsphere
79 dup (White) outputcolors} def
80 /Cl12{ Cl1 Cl2 solidfuz} def
81 /Cl123{ Cl12 Cl3 solidfuz} def
82 /Cl1234{ Cl123 Cl4 solidfuz} def
83 /Cl12345{ Cl1234 Cl5 solidfuz} def
84 /Cl123456{ Cl12345 Cl6 solidfuz} def
85 /Cl1234567{ Cl123456 Cl7 solidfuz} def
86 /Cl12345678{ Cl1234567 Cl8 solidfuz} def
87 /C_Cs { Cl12345678 Cs solidfuz} def
88 C_Cs drawsolid**}
89 \end{verbatim}
90 \end{minipage}
91
92 On définit l'ion chlorure $\mathrm{Cl^-}$ :
93 \begin{verbatim}
94 /Cl {9.02 [12 8] newsphere
95 {-90 0 0 rotateOpoint3d} solidtransform
96 dup (Green) outputcolors} def
97 \end{verbatim}
98 que l'on recopie aux sommets du cube :
99 \begin{verbatim}
100 /Cl1 { Cl {10.25 10.25 10.25 translatepoint3d} solidtransform } def
101 /Cl2 { Cl {10.25 -10.25 10.25 translatepoint3d} solidtransform } def
102 /Cl3 { Cl {-10.25 -10.25 10.25 translatepoint3d} solidtransform } def
103 /Cl4 { Cl {-10.25 10.25 10.25 translatepoint3d} solidtransform } def
104 /Cl5 { Cl {10.25 10.25 -10.25 translatepoint3d} solidtransform } def
105 /Cl6 { Cl {10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
106 /Cl7 { Cl {-10.25 -10.25 -10.25 translatepoint3d} solidtransform } def
107 /Cl8 { Cl {-10.25 10.25 -10.25 translatepoint3d} solidtransform } def
108 \end{verbatim}
109 Puis l'ion césium $\mathrm{Cs^+}$, placé au centre :
110 \begin{verbatim}
111 /Cs {8.38 [12 8] newsphere
112 dup (White) outputcolors} def
113 \end{verbatim}
114 Ensuite on fusionne deux par deux les différentes sphères.

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.