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; % Refer https://in.mirrors.cicku.me/ctan/graphics/metapost/contrib/macros/mpcolornames/doc/metapost/mpcolornames/mpcolornames.pdf % for color names beginfig(0); width:=10; rotation:=45; thick:= 12; thin := thick*0.4; vardef thick_nib = fix_nib(thick, 0, 0) enddef; vardef terminalnib = fix_nib(thick, thick , 0) enddef; path paths[], strokes[]; z0 = (0, 0); z1 = (x0, y0+50); paths[0] = z0--z1; pen_stroke( nib(thick_nib)(0) nib(thick_nib)(1) )(paths[0])(strokes[0]); strokes[0] := subpath(0,1) of strokes[0]{up} .. {dir 45}(point 1 of strokes[0] + (5,15)) -- subpath(2,3) of strokes[0]{dir 270} .. {dir 235}(point 3 of strokes[0] - (5,15) ) -- cycle; fill strokes[0] withcolor blue; draw paths[0] withcolor 0.8white; clearxy; z0 = (xpart point 5 of strokes[0], ypart point 2 of strokes[0]); z1 = (x0+ 40, y0); z2 = (x1 +40, (y1+y3)/2); z3 = (x2 - 50, ypart point 5 of strokes[0]); z4 = (x3, y3+40); z5 = (x4+15, y4+20); z6 = (x4+10, y4); paths[1] = z0---z1{right}..{down}z2{down}..{left}z3---z4{up}..z5{right}..{dir 120}z6; pen_stroke( nib(thick_nib rotated 90)(0) nib(thick_nib rotated 90)(1) nib(thick_nib scaled 0.8)(2) nib(thick_nib scaled 1.5 rotated 45)(3,4) nib(thick_nib scaled 0.8 rotated 90)(5) nib(thick_nib scaled 0.5 rotated 45)(6) )(paths[1])(strokes[1]); clearxy; z0=(xpart point 2 of paths[1], ypart point 0 of paths[1]); z1=z0+(50,0); z2=z1+(0,-50); z3=(x2-20,-10); z4=(x3,45); paths[2] =z0--z1---z2{down}..{left}z3{left}..{dir 60}z4; pen_stroke( cut(thick_nib scaled 1.5 rotated 45, 90)(0) nib(thick_nib scaled 1.5 rotated 45)(1) nib(thick_nib)(2) nib(thick_nib rotated 90)(3) cut(thick_nib scaled 0.75, rel 90)(4) )(paths[2])(strokes[2]); for i=0 upto 10: if known strokes[i]: fill strokes[i] withcolor Teal; draw paths[i] withcolor SkyBlue; fi; endfor; endfig; end