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:= 100; thin:= thick*0.5; vardef thick_nib = fix_nib(thick, 0, 0) enddef; vardef thicknib = fix_nib(thick, 0, 0) enddef; vardef thin_nib = fix_nib(0, thin, 0) enddef; path paths[], strokes[]; m:=500; 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]); vardef flower_left(expr s, t)= z0 = point t of s; z1 = z0+(-m/8, m/10); z0{dir 60}..{dir 235}z1{dir 30}..{dir 30}cycle enddef; vardef flower_right(expr s, t)= z0 = point t of s; z1 = z0+(m/8, m/10); z0{dir 120}..{dir -45}z1{dir 150}..{dir 150}cycle enddef; clearxy; p:=p+1; strokes[p] = flower_left(strokes[0], 0); clearxy; p:=p+1; strokes[p] = flower_left(strokes[0], 8); clearxy; p:=p+1; strokes[p] = flower_right(strokes[0], 1); clearxy; p:=p+1; strokes[p] = flower_left(strokes[0], 3); clearxy; p:=p+1; strokes[p] = flower_left(strokes[0], 4); clearxy; p:=p+1; strokes[p] = flower_right(strokes[0], 5); clearxy; p:=p+1; strokes[p] = flower_right(strokes[0], 6); clearxy; p:=p+1; strokes[p] = flower_right(strokes[0], 9); clearxy; p:=p+1; strokes[p] = flower_left(strokes[1], 2); clearxy; p:=p+1; strokes[p] = flower_right(strokes[1], 9); clearxy; p:=p+1; strokes[p] = flower_right(strokes[1], 4); clearxy; p:=p+1; strokes[p] = flower_left(strokes[1], 7); clearxy; p:=p+1; strokes[p] = flower_right(strokes[1], 5); clearxy; p:=p+1; strokes[p] = flower_left(strokes[1], 6); for i=0 upto 20: if known strokes[i]: fill strokes[i] withcolor OrangeRed; %draw strokes[i] withcolor White; fi; if known paths[i]: draw paths[i] withcolor Gold; fi; endfor; endfig; end