Created
February 13, 2026 10:03
-
-
Save santhoshtr/efd5b5accf61b4eddffbe4a3dbd11440 to your computer and use it in GitHub Desktop.
Display style സ #metapost-sandbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.4m, 0); | |
| z1 = (0, (y0+y2)/2); | |
| z2 = ((x1+x3)/2, m); | |
| z3 = (x1+0.75m, (y2+y4)/2); | |
| z4 = (x3, 0); | |
| paths[p] = z0{left}..{up}z1 ..z2{right}..z3---z4; | |
| pen_stroke( | |
| cut(thin_nib, 90)(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.6m,(y1+y3)/2); | |
| z3=((x2+x4)/2, 0); | |
| z4=(x2+0.6m, y2); | |
| z5=(x2+0.2m, m); | |
| paths[p] = z0{up}..z1{right}..z2{dir 260}..z3{right}..z4{up}..{left}z5; | |
| pen_stroke( | |
| nib(thick_nib)(0,2,4) | |
| nib(thin_nib)(1,3) | |
| cut(thin_nib, 90)(6) | |
| )(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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment