verbatimtex
%&latex
\documentclass{article}
\usepackage[english,frenchb]{babel}
\begin{document}
etex

outputformat := "png";
outputtemplate := "%j-%c.%o";

input 3danim
output_res:=72;
drawing_scale:=1cm;

set_plane_(projection_plane)(point_null,vec_I,vec_K);
new_plane_(horizontal_plane)(point_null,vec_I,vec_J);

numeric u,r,dl,const,tetarot;
u=2;
r=0.25u;
dl=0.5u;
const= 0.866025403;
tetarot=-45;

vardef def_C(expr inst)=
  new_obj_points(inst,27); 
  set_C_points(inst);
enddef;

vardef set_C_points(expr inst)=

set_point(1)(cosd(tetarot)*(r)-sind(tetarot)*(dl),0,sind(tetarot)*(r)+cosd(tetarot)*(dl));
set_point(2)(cosd(tetarot)*(0.5r)-sind(tetarot)*(dl),r*const,sind(tetarot)*(0.5r)+cosd(tetarot)*(dl));
set_point(3)(cosd(tetarot)*(-0.5r)-sind(tetarot)*(dl),r*const,sind(tetarot)*(-0.5r)+cosd(tetarot)*(dl));
set_point(4)(cosd(tetarot)*(-r)-sind(tetarot)*(dl),0,sind(tetarot)*(-r)+cosd(tetarot)*(dl));
set_point(5)(cosd(tetarot)*(-0.5r)-sind(tetarot)*(dl),-r*const,sind(tetarot)*(-0.5r)+cosd(tetarot)*(dl));
set_point(6)(cosd(tetarot)*(0.5r)-sind(tetarot)*(dl),-r*const,sind(tetarot)*(0.5r)+cosd(tetarot)*(dl));

set_point(7)(cosd(tetarot)*(r)-sind(tetarot)*(-dl),0,sind(tetarot)*(r)+cosd(tetarot)*(-dl));
set_point(8)(cosd(tetarot)*(0.5r)-sind(tetarot)*(-dl),r*const,sind(tetarot)*(0.5r)+cosd(tetarot)*(-dl));
set_point(9)(cosd(tetarot)*(-0.5r)-sind(tetarot)*(-dl),r*const,sind(tetarot)*(-0.5r)+cosd(tetarot)*(-dl));
set_point(10)(cosd(tetarot)*(-r)-sind(tetarot)*(-dl),0,sind(tetarot)*(-r)+cosd(tetarot)*(-dl));
set_point(11)(cosd(tetarot)*(-0.5r)-sind(tetarot)*(-dl),-r*const,sind(tetarot)*(-0.5r)+cosd(tetarot)*(-dl));
set_point(12)(cosd(tetarot)*(0.5r)-sind(tetarot)*(-dl),-r*const,sind(tetarot)*(0.5r)+cosd(tetarot)*(-dl));

set_point(13)(0u,0u,0u);
set_point(14)(-3u,0u,0u);
set_point(15)(4u,4u,0u);
set_point(16)(0u,0u,3u);

set_point(17)(cosd(tetarot)*(0)-sind(tetarot)*(3u),0u,sind(tetarot)*(0)+cosd(tetarot)*(3u));
set_point(18)(cosd(tetarot)*(0)-sind(tetarot)*(dl),0u,sind(tetarot)*(0)+cosd(tetarot)*(dl));

set_point(19)(cosd(tetarot)*(0)-sind(30)*(2.5u),0u,sind(tetarot)*(0)+cosd(30)*(2.5u));
set_point(20)(cosd(tetarot)*(0)-sind(130)*(1.9u),0u,sind(tetarot)*(0)+cosd(130)*(1.9u));
set_point(21)(cosd(tetarot)*(0)-sind(-80)*(2u),0u,sind(tetarot)*(0)+cosd(-80)*(2u));

set_point(22)(cosd(-60)*(0)-sind(-60)*(3u),0u,sind(-60)*(0)+cosd(-60)*(3u));

set_point(23)(0u,-0.1u,0.65u);
set_point(24)(0u,-0.8u,0.8u);
set_point(25)(0u,-2u,1.3u);
set_point(26)(0u,1.6u,2.6u);
set_point(27)(0u,-1.5u,1u);

enddef;

vardef draw_C(expr inst)=

draw_line(1,2);
draw_line(2,3);
draw_line(3,4);
draw_line(4,5);
draw_line(5,6);
draw_line(6,1);

draw_line(7,8);
draw_line(8,9);
draw_line(9,10);

drawoptions(dashed evenly);

draw_line(10,11);
draw_line(11,12);
draw_line(12,7);

draw_line(13,18);

drawoptions();

draw_line(1,7);
draw_line(2,8);
draw_line(3,9);
draw_line(4,10);

draw_line(13,14);
draw_line(13,15);
draw_line(13,16);

draw_line(18,17);

draw_arrow(19,13);
draw_line(13,20);
draw_line(13,21);

draw_arrow(13,22);

%drawarrow (0.25z22){dir(60)}..(0.20z19){dir(-40)};
drawarrow (0.35z17){dir(40)}..(0.40z19){dir(-40)};
drawarrow (0.65z16){dir(0)}..(0.75z19){dir(-40)};
drawarrow (0.65z16){dir(180)}..(0.75z22){dir(230)};
drawarrow (0.50z16){dir(180)}..(0.50z17){dir(230)};


label_obj.rt(btex $Y$ etex,14);
label_obj.llft(btex $X$ etex,15);
label_obj.top(btex \begin{tabular}{c p{4.7cm}} 
Zenith \\
Z
\end{tabular} etex,16);

label_obj.top(btex \begin{tabular}{c p{4.7cm}} 
Particle Orientation \\
$Z_s$
\end{tabular} etex,17);

label_obj.top(btex \begin{tabular}{c p{4.7cm}} 
Incident Beam \\
Z' 
\end{tabular}etex,19);

label_obj.ulft(btex Scattered Beam etex,22);

label_obj.rt(btex $Y'$ etex,20);
label_obj.lft(btex $X'$ etex,21);

%label_obj.lft(btex $\pi-\Theta$ etex,23);
label_obj.lft(btex $\alpha'$ etex,24);
label_obj.lft(btex $\theta'$ etex,25);
label_obj.lft(btex $\theta$ etex,26);
label_obj.lft(btex $\alpha$ etex,27);

enddef;

assign_obj("cube","C");
%point_of_view_obj("cube",4,Obs_phi);

oblique_projection(horizontal_plane)(pnt_obj("cube",13),CABINET,45,45);

beginfig(100);

Obs_dist:=2;
draw_obj("cube"); 

endfig;

end.

About / Au sujet de

Ben
Created:
3 avril 2017 21:46:43

Updated:
3 avril 2017 21:46:43

License / Licence

MIT License

Abstract / Résumé