xxxxxxxxxx
input plain_ex;
input mpcolornames;
beginfig(0);
p:=0;
thick:= 20;
thin:= thick*0.5;
vardef thick_nib = fix_nib(thick, 0, 0) enddef;
vardef thin_nib = fix_nib(0, thin, 0) enddef;
path paths[], strokes[];
m:=100;
z0 = (x1+0.15m, 0);
z1 = (0, (y0+y2)/2);
z2 = ((x1+x3)/2, m);
z3 = (x1+0.5m, (y2+y4)/2);
z4 = (x3, 0);
paths[p] = z0..{up}z1 ..z2{right}..z3---z4;
pen_stroke(
cut(thick_nib, 0)(0)
nib(thick_nib)(1,3,4)
nib(thin_nib)(2)
)(paths[p])(strokes[p]);
clearxy;
p:=p+1;
z0=point 3 of paths[0];
z1=((x0+x2)/2,m);
z2=(x0+0.5m,(y1+y3)/2);
z3=((x2+x4)/2, 0);
z4=(x2+0.5m, y2);
z5=(x4-0.2m, m);
paths[p] = z0{up}..z1{right}..z2{dir 260}..z3{right}..z4{up}..z5;
pen_stroke(
nib(thick_nib)(0,2,4)
nib(thin_nib)(1,3)
cut(thick_nib, 0)(5)
)(paths[p])(strokes[p]);
for i=0 upto 10:
if known strokes[i]:
fill strokes[i] withcolor Teal;
%draw strokes[i] withcolor White;
fi;
if known paths[i]:
draw paths[i] withcolor Gold;
for k=0 upto length(paths[i]):
draw point k of paths[i] withpen pencircle scaled 2 withcolor Gold;
endfor;
fi;
endfor;
endfig;
end
Compiling..