I need to draw few diagrams like this with MetaPost.
So I want to create a wood-pattern-filling-function and use it few times. Is there a good way to do it?
I think to generate a random function, draw its the integer level curves and xscale the picture --- the obtained picture should remind wood pattern. However I do not know how to do such things in MetaPost. The Thruston's answer seems to be relevant --- hope someone could help me, I just started to use MetaPost.
P.S. I want to thank Toby Thurston for help. Here is a modification of his code, which produces a better result:
prologues := 3; outputtemplate := "%j%c.svg"; outputformat := "svg"; vardef wavy expr pa = point 0 of pa for a = s step s until arclength(pa): .. point arctime(a) of pa of pa shifted (sind(a)*up+unitvector(direction arctime(a) of pa of pa) rotated 90 scaled ((1/8)*normaldeviate)) endfor enddef; beginfig(1); numeric s; s = 10; path p, q; p = (left--right) scaled 200 shifted (-10*up); for i=-10 upto 10: p:= wavy p shifted ((2+.7*normaldeviate)*up); draw p withpen pencircle xscaled 1/2 yscaled 1/8 rotated 15; endfor q = unitsquare shifted -(1/2,1/2) xscaled 144 yscaled 21; clip currentpicture to q; undraw q withpen pencircle scaled 1; draw q; endfig; end