Un montage expérimental
Auteur ou autrice : Luís Nobre Gonçalves.
Mise en ligne le 1 février 2025
Cet exemple illustre l’utilisation du package featpost
présent sur le CTAN. Ce package permet de réaliser des
dessins en trois dimensions (et en deux dimensions). Il est très pratique pour
illustrer de la géométrie basique dans l’espace.
Code
% experimental.mp
% L. Nobre G.
% 2003
input featpost3Dplus2D;
verbatimtex
\documentclass{article}
\usepackage{palatino}
\begin{document}
etex
f := (4.5,-6,5);
beginfig(1);
numeric len[], ray[];
color axe[], pos[], fix[], lab[];
color reflabpos, reflabpoi, lincolor;
picture txt[], dashpatt;
numeric inclang, aberang, sampang, stepang;
numeric squside, sqlevel, ul, outermagpos;
numeric innerray, polesep, fracone, fracsam;
numeric labelscale;
path tmpath, aupath, copath;
pickup pencircle scaled 1.2pt;
dashpatt = evenly scaled 3;
inclang = 150;
aberang = 17;
sampang = 30;
stepang = 20;
ul = 0.1;
labelscale = 5;
outermagpos = 30ul;
squside = outermagpos;
sqlevel = -20ul;
polesep = 15ul;
fracone = 0.33;
fracsam = 0.86;
ray1 = 10ul;
ray2 = 6ul;
ray3 = 8ul;
ray4 = 1.5ul;
ray5 = 4ul;
ray6 = 3ul;
ray7 = 3.5ul;
ray8 = 2ul;
len3 = 7ul;
len4 = 20ul;
len5 = 3ul;
len7 = 3.5ul;
len8 = 7ul;
lincolor = 0.5background;
reflabpos = ( -squside, 0, -sqlevel );
reflabpoi = ( -squside, squside, -sqlevel );
V1 := (squside,squside,sqlevel);
V2 := (-squside,squside,sqlevel);
V3 := (-squside,-squside,sqlevel);
V4 := (squside,-squside,sqlevel);
% makeface1(1,2,3,4);
len1 = (1-fracone)*(outermagpos-ray5-polesep);
pos1 = (-outermagpos,0,0);
rigorousdisc( 0, true, pos1, ray1, len1*(1,0,0) );
len2 = fracone*(outermagpos-ray5-polesep);
pos2 = (len1-outermagpos,0,0);
tmpath := goodcirclepath( pos2, (1,0,0), ray1 );
aupath := goodcirclepath( (-ray5-polesep,0,0), (1,0,0), ray2 );
copath := twocyclestogether( tmpath, aupath );
unfill copath;
draw copath;
draw aupath;
lab2 = reflabpos;
txt2 = thelabel.top( btex magneto etex scaled labelscale, rp( lab2 ) );
draw txt2;
fix2 = (-outermagpos+0.5len1,0,ray1);
draw llcorner txt2--lrcorner txt2--rp(fix2) withcolor lincolor;
axe3 = ( 0, cosd( inclang ), sind( inclang ) );
pos3 = -( len3 + len4 + len5 )*axe3;
rigorousdisc( 0, true, pos3, ray3, len3*axe3 );
lab3 = (1-fracone)*reflabpoi+fracone*V1;
txt3 = thelabel.rt( btex rotor etex scaled labelscale, rp( lab3 ) );
draw txt3;
axe4 = axe3;
pos4 = -( len4 + len5 )*axe4;
rigorousdisc( 0, true, pos4, ray4, len4*axe4 );
fix3 = pos4+fracsam*ray3*(0,cosd( inclang -90 ),sind( inclang -90 ));
draw lrcorner txt3--llcorner txt3--rp(fix3) withcolor lincolor;
axe5 = axe3;
pos5 = -( len5 )*axe5;
rigorousdisc( 0, true, pos5, ray5, len5*axe5 );
lab5 = (1-fracone)*reflabpoi+fracone*V2;
txt5 = thelabel.rt( btex porta-amostras etex scaled labelscale, rp( lab5 ) );
draw txt5;
fix5 = fracsam*ray5*(0,cosd( inclang -90 ),sind( inclang -90 ));
draw lrcorner txt5--llcorner txt5--rp(fix5) withcolor lincolor;
V5 := fracsam*ray5*( sind( sampang ),
cosd( sampang )*cosd( inclang -90 ),
cosd( sampang )*sind( inclang -90 ) );
V6 := fracsam*ray5*( -sind( sampang ),
cosd( sampang )*cosd( inclang -90 ),
cosd( sampang )*sind( inclang -90 ) );
V8 := fracsam*ray5*( sind( sampang ),
-cosd( sampang )*cosd( inclang -90 ),
-cosd( sampang )*sind( inclang -90 ) );
V7 := fracsam*ray5*( -sind( sampang ),
-cosd( sampang )*cosd( inclang -90 ),
-cosd( sampang )*sind( inclang -90 ) );
draw rp(V5)--rp(V6)--rp(V7)--rp(V8)--cycle;
axe6 = ( 0, cosd( inclang+aberang ), sind( inclang+aberang ) );
pos6 = ray1*axe6;
len6 = len4;
axe7 = ( 0, cosd( inclang-aberang ), sind( inclang-aberang ) );
pos7 = ( ray1 + 0.5len6 )*axe7;
draw rp(pos6)--rp((0,0,0))--rp(pos7) dashed dashpatt;
rigorousdisc( 0, true, pos6, ray6, len6*axe6 );
lab6 = fracone*reflabpos+(1-fracone)*V3;
txt6 = thelabel.lft( btex telemicrosc\'{o}pio etex scaled labelscale, rp( lab6 ) );
draw txt6;
fix6 = pos6+len6*axe6;
draw llcorner txt6--lrcorner txt6--rp(fix6) withcolor lincolor;
pos8 = pos7+len7*axe7;
tmpath := goodcirclepath( pos7, axe7, ray7 );
aupath := goodcirclepath( pos8, axe7, ray8 );
copath := twocyclestogether( tmpath, aupath );
unfill copath;
draw copath;
draw aupath;
axe8 = axe7;
rigorousdisc( 0, true, pos8, ray8, len8*axe8 );
lab8 = (1-fracone)*reflabpos+fracone*V3;
txt8 = thelabel.lft( btex l\^{a}mpada etex scaled labelscale, rp( lab8 ) );
draw txt8;
fix8 = pos8+len8*axe8;
draw llcorner txt8--lrcorner txt8--rp(fix8) withcolor lincolor;
len9 = len2;
pos9 = (ray5+polesep,0,0);
ray9 = ray2;
ray10 = ray1;
tmpath := goodcirclepath( pos9, (1,0,0), ray9 );
pos10 = pos9+len9*(1,0,0);
aupath := goodcirclepath( pos10, (1,0,0), ray10 );
copath := twocyclestogether( tmpath, aupath );
unfill copath;
draw copath;
draw aupath;
len10 = len1;
rigorousdisc( 0, true, pos10, ray10, len10*(1,0,0) );
produce_auto_scale;
endfig;
verbatimtex
\end{document}
etex
end.
Mots clés : 3Dfeatpostphysiqueexpérience
Cet exemple fait partie de la collection d’exemples Documentation de featpost.