23 |
pair eyeright, eyeleft; |
pair eyeright, eyeleft; |
24 |
eyeright:= (10,0); |
eyeright:= (10,0); |
25 |
eyeleft := (-30, 0); |
eyeleft := (-30, 0); |
26 |
|
pair p[]; |
27 |
|
|
28 |
def basic = |
def basic = |
29 |
addto currentpicture also eye scaled 20 shifted (-10,0); |
addto currentpicture also eye scaled 20 shifted (-10,0); |
39 |
pair v; |
pair v; |
40 |
v := (urcorner(p) - ulcorner(p)); |
v := (urcorner(p) - ulcorner(p)); |
41 |
for i = 0 upto 7: |
for i = 0 upto 7: |
42 |
addto p doublepath fullcircle scaled (abs(v)/8.0) |
addto p |
43 |
|
if i=3: contour else: doublepath fi |
44 |
|
fullcircle scaled (abs(v)/8.0) |
45 |
shifted ((i/7.0)*v + (0,17)) |
shifted ((i/7.0)*v + (0,17)) |
46 |
withpen pencircle scaled .5pt; |
withpen pencircle scaled .5pt; |
47 |
endfor; |
endfor; |
48 |
|
|
49 |
boxit.mem(p); |
boxit.mem(p); |
50 |
|
|
51 |
xpart(mem.c) = xpart(fex.c) = xpart(fv.c) = 0; |
fex.c = eyeright + (70,0); |
52 |
ypart(fex.c) = yoffs; |
|
53 |
ypart(fv.c) = yoffs + ydist; |
xpart(mem.c) = xpart(fex.c) = xpart(fv.c); |
54 |
ypart(mem.c) = yoffs + 2.3 * ydist; |
ypart(fv.c) = ypart(fex.c) + ydist; |
55 |
|
ypart(mem.c) = ypart(fex.c) + 2.3 * ydist; |
56 |
fv.w-fv.e = fex.w-fex.e; |
fv.w-fv.e = fex.w-fex.e; |
57 |
|
|
58 |
fixpos(fex, fv, mem); |
fixpos(fex, fv, mem); |
59 |
fixsize(fex, fv, mem); |
fixsize(fex, fv, mem); |
60 |
|
|
61 |
xpart(ma.c) = 70; |
xpart(ma.c) = xpart(mem.c) + 70; |
62 |
|
|
63 |
ypart(ma.c) = .5[ypart(fv.s), ypart(mem.n)]; |
ypart(ma.c) = .5[ypart(fv.s), ypart(mem.n)]; |
64 |
|
|
71 |
|
|
72 |
drawunboxed(mem); |
drawunboxed(mem); |
73 |
|
|
74 |
drawarrow eyeright{right} .. tension 1 .. fex.n{down}; |
drawarrow eyeright{right} -- fex.w; |
75 |
drawarrow fex.s{down} -- .3[fex.s, fv.n]; |
drawarrow fex.s{down} -- .3[fex.s, fv.n]; |
76 |
|
|
77 |
drawarrow ma.w{left} .. fv.s{up} dashed evenly; |
drawarrow ma.w{left} .. fv.s{up} dashed evenly; |
78 |
drawarrow ma.w{left} .. (mem.n+(0,-5)){down} dashed evenly; |
drawarrow ma.w{left} .. (mem.n+(-5,-4)){down} dashed evenly; |
79 |
|
|
80 |
for i = 1 upto 9: |
for i = 1 upto 9: |
81 |
addto currentpicture doublepath unitsquare shifted (-.5,0) |
addto currentpicture doublepath |
82 |
|
unitsquare shifted (-.5,0) |
83 |
yscaled uniformdeviate(35) |
yscaled uniformdeviate(35) |
84 |
xscaled (abs(fv.w-fv.e)/11) |
xscaled (abs(fv.w-fv.e)/11) |
85 |
shifted ((i/10.0)[fv.ne, fv.nw]) |
shifted ((i/10.0)[fv.ne, fv.nw]) |
87 |
; |
; |
88 |
endfor; |
endfor; |
89 |
|
|
90 |
enddef; |
xo := 50; |
|
|
|
|
beginfig(1); |
|
|
|
|
|
xo = 50; |
|
91 |
|
|
|
pair p[]; |
|
92 |
p[0] := (-130 + xo,20); |
p[0] := (-130 + xo,20); |
93 |
p[1] := (-140 + xo,10); |
p[1] := (-140 + xo,10); |
94 |
p[2] := (-135 + xo,-20); |
p[2] := (-135 + xo,-20); |
101 |
draw p[i] -- eyeleft dashed evenly withpen pencircle scaled .3pt; |
draw p[i] -- eyeleft dashed evenly withpen pencircle scaled .3pt; |
102 |
endfor |
endfor |
103 |
|
|
|
label.bot("Texture", p[2]); |
|
104 |
|
|
105 |
basic; |
enddef; |
106 |
|
|
107 |
|
beginfig(1); |
108 |
|
basic; |
109 |
|
label.bot("Texture", p[2]); |
110 |
|
|
111 |
|
currentpicture := currentpicture shifted (llcorner currentpicture); |
112 |
|
|
113 |
endfig; |
endfig; |
114 |
|
|
116 |
|
|
117 |
basic; |
basic; |
118 |
|
|
119 |
|
path box; |
120 |
|
|
121 |
|
box := bbox(p[0]--p[1]--p[2]--p[3]); |
122 |
|
|
123 |
|
|
124 |
|
ccx = 210; |
125 |
|
ccy = 160; |
126 |
|
cor = 20; |
127 |
|
path csp; |
128 |
|
csp = (-200, 0){up} ... (-200+cor, 150-cor) ... (0, 150){right}; |
129 |
|
csp := (csp & (reverse csp xscaled -1) ..(csp scaled -1) ..(reverse csp yscaled -1)) .. cycle ; |
130 |
|
path cbp; |
131 |
|
cbp = (-ccx,-ccy) -- (-ccx,ccy) -- (ccx, ccy) -- (ccx,-ccy) -- cycle ; |
132 |
|
|
133 |
|
picture screen; |
134 |
|
screen := nullpicture; |
135 |
|
addto screen doublepath csp withpen pencircle scaled 3pt; |
136 |
|
addto screen doublepath cbp withpen pencircle scaled 2pt;; |
137 |
|
|
138 |
|
addto currentpicture also |
139 |
|
screen scaled (abs(ulcorner(box)-llcorner(box)) / 250) shifted (center(box)); |
140 |
|
|
141 |
|
|
142 |
|
circleit.seed("Seed value"); |
143 |
|
boxit.fgen("Feature generation"); |
144 |
|
|
145 |
|
picture p; |
146 |
|
p:= "Objects w/ identity" infont defaultfont; |
147 |
|
pair v; |
148 |
|
v := (urcorner(p) - ulcorner(p)); |
149 |
|
pair tp; |
150 |
|
for i = 0 upto 7: |
151 |
|
addto p if i=3: contour else: doublepath fi fullcircle scaled (abs(v)/8.0) |
152 |
|
shifted ((i/7.0)*v + (0,17)) |
153 |
|
withpen pencircle scaled .5pt; |
154 |
|
endfor; |
155 |
|
|
156 |
|
boxit.obj(p); |
157 |
|
|
158 |
|
fgen.c = seed.c + (0, 40); |
159 |
|
obj.c = seed.c - (0,50); |
160 |
|
fgen.c = center(box) + (-60, -60); |
161 |
|
|
162 |
|
seed.dy = 10; |
163 |
|
|
164 |
|
drawboxed(seed, fgen); |
165 |
|
drawunboxed(obj); |
166 |
|
|
167 |
|
drawarrow (obj.n + (-5,-4)) -- seed.s; |
168 |
|
drawarrow seed.n -- fgen.s; |
169 |
|
drawarrow fgen.n -- (p[2]+(-20,-10)); |
170 |
|
|
171 |
|
currentpicture := currentpicture shifted (llcorner currentpicture); |
172 |
endfig; |
endfig; |
173 |
|
|
174 |
end |
end |