Metapost Sandbox
Debug
save
Save
play_arrow
Run
download
Export
share
Share
Link to share
Embed
person
Login using Github
My work
New...
Log out
Documentation
About
input plain_ex; input mpcolornames; beginfig(0); p:=0; thick:= 20; thin:= thick*0.5; vardef thick_nib = fix_nib(thick, thick, 0) enddef; vardef thin_nib = fix_nib(thin, thin, 0) enddef; path paths[], strokes[]; m:=100; clearxy; z5=(x0+m/4,0); z0 = (0, 1/4m); z1 = (x0, 3/4m); z2 = (x0+m/4, m); z3 = (x2+m/4, y1); z4 = (x3, y0); paths[p] = z5--z0---z1..z2--z3---z4; pen_stroke( nib(thin_nib)(1,2,4,5) nib(thin_nib)(0,3) )(paths[p])(strokes[p]); clearxy; p:=p+1; z0 = (xpart point infinity of paths[0], 0); z1 = (x0, 3/4m); z2 = (x0+m/6, m); z3 = (x2+m/4, y1); z4 = (x3, 1/4m); z5 = (x4+m/4, 0); z6 = (x5+m/6, y4); z7 = (x6, y1); z8 = (x6-m/4, y2); paths[p] = z0---z1..z2--z3---z4--z5..z6---z7--z8; pen_stroke( nib(thin_nib)(0,1,2, 3,4,5,6,7,8) )(paths[p])(strokes[p]); for i=0 upto 10: if known strokes[i]: fill strokes[i] withcolor Salmon; draw paths[i] withcolor Aqua; for k=0 upto length(strokes[i]): draw point k of strokes[i] withpen pencircle scaled 1 withcolor RoyalBlue; endfor; fi; endfor; endfig; end