Debian Codegraph @

texmf-dist/doc/metapost/featpost/example/newexperimental.mp

raw
1 % newexperimental.mp
2 % L. Nobre G.
3 % 2004
4
5 input featpost3Dplus2D;
6
7 %verbatimtex
8 %\documentclass{article}
9 %\usepackage{beton}
10 %\usepackage{concmath}
11 %\usepackage{ccfonts}
12 %\begin{document}
13 %etex
14
15 verbatimtex
16 \documentclass{article}
17 \usepackage{palatino}
18 \begin{document}
19 etex
20
21 f := (4.5,-6,5);
22 %f := (-4.5,-6,5);
23
24 beginfig(1);
25 numeric len[], ray[];
26 color axe[], pos[], fix[], lab[];
27 color reflabpos, reflabpoi, lincolor;
28 picture txt[], dashpatt;
29 numeric inclang, aberang, sampang, stepang;
30 numeric squside, sqlevel, ul, outermagpos;
31 numeric innerray, polesep, fracone, fracsam;
32 numeric labelscale;
33 path tmpath, aupath, copath;
34
35 pickup pencircle scaled 1.2pt;
36 dashpatt = evenly scaled 3;
37 inclang = 150;
38 aberang = 17;
39 sampang = 30;
40 stepang = 20;
41 ul = 0.1;
42 labelscale = 5;
43 outermagpos = 30ul;
44 squside = outermagpos;
45 sqlevel = -20ul;
46 polesep = 15ul;
47 fracone = 0.33;
48 fracsam = 0.86;
49 ray1 = 10ul;
50 ray2 = 6ul;
51 ray3 = 8ul;
52 ray4 = 1.5ul;
53 ray5 = 4ul;
54 ray6 = 3ul;
55 ray7 = 3.5ul;
56 ray8 = 2ul;
57 len3 = 7ul;
58 len4 = 20ul;
59 len5 = 3ul;
60 len7 = 3.5ul;
61 len8 = 7ul;
62 lincolor = 0.5background;
63
64 reflabpos = ( -squside, 0, -sqlevel );
65 reflabpoi = ( -squside, squside, -sqlevel );
66 V1 := (squside,squside,-sqlevel);
67 V2 := (-squside,squside,-sqlevel);
68 V3 := (-squside,-squside,-sqlevel);
69 V4 := (squside,-squside,-sqlevel);
70 % makeface1(1,2,3,4);
71 % draw_all_test( false );
72
73 len1 = (1-fracone)*(outermagpos-ray5-polesep);
74 pos1 = (-outermagpos,0,0);
75 len2 = fracone*(outermagpos-ray5-polesep);
76 pos2 = (len1-outermagpos,0,0);
77 lab2 = reflabpos;
78 txt2 = thelabel.top( btex magnet etex scaled labelscale, rp( lab2 ) );
79 fix2 = (-outermagpos+0.5len1,0,ray1);
80 axe3 = ( 0, cosd( inclang ), sind( inclang ) );
81 pos3 = -( len3 + len4 + len5 )*axe3;
82 lab3 = (1-fracone)*reflabpoi+fracone*V1;
83 txt3 = thelabel.rt( btex rotor etex scaled labelscale, rp( lab3 ) );
84 axe4 = axe3;
85 pos4 = -( len4 + len5 )*axe4;
86 fix3 = pos4+fracsam*ray3*(0,cosd( inclang -90 ),sind( inclang -90 ));
87 axe5 = axe3;
88 pos5 = -( len5 )*axe5;
89 lab5 = (1-fracone)*reflabpoi+fracone*V2;
90 txt5 = thelabel.rt( btex sample etex scaled labelscale, rp(lab5) );
91 fix5 = fracsam*ray5*(0,cosd( inclang -90 ),sind( inclang -90 ));
92
93 V5 := fracsam*ray5*( sind( sampang ),
94 cosd( sampang )*cosd( inclang -90 ),
95 cosd( sampang )*sind( inclang -90 ) );
96 V6 := fracsam*ray5*( -sind( sampang ),
97 cosd( sampang )*cosd( inclang -90 ),
98 cosd( sampang )*sind( inclang -90 ) );
99 V8 := fracsam*ray5*( sind( sampang ),
100 -cosd( sampang )*cosd( inclang -90 ),
101 -cosd( sampang )*sind( inclang -90 ) );
102 V7 := fracsam*ray5*( -sind( sampang ),
103 -cosd( sampang )*cosd( inclang -90 ),
104 -cosd( sampang )*sind( inclang -90 ) );
105 axe6 = ( 0, cosd( inclang+aberang ), sind( inclang+aberang ) );
106 pos6 = ray1*axe6;
107 len6 = len4;
108 axe7 = ( 0, cosd( inclang-aberang ), sind( inclang-aberang ) );
109 pos7 = ( ray1 + 0.5len6 )*axe7;
110 lab6 = fracone*reflabpos+(1-fracone)*V3;
111 txt6=thelabel.lft(btex camera etex scaled labelscale,rp(lab6));
112 fix6 = pos6+len6*axe6;
113 pos8 = pos7+len7*axe7;
114 axe8 = axe7;
115 lab8 = (1-fracone)*reflabpos+fracone*V3;
116 txt8 = thelabel.lft( btex lamp etex scaled labelscale, rp( lab8 ) );
117 fix8 = pos8+len8*axe8;
118 len9 = len2;
119 pos9 = (ray5+polesep,0,0);
120 ray9 = ray2;
121 ray10 = ray1;
122 pos10 = pos9+len9*(1,0,0);
123 len10 = len1;
124
125 getready( "rigorousdisc( 0, true, pos1, ray1, len1*(1,0,0) )", pos1 );
126 getready( "whatisthis(pos2,ray1*green,ray1*blue,conorm((-ray5-polesep,0,0)-pos2),ray2/ray1)", pos2 );
127 getready( "rigorousdisc( 0, true, pos3, ray3, len3*axe3 )", pos3 );
128 getready( "rigorousdisc( 0, true, pos4, ray4, len4*axe4 )", pos4 );
129 getready( "rigorousdisc( 0, true, pos5, ray5, len5*axe5 )", pos5 );
130 getready( "draw rp(V5)--rp(V6)--rp(V7)--rp(V8)--cycle", black );
131 getready( "draw rp(pos6)--rp((0,0,0))--rp(pos7) dashed dashpatt",0.5*pos6);
132 getready( "rigorousdisc( 0, true, pos6, ray6, len6*axe6 )", pos6 );
133 getready( "whatisthis(pos7,ray7*red,-ray7*ncrossprod(red,axe7),conorm(pos8-pos7),ray8/ray7)", pos7 );
134 getready( "rigorousdisc( 0, true, pos8, ray8, len8*axe8 );", pos8 );
135 getready( "whatisthis(pos9,ray9*green,ray9*blue,conorm(pos10-pos9),ray10/ray9)", pos9 );
136 getready( "rigorousdisc( 0, true, pos10, ray10, len10*(1,0,0) )", pos10 );
137 doitnow;
138 draw llcorner txt2--lrcorner txt2--rp(fix2) withcolor lincolor;
139 draw lrcorner txt3--llcorner txt3--rp(fix3) withcolor lincolor;
140 draw lrcorner txt5--llcorner txt5--rp(fix5) withcolor lincolor;
141 draw llcorner txt6--lrcorner txt6--rp(fix6) withcolor lincolor;
142 draw llcorner txt8--lrcorner txt8--rp(fix8) withcolor lincolor;
143 draw txt2;
144 draw txt3;
145 draw txt5;
146 draw txt6;
147 draw txt8;
148
149 produce_auto_scale;
150 endfig;
151
152 verbatimtex
153 \end{document}
154 etex
155
156 end.