1 #
include "colors.inc" // The include files contain
2 #
include "textures.inc" // pre-defined scene elements
10 // les vecteurs du cristal
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
}
27 location camera_location
28 look_at camera_look_at
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
)
60 #local dx
=Alpha
*rayon
;
61 #local dz
=rayon
*sqrt(Alpha
*(2-Alpha
));
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
}
71 arrow_circular
(x,.8*dz
,.05, 0,90,sens
,couleur
)
72 translate (-rayon
+dx
+.1)*x
78 #macro bras_detecteur
(longueur
,rayon
, sens
, couleur
)
80 #local dx
=Alpha
*rayon
;
81 #local dz
=rayon
*sqrt(Alpha
*(2-Alpha
));
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
}
88 arrow_circular
(x,.9*dz
,.05, 0, 90,sens
,couleur
)
89 translate <-rayon
+dx
+.2,0,0>
92 pigment{color couleur
}
96 #macro cercle_chi
(rayon
, sens
, couleur
)
98 #local dx
= Alpha
* rayon
;
99 #local dz
= rayon
* sqrt(Alpha
*(2-Alpha
));
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)}
108 arrow_circular
(z,.7*(rayon
-dx
-.1),.05, 10, 280,sens
,couleur
)
114 #macro porte_echantillon
(rayon
, sens
, couleur
)
116 #local dx
= Alpha
* rayon
;
117 #local dz
= rayon
* sqrt(Alpha
*(2-Alpha
));
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.
>}
123 arrow_circular
(x,.3*dz
,.05, 0, 90,sens
,couleur
)
124 translate (-.8*(rayon
-dx
-.1)+.1)*x
127 pigment{color couleur
}
131 #macro diffractometre
(Two_Theta
, Omega
, Chi
, Phi
, sens
)
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.
142 #local vchi
= vaxis_rotate(z, vomega
, Omega
);
143 #local vphi
= vaxis_rotate(vaxis_rotate(x, vomega
, Omega
), vchi
, Chi
);
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}
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
164 diffractometre
(0,0,0,0, 1)