Taco Hoekwater wrote:
Hans Hagen wrote:
Vit Zyka wrote:
Dear Metafun Wizards,
I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea for solving? Next not-minimal but small and illustrative example can help.
works ok here; since it concerns independent mp runs, i cannot imagine what goes wrong; mayeb a bad random numer; does your log say something?
My results are the same as Vit's example: The last 9 items are not shaded but have 3 black sides and 1 white one (with \write18 disabled, using a single \jobname-mpgraph.mp)
I don't know what is going, but at least I can reproduce the problem. I'm attaching an example wrong image.
Taco
A minimal version is here. It shows the randomization is not the reason. Shade disappears at 989th shade. ======================================= \startuseMPgraphic{F} def log(expr Xstart, Xstop)= begingroup save x, y, D, w, P; pair D; path P; w := 2.5pt; w := w/2; D := unitvector(Xstop-Xstart) rotated 90; z1 = Xstart shifted (w*D); z2 = Xstop shifted (w*D); z3 = Xstop shifted (-w*D); z4 = Xstart shifted (-w*D); P := z1--z2{z2-z1}..{z4-z3}z3--z4{z4-z3}..{z2-z1}cycle; P endgroup enddef; path P; x11 = 0; x12 = \overlaywidth; y11 = y12 = \overlayheight; P:= log(z11,z12); linear_shade(P,8,(1,1,1),(0,0,0)); draw P; \stopuseMPgraphic \defineoverlay[F][\uniqueMPgraphic{F}] \defineframed[F][offset=2mm,strut=yes,background=F,frame=off] \starttext \noindent\dorecurse{1000}{\F{\recurselevel} } \stoptext ============================================