1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
% cubicstructures.mp
% L. Nobre G.
% 2011
input featpost3Dplus2D;
prologues := 1;
f := 2*(5,3,3.5);
Spread := 20;
beginfig(1);
numeric csr, ind;
color xv, yv, zv, Ve[];
path p[];
csr := sqrt(3)*0.5;
xv := (csr,0,0);
yv := (0,csr,0);
zv := (0,0,csr);
Ve1 := (-1,-1,-1);
Ve2 := (-1,1,-1);
Ve3 := (1,-1,-1);
Ve4 := (1,1,-1);
Ve5 := (-1,-1,1);
Ve6 := (-1,1,1);
Ve7 := (1,-1,1);
Ve8 := (1,1,1);
Ve9 := (0,0,0);
for ind=1 upto 9:
p[ind] := rigorousfearpath( Ve[ind], csr );
endfor;
unfill p1;
draw p1;
draw rp(Ve1+yv)--rp(Ve2-yv);
draw rp(Ve1+xv)--rp(Ve3-xv);
unfill p2;
draw p2;
draw rp(Ve1+zv)--rp(Ve5-zv);
unfill p5;
draw p5;
draw rp(Ve5+yv)--rp(Ve6-yv);
draw rp(Ve5+xv)--rp(Ve7-xv);
unfill p9;
draw p9;
unfill p3;
draw p3;
draw rp(Ve4-yv)--rp(Ve3+yv);
draw rp(Ve4-xv)--rp(Ve2+xv);
unfill p4;
draw p4;
draw rp(Ve2+zv)--rp(Ve6-zv);
draw rp(Ve3+zv)--rp(Ve7-zv);
draw rp(Ve4+zv)--rp(Ve8-zv);
unfill p6;
draw p6;
unfill p7;
draw p7;
draw rp(Ve8-yv)--rp(Ve7+yv);
draw rp(Ve8-xv)--rp(Ve6+xv);
unfill p8;
draw p8;
endfig;
beginfig(2);
numeric csr, ind;
color xv, yv, zv, Ve[];
path p[];
csr := 1;
xv := (csr,0,0);
yv := (0,csr,0);
zv := (0,0,csr);
Ve1 := (-1,-1,-1);
Ve2 := (-1,1,-1);
Ve3 := (1,-1,-1);
Ve4 := (1,1,-1);
Ve5 := (-1,-1,1);
Ve6 := (-1,1,1);
Ve7 := (1,-1,1);
Ve8 := (1,1,1);
for ind=1 upto 8:
p[ind] := rigorousfearpath( Ve[ind], csr );
endfor;
unfill p1;
draw p1;
draw rp(Ve1+yv)--rp(Ve2-yv);
draw rp(Ve1+xv)--rp(Ve3-xv);
unfill p2;
draw p2;
draw rp(Ve1+zv)--rp(Ve5-zv);
unfill p5;
draw p5;
draw rp(Ve5+yv)--rp(Ve6-yv);
draw rp(Ve5+xv)--rp(Ve7-xv);
unfill p3;
draw p3;
draw rp(Ve4-yv)--rp(Ve3+yv);
draw rp(Ve4-xv)--rp(Ve2+xv);
unfill p4;
draw p4;
draw rp(Ve2+zv)--rp(Ve6-zv);
draw rp(Ve3+zv)--rp(Ve7-zv);
draw rp(Ve4+zv)--rp(Ve8-zv);
unfill p6;
draw p6;
unfill p7;
draw p7;
draw rp(Ve8-yv)--rp(Ve7+yv);
draw rp(Ve8-xv)--rp(Ve6+xv);
unfill p8;
draw p8;
endfig;
beginfig(3);
numeric csr, ind;
color xv, yv, zv, Ve[];
path p[];
csr := sqrt(2)*0.5;
xv := (csr,0,0);
yv := (0,csr,0);
zv := (0,0,csr);
Ve1 := (-1,-1,-1);
Ve2 := (-1,1,-1);
Ve3 := (1,-1,-1);
Ve4 := (1,1,-1);
Ve5 := (-1,-1,1);
Ve6 := (-1,1,1);
Ve7 := (1,-1,1);
Ve8 := (1,1,1);
Ve9 := (-1,0,0);
Ve10 := (0,0,-1);
Ve11 := (0,0,1);
Ve12 := (0,1,0);
Ve13 := (0,-1,0);
Ve14 := (1,0,0);
for ind=1 upto 14:
p[ind] := rigorousfearpath( Ve[ind], csr );
endfor;
unfill p1;
draw p1;
draw rp(Ve1+yv)--rp(Ve2-yv);
draw rp(Ve1+xv)--rp(Ve3-xv);
unfill p2;
draw p2;
draw rp(Ve1+zv)--rp(Ve5-zv);
unfill p9;
draw p9;
unfill p5;
draw p5;
draw rp(Ve2+zv)--rp(Ve6-zv);
draw rp(Ve5+yv)--rp(Ve6-yv);
unfill p6;
draw p6;
unfill p10;
draw p10;
draw rp(Ve5+xv)--rp(Ve7-xv);
unfill p13;
draw p13;
unfill p3;
draw p3;
draw rp(Ve4-yv)--rp(Ve3+yv);
draw rp(Ve4-xv)--rp(Ve2+xv);
unfill p4;
draw p4;
unfill p11;
draw p11;
draw rp(Ve3+zv)--rp(Ve7-zv);
unfill p12;
draw p12;
unfill p14;
draw p14;
unfill p7;
draw p7;
draw rp(Ve8-yv)--rp(Ve7+yv);
draw rp(Ve8-xv)--rp(Ve6+xv);
draw rp(Ve4+zv)--rp(Ve8-zv);
unfill p8;
draw p8;
endfig;
beginfig(4);
numeric csr, ind;
color xv, yv, zv, Ve[];
path p[];
csr := 0.21;
xv := (csr,0,0);
yv := (0,csr,0);
zv := (0,0,csr);
Ve1 := (-1,-1,-1);
Ve2 := (-1,1,-1);
Ve3 := (1,-1,-1);
Ve4 := (1,1,-1);
Ve5 := (-1,-1,1);
Ve6 := (-1,1,1);
Ve7 := (1,-1,1);
Ve8 := (1,1,1);
Ve21:= (0,0,0);
Ve9 := (-1,-0.5,0); Ve15 := (-1,0.5,0);
Ve10 := (-0.5,0,-1);Ve16 := (0.5,0,-1);
Ve11 := (-0.5,0,1); Ve17 := (0.5,0,1);
Ve12 := (0,1,-0.5); Ve18 := (0,1,0.5);
Ve13 := (0,-1,-0.5);Ve19 := (0,-1,0.5);
Ve14 := (1,-0.5,0); Ve20 := (1,0.5,0);
for ind=1 upto 21:
p[ind] := rigorousfearpath( Ve[ind], csr );
endfor;
unfill p1;
draw p1;
draw rp(Ve1+yv)--rp(Ve2-yv);
draw rp(Ve1+xv)--rp(Ve3-xv);
unfill p2;
draw p2;
draw rp(Ve1+zv)--rp(Ve5-zv);
unfill p9;
draw p9;
draw rp(Ve9+yv)--rp(Ve15-yv);
unfill p15;
draw p15;
unfill p5;
draw p5;
draw rp(Ve2+zv)--rp(Ve6-zv);
draw rp(Ve5+yv)--rp(Ve6-yv);
unfill p6;
draw p6;
unfill p10;
draw p10;
draw rp(Ve10+xv)--rp(Ve16-xv);
unfill p16;
draw p16;
draw rp(Ve5+xv)--rp(Ve7-xv);
unfill p13;
draw p13;
draw rp(Ve13+zv)--rp(Ve19-zv);
unfill p19;
draw p19;
unfill p21;
draw p21;
unfill p3;
draw p3;
draw rp(Ve4-yv)--rp(Ve3+yv);
draw rp(Ve4-xv)--rp(Ve2+xv);
unfill p4;
draw p4;
unfill p11;
draw p11;
draw rp(Ve11+xv)--rp(Ve17-xv);
unfill p17;
draw p17;
draw rp(Ve3+zv)--rp(Ve7-zv);
unfill p12;
draw p12;
draw rp(Ve12+zv)--rp(Ve18-zv);
unfill p18;
draw p18;
unfill p14;
draw p14;
draw rp(Ve14+yv)--rp(Ve20-yv);
unfill p20;
draw p20;
unfill p7;
draw p7;
draw rp(Ve8-yv)--rp(Ve7+yv);
draw rp(Ve8-xv)--rp(Ve6+xv);
draw rp(Ve4+zv)--rp(Ve8-zv);
unfill p8;
draw p8;
endfig;
beginfig(5);
color Ve[], violet, va, vb, vc, vu;
numeric i, j, k, e[]p[];
string comm, comn, como, a, b, col[];
violet = red+blue;
col1 = "violet";
col2 = "red";
col3 = "green";
col4 = "blue";
Ve1 = (2,1,-1);
Ve2 = (0,1,-1);
Ve3 = (-2,1,-1);
Ve4 = (-2,-1,-1);
Ve5 = (0,-1,-1);
Ve6 = (2,-1,-1);
Ve7 = (1,1,0);
Ve8 = (-1,1,0);
Ve9 = (-2,0,0);
Ve10 = (-1,-1,0);
Ve11 = (1,-1,0);
Ve12 = (2,0,0);
Ve13 = (2,1,1);
Ve14 = (0,1,1);
Ve15 = (-2,1,1);
Ve16 = (-2,-1,1);
Ve17 = (0,-1,1);
Ve18 = (2,-1,1);
Ve19 = (1,0,1);
Ve20 = (0,0,0);
Ve21 = (-1,0,1);
Ve22 = (1,0,-1);
Ve23 = (-1,0,-1);
for i=1 upto 23:
comm := "unfill rigorousfearpath(" & cstr(Ve[i]) & ",0.08);";
comn := "draw rigorousfearpath(" & cstr(Ve[i]) & ",0.08);";
getready( comm & comn, Ve[i] );
endfor;
e1p1 = 1; e2p1 = 2; e3p1 = 3; e4p1 = 4; e5p1 = 5; e6p1 = 6;
e1p2 = 2; e2p2 = 3; e3p2 = 4; e4p2 = 5; e5p2 = 6; e6p2 = 1;
e7p1 = 13; e8p1 = 14; e9p1 = 15; e10p1 = 16; e11p1 = 17; e12p1 = 18;
e7p2 = 14; e8p2 = 15; e9p2 = 16; e10p2 = 17; e11p2 = 18; e12p2 = 13;
e13p1 = 1; e14p1 = 2; e15p1 = 3; e16p1 = 4; e17p1 = 5; e18p1 = 6;
e13p2 = 13; e14p2 = 14; e15p2 = 15; e16p2 = 16; e17p2 = 17; e18p2 = 18;
e19p1 = 2; e19p2 = 5; e20p1 = 14; e20p2 = 17;
e101p1 = 22; e201p1 = 10; e301p1 = 5; e401p1 = 5;
e101p2 = 2; e201p2 = 17; e301p2 = 23; e401p2 = 22;
e102p1 = 2; e202p1 = 17; e302p1 = 23; e402p1 = 22;
e102p2 = 8; e202p2 = 19; e302p2 = 8; e402p2 = 7;
e103p1 = 8; e203p1 = 19; e303p1 = 8; e403p1 = 7;
e103p2 = 21; e203p2 = 7; e303p2 = 14; e403p2 = 14;
e104p1 = 21; e204p1 = 7; e304p1 = 14; e404p1 = 14;
e104p2 = 17; e204p2 = 2; e304p2 = 19; e404p2 = 21;
e105p1 = 17; e205p1 = 2; e305p1 = 19; e405p1 = 21;
e105p2 = 11; e205p2 = 23; e305p2 = 11; e405p2 = 10;
e106p1 = 11; e206p1 = 23; e306p1 = 11; e406p1 = 10;
e106p2 = 22; e206p2 = 10; e306p2 = 5; e406p2 = 5;
for i=1 upto 20:
vc := Ve[e[i]p2]-Ve[e[i]p1];
vu := N(vc);
va := Ve[e[i]p1]+0.2*vu;
vb := Ve[e[i]p2]-0.2*vu;
a := cstr( va );
b := cstr( vb-va );
comm := "rigorousdisc( 0, true," & a & ",0.08," & b & ");";
getready( comm, 0.5[va,vb] );
endfor;
for j=1 upto 4:
for i=1 upto 6:
k := 100*j+i;
vc := Ve[e[k]p2]-Ve[e[k]p1];
vu := N(vc);
va := Ve[e[k]p1]+0.2*vu;
vb := Ve[e[k]p2]-0.2*vu;
a := cstr( va );
b := cstr( vb-va );
comm := "rigorousdisc( 0, true," & a & ",0.08," & b & ");";
comn := "drawoptions( withcolor " & col[j] & " );";
como := "drawoptions();";
getready( comn & comm & como, 0.5[va,vb] );
endfor;
endfor;
doitnow;
endfig;
Nobjects := 0;
beginfig(6);
numeric i, j, k, c, Mx, My, Mz, is;
string comm, comn, this;
boolean jisodd, kisodd;
color there, ref, aux, Ve[];
path pa, pb, pc, pd;
Mx = 3;
My = 3;
Mz = 3;
kisodd = false;
c = 0.5*sqrt(2);
ref = -0.5*c*(Mx,My,Mz);
aux = ref-0.5*(1,1,1);
Ve0 = aux;
Ve1 = (-X(aux),Y(aux),Z(aux));
Ve2 = (X(aux),-Y(aux),Z(aux));
Ve3 = (X(aux),Y(aux),-Z(aux));
Ve4 = (X(aux),-Y(aux),-Z(aux));
Ve5 = (-X(aux),Y(aux),-Z(aux));
Ve6 = (-X(aux),-Y(aux),Z(aux));
Ve7 = (-X(aux),-Y(aux),-Z(aux));
pa = rp(Ve0)--rp(Ve1)--rp(Ve6)--rp(Ve2)--cycle;
pb = rp(Ve0)--rp(Ve2)--rp(Ve4)--rp(Ve3)--cycle;
pc = rp(Ve0)--rp(Ve3)--rp(Ve5)--rp(Ve1)--cycle;
pd = rp(Ve7)--rp(Ve4)--rp(Ve2)--rp(Ve6)--cycle;
unfill pa; draw pa;
unfill pb; draw pb;
unfill pc; draw pc;
for k=0 upto Mz:
if kisodd:
jisodd := true;
else:
jisodd := false;
fi;
for j=0 upto My:
if jisodd:
is := 1;
else:
is := 0;
fi;
for i=is step 2 until Mx:
there := c*(i,j,k)+ref;
this := "rigorousfearpath(" & cstr(there);
comm := "unfill " & this & ",0.5);";
comn := "draw " & this & ",0.5);";
getready( comm & comn, there );
endfor;
jisodd := not jisodd;
endfor;
kisodd := not kisodd;
endfor;
doitnow;
unfill pd; draw pd;
endfig;
end;
|