[hkl] remove a bunch of warning (gcc-6)
[hkl.git] / Documentation / figures / 3S+1D.pov
blob98fededc56427fd3844173fbc6e73d60297fce25
1 #include "colors.inc" // The include files contain
2 #include "textures.inc" // pre-defined scene elements
3 #include "glass.inc"
4 #include "metals.inc"
5 #include "skies.inc"
6 #include "shapes.inc"
7 #include "arrows.inc"
8 #include "bravais.inc"
10 // les vecteurs du cristal
11 #declare a = <1,0,0>;
12 #declare b = <.31,.95,0>;
13 #declare c = <.4,.5,0.76>;
15 #declare camera_location = 5 * (x+y+z);
16 #declare camera_look_at = <0,0,0>;
18 //#declare camera_location = a/2+b/1.5-2*z;
19 //#declare camera_look_at = a/2+b/1.5;
22 background { color DarkGreen }
24 // all setup
25 camera {
26 orthographic
27 location camera_location
28 look_at camera_look_at
31 light_source {
32 <10, 10, 0>
33 color White
34 parallel
35 point_at <0, 0, 0>
36 shadowless
38 light_source {
39 <-10, 10, 10>
40 color White
41 parallel
42 point_at <0, 0, 0>
43 shadowless
45 light_source {
46 <-10, 10, -10>
47 color White
48 parallel
49 point_at <0, 0, 0>
50 shadowless
53 plane { <0,1,0>, -3 pigment {color LightWood*.9} }
54 cylinder{<0,0,-10>,<0,0,10>, .01 pigment {color Grey}}
55 cylinder{<0,-10,0>,<0,10,0>, .01 pigment {color Grey}}
56 cylinder{<-10,0,0>,<10,0,0>, .01 pigment {color Grey}}
58 #macro support(hauteur, rayon, sens, couleur)
59 #local Alpha = .1;
60 #local dx=Alpha*rayon;
61 #local dz=rayon*sqrt(Alpha*(2-Alpha));
62 union{
63 union{
64 cylinder{<0,-hauteur,0>,<0,-hauteur+.5,0>, rayon}
65 box{<-rayon+dx,-hauteur,-dz>,<-rayon+dx+.1,0,+dz>}
66 cylinder{<-rayon+dx,0,0>, <-rayon+dx+.1, 0, 0>, dz}
67 pigment{color couleur}
69 #if (sens != 0)
70 object{
71 arrow_circular(x,.8*dz,.05, 0,90,sens,couleur)
72 translate (-rayon+dx+.1)*x
74 #end
76 #end
78 #macro bras_detecteur(longueur,rayon, sens, couleur)
79 #local Alpha = .1;
80 #local dx=Alpha*rayon;
81 #local dz=rayon*sqrt(Alpha*(2-Alpha));
82 union{
83 box{<-rayon+dx+.1,-dz,dz>,<-rayon+dx+.2,dz,-longueur>}
84 box{<-rayon+dx+.2,-dz,-longueur>,<0,dz,-longueur+.1>}
85 cylinder{<0,0,-longueur>,<0,0,-longueur+.1>,dz}
86 #if (sens != 0)
87 object{
88 arrow_circular(x,.9*dz,.05, 0, 90,sens,couleur)
89 translate <-rayon+dx+.2,0,0>
91 #end
92 pigment{color couleur}
94 #end
96 #macro cercle_chi(rayon, sens, couleur)
97 #local Alpha = .1;
98 #local dx = Alpha * rayon;
99 #local dz = rayon * sqrt(Alpha*(2-Alpha));
100 union{
101 difference{
102 cylinder{<0,0,-dz/2.>, <0,0,dz/2.>, rayon-dx-.1}
103 cylinder{<0,0,-10.>, <0,0,10.>, .9*(rayon-dx-.1)}
104 pigment{color Cyan}
106 #if (sens != 0)
107 object{
108 arrow_circular(z,.7*(rayon-dx-.1),.05, 10, 280,sens,couleur)
110 #end
112 #end
114 #macro porte_echantillon(rayon, sens, couleur)
115 #local Alpha = .1;
116 #local dx = Alpha * rayon;
117 #local dz = rayon * sqrt(Alpha*(2-Alpha));
118 union{
119 cylinder{<-.95*(rayon-dx-.1), 0, 0>, <-.8*(rayon-dx-.1), 0,0>, dz/2.}
120 box{<-.8*(rayon-dx-.1), -dz/2., -dz/2.>, <-.8*(rayon-dx-.1)+.1,dz/2., dz/2.>}
121 #if (sens != 0)
122 object{
123 arrow_circular(x,.3*dz,.05, 0, 90,sens,couleur)
124 translate (-.8*(rayon-dx-.1)+.1)*x
126 #end
127 pigment{color couleur}
129 #end
131 #macro diffractometre(Two_Theta, Omega, Chi, Phi, sens)
132 #local hauteur = 3;
133 #local rayon_support_bras_detecteur = 2;
134 #local longueur_bras_detecteur = 3;
135 #local rayon_support_diffractometre = 1.5;
137 // Axes de rotation du detecteur.
138 #local vtho_theta = x;
140 // Axes de rotations du diffractometre.
141 #local vomega = x;
142 #local vchi = vaxis_rotate(z, vomega, Omega);
143 #local vphi = vaxis_rotate(vaxis_rotate(x, vomega, Omega), vchi, Chi);
146 //Detecteur
147 support(hauteur,rayon_support_bras_detecteur, 0, Blue)
148 object{bras_detecteur(longueur_bras_detecteur,rayon_support_bras_detecteur, 1*sens, Red) rotate Two_Theta*x}
150 //Diffractometre
151 support(hauteur,rayon_support_diffractometre, 1, Blue)
152 object{cercle_chi(rayon_support_diffractometre, 1*sens, Cyan) rotate Omega*x}
153 object{porte_echantillon(rayon_support_diffractometre, 1*sens, Yellow) rotate Phi*x rotate Chi*z rotate Omega*x}
155 // repère SOLEIL-CRISTAL
156 union{
157 arrow(-2*z, Blue)
158 arrow(2*x, Green)
159 arrow(2*y, Red)
160 translate 7*z
162 #end
164 diffractometre(0,0,0,0, 1)