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); path paths[], strokes[]; thick:= 60; thin:= 0.75; xthick:=1.5; vardef pennib = fix_nib(thick, thick*thin, 0) enddef; vardef terminalnib= fix_nib(thick*xthick, thick*thin, 0) enddef; w:=1; m:=500; mw:=m*w; z0 = (x1 + 0.3m, 0); z1 = (0, (y0 + y2)/2); z2 = (x1 + mw/2, y0 + 1.1m); % top z3 = (x2 + mw/4, y0 + m/2); % < z4 = (x3 + 0.25mw, y3-m/4); z5 = (x4 - 0.25mw, y0); z6 = (x5 - mw/3, y5 + m/2.5); z7 = (x6 + mw/2.5, y6 + m/2); % top z8 = (x7 + mw/2, y7-m/2.5); z9 = (x8, y8 - m/3); paths[0] = z0..z1..z2..{left}z3{right}..z4..z5..{up}z6..z7..{down}z8---z9; pen_stroke( cut(terminalnib, rel 90)(0) nib(pennib)(1,2, 3,4, 5,6, 7, 8) cut(pennib, rel 90)(3) cut(pennib, rel 90)(infinity) )(paths[0])(strokes[0]); clearxy; z0 = point infinity of paths[0]; z1 = (x0, ypart point 8 of paths[0]); z2= (x1 + mw/2, y1 + m/2); z3= (x2 + mw/2.5, y1); z4= (x3 - mw/3, y3 - m/2); z5= (x4 - mw/4, y4 + m/3); paths[1] = z0---z1{up}..z2..z3..{left}z4{left}..{dir 80}z5; % Correction to avoid wrong outline delta = thick*0.15; z6 = point 2.8 of paths[1] - (delta, 0); paths[1] := paths[1] .. z6 ; pen_stroke( cut(pennib, rel 90)(0) nib(pennib)(1, 2, 3,4,5) cut(pennib, rel 90)(infinity) )(paths[1])(strokes[1]); 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; fi; endfor; endfig; end