Debian Codegraph @

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

raw
1 % planpht.mp
2 % L. Nobre G.
3 % 2003
4
5 input featpost3Dplus2D;
6
7 % Planification wise 3D figures
8
9 verbatimtex
10 \documentclass{article}
11 \usepackage{beton}
12 \usepackage{concmath}
13 \usepackage{ccfonts}
14 \begin{document}
15 etex
16
17 beginfig(1); % phtpbq
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definition of the 3D-figure
19 V1 := (1,0,0);
20 V2 := (0,1,0);
21 V5 := (0,0,1);
22 V3 := (-1,0,0);
23 V4 := (0,-1,0);
24 makeface1(1,2,3,4);
25 makeface2(1,2,5);
26 makeface3(2,3,5);
27 makeface4(3,4,5);
28 makeface5(4,1,5);
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 f := (3,5,4);
31 Spread := 50;
32 pickup pencircle scaled 1pt;
33 sharpraytrace;
34 endfig;
35
36 beginfig(2); % phtdpbp
37 numeric altura, raio, xp, xs, yp, ys;
38 altura = 0.5257311;
39 raio = 0.8506508;
40 yp = 0.80901699;
41 ys = 0.5;
42 xp = 0.2628655;
43 xs = -0.6881909;
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definition of the 3D-figure
45 V1 := (raio,0,0);
46 V2 := (xp,yp,0);
47 V3 := (xs,ys,0);
48 V4 := (xs,-ys,0);
49 V5 := (xp,-yp,0);
50 V6 := (0,0,altura);
51 V7 := (0,0,-altura);
52 makeface1(1,2,6);
53 makeface2(5,1,6);
54 makeface3(2,3,6);
55 makeface4(3,4,6);
56 makeface5(4,5,6);
57 makeface6(1,2,7);
58 makeface7(5,1,7);
59 makeface8(2,3,7);
60 makeface9(3,4,7);
61 makeface10(4,5,7);
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 f := (3,5,1.8);
64 Spread := 50;
65 pickup pencircle scaled 1pt;
66 sharpraytrace;
67 endfig;
68
69 beginfig(3); % phtcubo eps
70 defaultscale := 1;
71 defaultfont := "ccr10";
72 V1 := (1,1,1);
73 V2 := (-1,1,1);
74 V3 := (-1,-1,1);
75 V4 := (1,-1,1);
76 V5 := (1,1,-1);
77 V6 := (-1,1,-1);
78 V7 := (-1,-1,-1);
79 V8 := (1,-1,-1);
80 makeface1(1,2,3,4);
81 makeface2(5,6,7,8);
82 makeface3(1,2,6,5);
83 makeface4(2,3,7,6);
84 makeface5(3,4,8,7);
85 makeface6(4,1,5,8);
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87 f := (3,5,3);
88 Spread := 50;
89 pickup pencircle scaled 1pt;
90 sharpraytrace;
91 label.lft("A", rp(V8) );
92 label.top("B", rp(V1) );
93 label.top("C", rp(V3) );
94 label.lft("D", rp(V4) );
95 label.rt("E", rp(V2) );
96 label.rt("F", rp(V6) );
97 endfig;
98
99 beginfig(4); % phtptq
100 numeric high, low;
101 high = sqrt(2);
102 low = sqrt(2)-1.6818;
103 V1 := (1,1,high);
104 V2 := (-1,1,high);
105 V3 := (-1,-1,high);
106 V4 := (1,-1,high);
107 V5 := (high,0,low);
108 V6 := (0,high,low);
109 V7 := (-high,0,low);
110 V8 := (0,-high,low);
111 V9 := (0,0,0);
112 makeface1(5,6,7,8);
113 makeface2(6,1,2);
114 makeface3(7,2,3);
115 makeface4(8,3,4);
116 makeface5(5,4,1);
117 makeface6(5,6,1);
118 makeface7(6,7,2);
119 makeface8(7,8,3);
120 makeface9(8,5,4);
121 makeface10(9,1,2);
122 makeface11(9,2,3);
123 makeface12(9,3,4);
124 makeface13(9,4,1);
125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126 f := (2,6,5);
127 Spread := 50;
128 pickup pencircle scaled 1pt;
129 sharpraytrace;
130 endfig;
131
132 beginfig(5); % phtnonrec
133 numeric tro;
134 tro = 2;
135 V1 := (tro,0,0);
136 V2 := (0,tro,0);
137 V3 := (-tro,0,0);
138 V4 := (0,-tro,0);
139 V5 := (1,1,1);
140 V6 := (-1,1,1);
141 V7 := (-1,-1,1);
142 V8 := (1,-1,1);
143 V9 := (1,1,-1);
144 V10 := (-1,1,-1);
145 V11 := (-1,-1,-1);
146 V12 := (1,-1,-1);
147 V13 := (0,0,tro);
148 V14 := (0,0,-tro);
149 makeface1(1,5,13,8);
150 makeface2(2,6,13,5);
151 makeface3(3,7,13,6);
152 makeface4(4,8,13,7);
153 makeface5(1,5,2,9);
154 makeface6(2,6,3,10);
155 makeface7(3,7,4,11);
156 makeface8(4,8,1,12);
157 makeface9(1,9,14,12);
158 makeface10(2,10,14,9);
159 makeface11(3,11,14,10);
160 makeface12(4,12,14,11);
161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162 f := 2*(5,3,1.5);
163 Spread := 50;
164 pickup pencircle scaled 1pt;
165 sharpraytrace;
166 endfig;
167
168 beginfig(6); % pauphtflex eps
169 defaultscale := 1;
170 defaultfont := "ccr10";
171 color A, B, C, D, E, F, G;
172 numeric tro, Adist;
173 tro = sqrt(3)/2;
174 Adist = 0.88854;
175 V1 := (-1.8,0,0);
176 V2 := (-1.8,0.6,1.2*tro);
177 V3 := (1,0.6,1.2*tro);
178 V4 := (1,0,0);
179 V5 := (1,2.5,0);
180 V6 := (-1.8,2.5,0);
181 V7 := (0,0,0);
182 V8 := (0,0.707,0);
183 V9 := (0,0.707/4,0.707*tro/2);
184 V10:= (0.21928,Adist/2,tro*Adist);
185 V11:= (-0.37392,0.39638,0);
186 V12:= (-1.2125,Adist,0);
187 makeface1(1,2,3,4);
188 makeface2(4,5,6,1);
189 makeface3(7,8,9);
190 makeface4(8,9,10);
191 makeface5(8,10,11);
192 makeface6(10,11,12);
193 A = (0,1.3,0);
194 B = (0,1.3+sqrt(0.75),0);
195 C = (-0.5,1.3+sqrt(0.75),0);
196 D = (E+B)/2;
197 E = (sqrt(0.75),1.3,0);
198 F = ((1+sqrt(3))/4,1.3+(1+sqrt(3))/4,0);
199 G = (-1.5,1.3+sqrt(0.75),0);
200 f := 3*(2,5,2);
201 Spread := 100;
202 draw rp(A)--rp(B)--rp(E)--cycle;
203 draw rp(F)--rp(B)--rp(E)--cycle;
204 draw rp(A)--rp(B)--rp(C)--cycle;
205 draw rp(A)--rp(C)--rp(G)--cycle;
206 draw rp(A)--rp(F) dashed evenly;
207 pickup pencircle scaled 1pt;
208 sharpraytrace;
209 draw rp(V7)--rp(V9);
210 draw rp(V10)--rp(V9);
211 draw rp(V12)--rp((-1.2125,0,0)) dashed evenly;
212 label.urt("Adist", rp((V12+(-1.2125,0,0))/2) );
213 label.lft("A", rp(V10) );
214 label.bot("B", rp(V8) );
215 label.bot("B", rp(B) );
216 label.lrt("C", rp(V11) );
217 label.lft("D", rp(V9) );
218 label.bot("D", rp(D) );
219 label.llft("F", rp(V7) );
220 label.bot("F", rp(F) );
221 label.rt("G", rp(V12) );
222 angline(V6, V2, V1, 0.6, btex $\alpha$ etex, rt);
223 angline(V10, 2*V9, V9, 0.7, btex $\theta$ etex, bot);
224 draw rp(V9+N(V10-V9)*0.65)--rp(V9+N(V10-V9)*0.8);
225 draw rp(V9+N(V9)*0.5)--rp(V9+N(V9)*0.8);
226 label.bot(btex $p$ etex, rp((F+B)/2) );
227 label.ulft(btex $q$ etex, rp((D+B)/2) );
228 label.lft(btex $r$ etex, rp((D+A)/2) );
229 label.llft(btex $s$ etex, rp((A+B)/2) );
230 label.llft(btex $t$ etex, rp((A+C)/2) );
231 label.bot(btex $t$ etex, rp((G+C)/2) );
232 label.bot(btex $u$ etex, rp((C+B)/2) );
233 label.top(btex $v$ etex, rp((A+G)/2) );
234 endfig;
235
236 beginfig(7); % pauphttoro eps
237 defaultscale := 1;
238 defaultfont := "ccr10";
239 numeric sinthe, costhe, ux, uz, lx, lz, co;
240 costhe = (4*sqrt(5)-sqrt(3))/11;
241 sinthe = sqrt(1-costhe**2);
242 ux = costhe*sqrt(2)/2;
243 uz = sinthe/2;
244 lx = sqrt(4/3)*sinthe;
245 lz = -sqrt(2/3)*costhe;
246 co = sqrt(2)*(2*sqrt(5)+5*sqrt(3))/22;
247 V1 := (ux,0,-uz);
248 V2 := (lx,0,-lz);
249 V3 := (0,ux,uz);
250 V4 := (0,lx,lz);
251 V5 := (co,co,0);
252 V6 := (-ux,0,-uz);
253 V7 := (-lx,0,-lz);
254 V8 := (-co,co,0);
255 makeface1(1,2,3);
256 makeface2(1,2,5);
257 makeface3(2,3,5);
258 makeface4(3,4,5);
259 makeface5(3,4,1);
260 makeface6(1,4,5);
261 makeface7(3,6,7);
262 makeface8(3,7,8);
263 makeface9(6,7,8);
264 makeface10(3,8,4);
265 makeface11(4,6,8);
266 makeface12(3,4,6);
267 Spread := 100;
268 % f := (1,-0.4,3);
269 f := 2*(2,1,2.8);
270 draw_invisible( false, false, TableC6, black );
271 % cartaxes(0.2,0.2,0.2);
272 draw rp(V2)--rp(V1)--rp(V4) dashed evenly;
273 draw rp(V3)--rp(V1)--rp(V5) dashed evenly;
274 draw rp(V6)--rp(V4) dashed evenly;
275 draw rp(V6)--rp(V8) dashed evenly;
276 % pickup pencircle scaled 1pt;
277 % sharpraytrace;
278 label.rt("A", rp(V5) );
279 label.rt("C", rp(V3+(0,0.05,0)) );
280 label.rt("B", rp(V4) );
281 label.rt("D", rp(V8) );
282 label.lft("E", rp(V2) );
283 label.llft("F", rp(V1) );
284 label.lft("G", rp(V7) );
285 label.lft("H", rp(V6) );
286 endfig;
287
288 verbatimtex \end{document} etex
289
290 end;
291