Skip to content

Instantly share code, notes, and snippets.

@santhoshtr
Created February 13, 2026 10:04
Show Gist options
  • Select an option

  • Save santhoshtr/993a2b404d92f117029d0e2e2344bd6b to your computer and use it in GitHub Desktop.

Select an option

Save santhoshtr/993a2b404d92f117029d0e2e2344bd6b to your computer and use it in GitHub Desktop.
The Anatomy of a Smilie #metapost-sandbox
beginfig(0);
radius := 50;
pickup pencircle scaled 2;
path p;
path s, second;
z0 = (0, radius);
z1=((x0+x2)/2,y0+radius);
z2 = (x1+radius,y0);
z3 = (x1,y0-radius);
p := z0..z1..z2..z3..cycle;
fill p withcolor 0.5blue;
draw p withcolor white;
clearxy;
z0 = (xpart point 0.5 of p, 0.5radius);
z1 = (xpart point 1.5 of p, y0);
s:=z0{dir +45}..{dir -45}z1;
draw s withcolor white;
second:=s scaled 0.5 shifted (0,20) rotated 90;
draw second withcolor white;
endfig;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment