3 currentprojection=orthographic(-1,1,1);
8 // orthonormal coordinates
9 draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
10 draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
11 draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
13 void diffractometer(real tth, real omega, real chi, real phi)
16 real detector_arm_support_radius= 2*10;
17 real detector_arm_length = 3*10;
18 real diffractometer_support_radius = 1.5*10;
21 draw(tpp(hight, diffractometer_support_radius), gray);
24 draw(support_e4cv(hight, detector_arm_support_radius, diffractometer_support_radius), gray);
27 draw(rotate(-tth, Y) * detector_arm(detector_arm_length, detector_arm_support_radius, 1), red);
30 draw(rotate(-omega, Y) * chi_circle(diffractometer_support_radius, 1), cyan);
31 draw(rotate(-omega, Y) * rotate(chi, X) * rotate(-phi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
34 diffractometer(0, 0, 0, 0);