ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* shading box many times
@ 2005-11-28  9:02 Vit Zyka
  2005-11-28 11:16 ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Vit Zyka @ 2005-11-28  9:02 UTC (permalink / raw)


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.

Thanks in advance
Vit

--------------------------------------------------------------------
\def\Log#1{%
def log(expr Xstart, Xstop)=
   begingroup
     save x, y, D, w, P;
     pair D;
     path P;
     w := #1; 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;
}
\def\ObdobiFrame#1#2{%
def Rand(expr b) =
   (.5pt*(floor(uniformdeviate (2*b+1))-b))
enddef;

path P;
xBor := \overlaylinewidth;
yBor := #1;  yCor := 0pt;
x11 = x14 = 0;
x12 = x13 = \overlaywidth;
y11 = y31 = \overlayheight-yBor+yCor + Rand(2*#2);
y12 = y32 = \overlayheight-yBor+yCor + Rand(2*#2);
y13 = y33 = yBor + Rand(1*#2);
y14 = y34 = yBor + Rand(1*#2);
x21 = x31 = xBor + Rand(6*#2);
x24 = x34 = xBor + Rand(6*#2);
x22 = x32 = \overlaywidth-xBor + Rand(6*#2);
x23 = x33 = \overlaywidth-xBor + Rand(6*#2);
y21 = y22 = \overlayheight+yCor;
y23 = y24 = 0;
fill (z31--z32--z33--z34--cycle) withcolor \MPcolor{\overlaycolor};
P:= log(z11,z12); linear_shade(P,8,(1,1,1),(0,0,0)); draw P;
P:= log(z13,z14); linear_shade(P,8,(1,1,1),(0,0,0)); draw P;
P:= log(z21,z24); linear_shade(P,5,(1,1,1),(0,0,0)); draw P;
P:= log(z22,z23); linear_shade(P,5,(1,1,1),(0,0,0)); draw P;
}

\startuseMPgraphic{F}
   \Log{2.5pt}%
   \ObdobiFrame{3pt}{1}%
\stopuseMPgraphic

\defineoverlay[F][\uniqueMPgraphic{F}]
\defineframed[F]
   [offset=2mm,rulethickness=.5mm,align={middle,lohi},strut=yes,
    backgroundcolor=gray,background=F,frame=off,
   ]

\starttext
   \noindent\dorecurse{256}{\F{\recurselevel} }
\stoptext
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28  9:02 shading box many times Vit Zyka
@ 2005-11-28 11:16 ` Hans Hagen
  2005-11-28 12:36   ` Taco Hoekwater
  2005-11-28 13:02   ` Vit Zyka
  0 siblings, 2 replies; 13+ messages in thread
From: Hans Hagen @ 2005-11-28 11:16 UTC (permalink / raw)


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?

Hans

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 11:16 ` Hans Hagen
@ 2005-11-28 12:36   ` Taco Hoekwater
  2005-11-28 13:38     ` Vit Zyka
  2005-11-28 13:56     ` Hans Hagen
  2005-11-28 13:02   ` Vit Zyka
  1 sibling, 2 replies; 13+ messages in thread
From: Taco Hoekwater @ 2005-11-28 12:36 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

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

[-- Attachment #2: vitmp-mpgraph.3745 --]
[-- Type: application/postscript, Size: 2709 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 11:16 ` Hans Hagen
  2005-11-28 12:36   ` Taco Hoekwater
@ 2005-11-28 13:02   ` Vit Zyka
  1 sibling, 0 replies; 13+ messages in thread
From: Vit Zyka @ 2005-11-28 13:02 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

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?
> 
> Hans

Hmmm strange, the second similar result in last two days: wrong result 
also on wiki.

My log says (whole log is attached)
systems         : randomizer starts with 981406338

Vit

[-- Attachment #2: shade-many.log --]
[-- Type: text/plain, Size: 14561 bytes --]

This is pdfeTeXk, Version 3.141592-1.21b-2.2 (Web2C 7.5.4) (format=cont-en 2005.11.24)  28 NOV 2005 13:56
entering extended mode
\write18 enabled.
 %&-line parsing enabled.
 (c:/TeXLive/texmf-experim2/web2c/natural.tcx)
**&cont-en shade-many.tex
(./shade-many.tex

ConTeXt  ver: 2005.09.08  fmt: 2005.11.24  int: english  mes: english

language        : language en is active
<protectionstate 0>
system          : cont-new loaded
(c:/TeXLive/texmf-experim2/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
color           : palette rollover is available
)
system          : cont-old loaded
(c:/TeXLive/texmf-experim2/tex/context/base/cont-old.tex
loading         : Context Old Macros
)
system          : cont-fil loaded
(c:/TeXLive/texmf-experim2/tex/context/base/cont-fil.tex
loading         : Context File Synonyms
)
system          : cont-sys loaded
(c:/TeXLive/texmf-experim2/tex/context/user/cont-sys.tex
(c:/TeXLive/texmf-experim2/tex/context/base/type-exa.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-syn.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-enc.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-dis.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-siz.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-map.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-spe.tex)
(c:/TeXLive/texmf-experim2/tex/context/base/type-akb.tex))
bodyfont        : 12pt rm is loaded
language        : patterns en->ec:ec->1->2:2 uk->ec:ec->2->2:2 de->texnansi:tex
nansi->3->2:2 de->ec:ec->4->2:2 fr->texnansi:texnansi->5->2:2 fr->ec:ec->6->2:2
 es->ec:ec->7->2:2 pt->texnansi:texnansi->8->2:2 pt->ec:ec->9->2:2 it->texnansi
:texnansi->10->2:2 it->ec:ec->11->2:2 nl->texnansi:texnansi->12->2:2 nl->ec:ec-
>13->2:2 cz->il2:il2->14->2:2 cz->ec:ec->15->2:2 sk->il2:il2->16->2:2 sk->ec:ec
->17->2:2 pl->pl0:pl0->18->2:2 pl->ec:ec->19->2:2 pl->qx:qx->20->2:2 loaded
specials        : tex,postscript,rokicki loaded
\openout2 = `shade-many.tui'.

system          : shade-many.top loaded
(./shade-many.top
specials        : loading definition file tpd
(c:/TeXLive/texmf-experim2/tex/context/base/spec-tpd.tex
specials        : loading definition file fdf
(c:/TeXLive/texmf-experim2/tex/context/base/spec-fdf.tex)
specials        : fdf loaded
)
specials        : fdf,tpd loaded
)
\openout0 = `shade-many-mpgraph.mp'.

\openout0 = `mpgraph.mp'.

 (./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo)
(./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo)
(./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo) (./shade-many.tuo)
(./shade-many.tuo)
systems         : begin file shade-many at line 56
\openout5 = `shade-many-mpgraph.mp'.

systems         : randomizer starts with 981406338
[MP to PDF] (./shade-many-mpgraph.4000) [MP to PDF] (./shade-many-mpgraph.3999)
[MP to PDF] (./shade-many-mpgraph.3998) [MP to PDF] (./shade-many-mpgraph.3997)
[MP to PDF] (./shade-many-mpgraph.3996) [MP to PDF] (./shade-many-mpgraph.3995)
[MP to PDF] (./shade-many-mpgraph.3994) [MP to PDF] (./shade-many-mpgraph.3993)
[MP to PDF] (./shade-many-mpgraph.3992) [MP to PDF] (./shade-many-mpgraph.3991)
[MP to PDF] (./shade-many-mpgraph.3990) [MP to PDF] (./shade-many-mpgraph.3989)
[MP to PDF] (./shade-many-mpgraph.3988) [MP to PDF] (./shade-many-mpgraph.3987)
[MP to PDF] (./shade-many-mpgraph.3986) [MP to PDF] (./shade-many-mpgraph.3985)
[MP to PDF] (./shade-many-mpgraph.3984) [MP to PDF] (./shade-many-mpgraph.3983)
[MP to PDF] (./shade-many-mpgraph.3982) [MP to PDF] (./shade-many-mpgraph.3981)
[MP to PDF] (./shade-many-mpgraph.3980) [MP to PDF] (./shade-many-mpgraph.3979)
[MP to PDF] (./shade-many-mpgraph.3978) [MP to PDF] (./shade-many-mpgraph.3977)
[MP to PDF] (./shade-many-mpgraph.3976) [MP to PDF] (./shade-many-mpgraph.3975)
[MP to PDF] (./shade-many-mpgraph.3974) [MP to PDF] (./shade-many-mpgraph.3973)
[MP to PDF] (./shade-many-mpgraph.3972) [MP to PDF] (./shade-many-mpgraph.3971)
[MP to PDF] (./shade-many-mpgraph.3970) [MP to PDF] (./shade-many-mpgraph.3969)
[MP to PDF] (./shade-many-mpgraph.3968) [MP to PDF] (./shade-many-mpgraph.3967)
[MP to PDF] (./shade-many-mpgraph.3966) [MP to PDF] (./shade-many-mpgraph.3965)
[MP to PDF] (./shade-many-mpgraph.3964) [MP to PDF] (./shade-many-mpgraph.3963)
[MP to PDF] (./shade-many-mpgraph.3962) [MP to PDF] (./shade-many-mpgraph.3961)
[MP to PDF] (./shade-many-mpgraph.3960) [MP to PDF] (./shade-many-mpgraph.3959)
[MP to PDF] (./shade-many-mpgraph.3958) [MP to PDF] (./shade-many-mpgraph.3957)
[MP to PDF] (./shade-many-mpgraph.3956) [MP to PDF] (./shade-many-mpgraph.3955)
[MP to PDF] (./shade-many-mpgraph.3954) [MP to PDF] (./shade-many-mpgraph.3953)
[MP to PDF] (./shade-many-mpgraph.3952) [MP to PDF] (./shade-many-mpgraph.3951)
[MP to PDF] (./shade-many-mpgraph.3950) [MP to PDF] (./shade-many-mpgraph.3949)
[MP to PDF] (./shade-many-mpgraph.3948) [MP to PDF] (./shade-many-mpgraph.3947)
[MP to PDF] (./shade-many-mpgraph.3946) [MP to PDF] (./shade-many-mpgraph.3945)
[MP to PDF] (./shade-many-mpgraph.3944) [MP to PDF] (./shade-many-mpgraph.3943)
[MP to PDF] (./shade-many-mpgraph.3942) [MP to PDF] (./shade-many-mpgraph.3941)
[MP to PDF] (./shade-many-mpgraph.3940) [MP to PDF] (./shade-many-mpgraph.3939)
[MP to PDF] (./shade-many-mpgraph.3938) [MP to PDF] (./shade-many-mpgraph.3937)
[MP to PDF] (./shade-many-mpgraph.3936) [MP to PDF] (./shade-many-mpgraph.3935)
[MP to PDF] (./shade-many-mpgraph.3934) [MP to PDF] (./shade-many-mpgraph.3933)
[MP to PDF] (./shade-many-mpgraph.3932) [MP to PDF] (./shade-many-mpgraph.3931)
[MP to PDF] (./shade-many-mpgraph.3930) [MP to PDF] (./shade-many-mpgraph.3929)
[MP to PDF] (./shade-many-mpgraph.3928) [MP to PDF] (./shade-many-mpgraph.3927)
[MP to PDF] (./shade-many-mpgraph.3926) [MP to PDF] (./shade-many-mpgraph.3925)
[MP to PDF] (./shade-many-mpgraph.3924) [MP to PDF] (./shade-many-mpgraph.3923)
[MP to PDF] (./shade-many-mpgraph.3922) [MP to PDF] (./shade-many-mpgraph.3921)
[MP to PDF] (./shade-many-mpgraph.3920) [MP to PDF] (./shade-many-mpgraph.3919)
[MP to PDF] (./shade-many-mpgraph.3918) [MP to PDF] (./shade-many-mpgraph.3917)
[MP to PDF] (./shade-many-mpgraph.3916) [MP to PDF] (./shade-many-mpgraph.3915)
[MP to PDF] (./shade-many-mpgraph.3914) [MP to PDF] (./shade-many-mpgraph.3913)
[MP to PDF] (./shade-many-mpgraph.3912) [MP to PDF] (./shade-many-mpgraph.3911)
[MP to PDF] (./shade-many-mpgraph.3910) [MP to PDF] (./shade-many-mpgraph.3909)
[MP to PDF] (./shade-many-mpgraph.3908) [MP to PDF] (./shade-many-mpgraph.3907)
[MP to PDF] (./shade-many-mpgraph.3906) [MP to PDF] (./shade-many-mpgraph.3905)
[MP to PDF] (./shade-many-mpgraph.3904) [MP to PDF] (./shade-many-mpgraph.3903)
[MP to PDF] (./shade-many-mpgraph.3902) [MP to PDF] (./shade-many-mpgraph.3901)
[MP to PDF] (./shade-many-mpgraph.3900) [MP to PDF] (./shade-many-mpgraph.3899)
[MP to PDF] (./shade-many-mpgraph.3898) [MP to PDF] (./shade-many-mpgraph.3897)
[MP to PDF] (./shade-many-mpgraph.3896) [MP to PDF] (./shade-many-mpgraph.3895)
[MP to PDF] (./shade-many-mpgraph.3894) [MP to PDF] (./shade-many-mpgraph.3893)
[MP to PDF] (./shade-many-mpgraph.3892) [MP to PDF] (./shade-many-mpgraph.3891)
[MP to PDF] (./shade-many-mpgraph.3890) [MP to PDF] (./shade-many-mpgraph.3889)
[MP to PDF] (./shade-many-mpgraph.3888) [MP to PDF] (./shade-many-mpgraph.3887)
[MP to PDF] (./shade-many-mpgraph.3886) [MP to PDF] (./shade-many-mpgraph.3885)
[MP to PDF] (./shade-many-mpgraph.3884) [MP to PDF] (./shade-many-mpgraph.3883)
[MP to PDF] (./shade-many-mpgraph.3882) [MP to PDF] (./shade-many-mpgraph.3881)
[MP to PDF] (./shade-many-mpgraph.3880) [MP to PDF] (./shade-many-mpgraph.3879)
[MP to PDF] (./shade-many-mpgraph.3878) [MP to PDF] (./shade-many-mpgraph.3877)
[MP to PDF] (./shade-many-mpgraph.3876) [MP to PDF] (./shade-many-mpgraph.3875)
[MP to PDF] (./shade-many-mpgraph.3874) [MP to PDF] (./shade-many-mpgraph.3873)
[MP to PDF] (./shade-many-mpgraph.3872) [MP to PDF] (./shade-many-mpgraph.3871)
[MP to PDF] (./shade-many-mpgraph.3870) [MP to PDF] (./shade-many-mpgraph.3869)
[MP to PDF] (./shade-many-mpgraph.3868) [MP to PDF] (./shade-many-mpgraph.3867)
[MP to PDF] (./shade-many-mpgraph.3866) [MP to PDF] (./shade-many-mpgraph.3865)
[MP to PDF] (./shade-many-mpgraph.3864) [MP to PDF] (./shade-many-mpgraph.3863)
[MP to PDF] (./shade-many-mpgraph.3862) [MP to PDF] (./shade-many-mpgraph.3861)
[MP to PDF] (./shade-many-mpgraph.3860) [MP to PDF] (./shade-many-mpgraph.3859)
[MP to PDF] (./shade-many-mpgraph.3858) [MP to PDF] (./shade-many-mpgraph.3857)
[MP to PDF] (./shade-many-mpgraph.3856) [MP to PDF] (./shade-many-mpgraph.3855)
[MP to PDF] (./shade-many-mpgraph.3854) [MP to PDF] (./shade-many-mpgraph.3853)
[MP to PDF] (./shade-many-mpgraph.3852) [MP to PDF] (./shade-many-mpgraph.3851)
[MP to PDF] (./shade-many-mpgraph.3850) [MP to PDF] (./shade-many-mpgraph.3849)
[MP to PDF] (./shade-many-mpgraph.3848) [MP to PDF] (./shade-many-mpgraph.3847)
[MP to PDF] (./shade-many-mpgraph.3846) [MP to PDF] (./shade-many-mpgraph.3845)
[MP to PDF] (./shade-many-mpgraph.3844) [MP to PDF] (./shade-many-mpgraph.3843)
[MP to PDF] (./shade-many-mpgraph.3842) [MP to PDF] (./shade-many-mpgraph.3841)
[MP to PDF] (./shade-many-mpgraph.3840) [MP to PDF] (./shade-many-mpgraph.3839)
[MP to PDF] (./shade-many-mpgraph.3838) [MP to PDF] (./shade-many-mpgraph.3837)
[MP to PDF] (./shade-many-mpgraph.3836) [MP to PDF] (./shade-many-mpgraph.3835)
[MP to PDF] (./shade-many-mpgraph.3834) [MP to PDF] (./shade-many-mpgraph.3833)
[MP to PDF] (./shade-many-mpgraph.3832) [MP to PDF] (./shade-many-mpgraph.3831)
[MP to PDF] (./shade-many-mpgraph.3830) [MP to PDF] (./shade-many-mpgraph.3829)
[MP to PDF] (./shade-many-mpgraph.3828) [MP to PDF] (./shade-many-mpgraph.3827)
[MP to PDF] (./shade-many-mpgraph.3826) [MP to PDF] (./shade-many-mpgraph.3825)
[MP to PDF] (./shade-many-mpgraph.3824) [MP to PDF] (./shade-many-mpgraph.3823)
[MP to PDF] (./shade-many-mpgraph.3822) [MP to PDF] (./shade-many-mpgraph.3821)
[MP to PDF] (./shade-many-mpgraph.3820) [MP to PDF] (./shade-many-mpgraph.3819)
[MP to PDF] (./shade-many-mpgraph.3818) [MP to PDF] (./shade-many-mpgraph.3817)
[MP to PDF] (./shade-many-mpgraph.3816) [MP to PDF] (./shade-many-mpgraph.3815)
[MP to PDF] (./shade-many-mpgraph.3814) [MP to PDF] (./shade-many-mpgraph.3813)
[MP to PDF] (./shade-many-mpgraph.3812) [MP to PDF] (./shade-many-mpgraph.3811)
[MP to PDF] (./shade-many-mpgraph.3810) [MP to PDF] (./shade-many-mpgraph.3809)
[MP to PDF] (./shade-many-mpgraph.3808) [MP to PDF] (./shade-many-mpgraph.3807)
[MP to PDF] (./shade-many-mpgraph.3806) [MP to PDF] (./shade-many-mpgraph.3805)
[MP to PDF] (./shade-many-mpgraph.3804) [MP to PDF] (./shade-many-mpgraph.3803)
[MP to PDF] (./shade-many-mpgraph.3802) [MP to PDF] (./shade-many-mpgraph.3801)
[MP to PDF] (./shade-many-mpgraph.3800) [MP to PDF] (./shade-many-mpgraph.3799)
[MP to PDF] (./shade-many-mpgraph.3798) [MP to PDF] (./shade-many-mpgraph.3797)
[MP to PDF] (./shade-many-mpgraph.3796) [MP to PDF] (./shade-many-mpgraph.3795)
[MP to PDF] (./shade-many-mpgraph.3794) [MP to PDF] (./shade-many-mpgraph.3793)
[MP to PDF] (./shade-many-mpgraph.3792) [MP to PDF] (./shade-many-mpgraph.3791)
[MP to PDF] (./shade-many-mpgraph.3790) [MP to PDF] (./shade-many-mpgraph.3789)
[MP to PDF] (./shade-many-mpgraph.3788) [MP to PDF] (./shade-many-mpgraph.3787)
[MP to PDF] (./shade-many-mpgraph.3786) [MP to PDF] (./shade-many-mpgraph.3785)
[MP to PDF] (./shade-many-mpgraph.3784) [MP to PDF] (./shade-many-mpgraph.3783)
[MP to PDF] (./shade-many-mpgraph.3782) [MP to PDF] (./shade-many-mpgraph.3781)
[MP to PDF] (./shade-many-mpgraph.3780) [MP to PDF] (./shade-many-mpgraph.3779)
[MP to PDF] (./shade-many-mpgraph.3778) [MP to PDF] (./shade-many-mpgraph.3777)
[MP to PDF] (./shade-many-mpgraph.3776) [MP to PDF] (./shade-many-mpgraph.3775)
[MP to PDF] (./shade-many-mpgraph.3774) [MP to PDF] (./shade-many-mpgraph.3773)
[MP to PDF] (./shade-many-mpgraph.3772) [MP to PDF] (./shade-many-mpgraph.3771)
[MP to PDF] (./shade-many-mpgraph.3770) [MP to PDF] (./shade-many-mpgraph.3769)
[MP to PDF] (./shade-many-mpgraph.3768) [MP to PDF] (./shade-many-mpgraph.3767)
[MP to PDF] (./shade-many-mpgraph.3766) [MP to PDF] (./shade-many-mpgraph.3765)
[MP to PDF] (./shade-many-mpgraph.3764) [MP to PDF] (./shade-many-mpgraph.3763)
[MP to PDF] (./shade-many-mpgraph.3762) [MP to PDF] (./shade-many-mpgraph.3761)
[MP to PDF] (./shade-many-mpgraph.3760) [MP to PDF] (./shade-many-mpgraph.3759)
[MP to PDF] (./shade-many-mpgraph.3758) [MP to PDF] (./shade-many-mpgraph.3757)
[MP to PDF] (./shade-many-mpgraph.3756) [MP to PDF] (./shade-many-mpgraph.3755)
[MP to PDF] (./shade-many-mpgraph.3754) [MP to PDF] (./shade-many-mpgraph.3753)
[MP to PDF] (./shade-many-mpgraph.3752) [MP to PDF] (./shade-many-mpgraph.3751)
[MP to PDF] (./shade-many-mpgraph.3750) [MP to PDF] (./shade-many-mpgraph.3749)
[MP to PDF] (./shade-many-mpgraph.3748) [MP to PDF] (./shade-many-mpgraph.3747)
[MP to PDF] (./shade-many-mpgraph.3746) [MP to PDF] (./shade-many-mpgraph.3745)
fonts           : resetting map file list
fonts           : using map file: original-base
fonts           : using map file: ec-public-lm
fonts           : using map file: ec-base
fonts           : using map file: original-ams-base
fonts           : using map file: original-public-lm
[1.1{c:/TeXLive/texmf-experim2/fonts/map/pdftex/context/original-empty.map}{c:/
TeXLive/texmf-experim2/fonts/map/pdftex/context/original-base.map}{c:/TeXLive/t
exmf-experim2/fonts/map/pdftex/context/ec-public-lm.map}{c:/TeXLive/texmf-exper
im2/fonts/map/pdftex/context/ec-base.map}{c:/TeXLive/texmf-experim2/fonts/map/p
dftex/context/original-ams-base.map}{c:/TeXLive/texmf-experim2/fonts/map/pdftex
/context/original-public-lm.map}]
systems         : end file shade-many at line 58
[flush and process shade-many-mpgraph.mp afterwards] ) 
Here is how much of TeX's memory you used:
 6112 strings out of 61338
 75483 string characters out of 638656
 4636775 words of memory out of 5647670
 41398 multiletter control sequences out of 10000+70000
 75018 words of font info for 37 fonts, out of 1500000 for 2000
 192 hyphenation exceptions out of 1000
 44i,18n,58p,235b,539s stack positions out of 5000i,500n,6000p,200000b,40000s
PDF statistics:
 2550 PDF objects out of 300000
 0 named destinations out of 131072
 9675 words of extra memory for PDF output out of 100000
{c:/TeXLive/texmf-experim
2/fonts/enc/dvips/lm/ec-lm.enc}<c:/TeXLive/texmf-experim2/fonts/type1/public/lm
/lmr12.pfb>
Output written on shade-many.pdf (1 page, 502091 bytes).

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 12:36   ` Taco Hoekwater
@ 2005-11-28 13:38     ` Vit Zyka
  2005-11-28 16:37       ` Peter Rolf
  2005-11-28 13:56     ` Hans Hagen
  1 sibling, 1 reply; 13+ messages in thread
From: Vit Zyka @ 2005-11-28 13:38 UTC (permalink / raw)


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
============================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 12:36   ` Taco Hoekwater
  2005-11-28 13:38     ` Vit Zyka
@ 2005-11-28 13:56     ` Hans Hagen
  2005-11-28 14:45       ` Taco Hoekwater
  2005-11-29  0:35       ` Vit Zyka
  1 sibling, 2 replies; 13+ messages in thread
From: Hans Hagen @ 2005-11-28 13:56 UTC (permalink / raw)


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.


it's related to the fact that there can be 1000 specials only (this 
/1000 in mp-spec)

if you add:

\def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
\def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}

\startMPinclusions
_special_div_ := 10000 ;
\stopMPinclusions

to the file, and change all 1000's in mp-spec.tex into _special_div_ it 
works ok; so, the question (for taco is): does mp have the right 
precission (it looks ok to me, unless we need to start calculating with it)

so, it may be a dangerous patch. I'll adapt spec-mp to  this new 
constant but for the moment keep the 10000 in my cont-loc file

Hans

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 13:56     ` Hans Hagen
@ 2005-11-28 14:45       ` Taco Hoekwater
  2005-11-28 15:43         ` Hans Hagen
  2005-11-29  0:35       ` Vit Zyka
  1 sibling, 1 reply; 13+ messages in thread
From: Taco Hoekwater @ 2005-11-28 14:45 UTC (permalink / raw)




Hans Hagen wrote:
> 
> it's related to the fact that there can be 1000 specials only (this 
> /1000 in mp-spec)

Why?

> if you add:
> 
> \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
> \def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}
> 
> \startMPinclusions
> _special_div_ := 10000 ;
> \stopMPinclusions
> 
> to the file, and change all 1000's in mp-spec.tex into _special_div_ it 
> works ok; so, the question (for taco is): does mp have the right 
> precission (it looks ok to me, unless we need to start calculating with it)

I am not sure what you are doing, but ... in general the fractional
part of a dimension in TeX, divided by an integer, maps to an identical
fraction (of a bp) in metapost, since both use the same 16-bit (% 65536)
calculus algorithm. Same quantity, different unit.

Whether or not that makes dividing by 10.000 safe is not clear
to me. I have to read up on what is going on first.

Taco

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 14:45       ` Taco Hoekwater
@ 2005-11-28 15:43         ` Hans Hagen
  0 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2005-11-28 15:43 UTC (permalink / raw)


Taco Hoekwater wrote:

> Whether or not that makes dividing by 10.000 safe is not clear
> to me. I have to read up on what is going on first.


for i=1 upto 10000 :
    show i/10000 ;
endfor ;

indicates that indeed the precision is ok

i put a version for testing purposes at 
www.pragma-ade.com/temp/cont-tmf.zip

  \settrue \manyMPspecials

will permit 10K specials

(it also has GB's desparate prefix patch so he'd better test it -)

Hans

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 13:38     ` Vit Zyka
@ 2005-11-28 16:37       ` Peter Rolf
  0 siblings, 0 replies; 13+ messages in thread
From: Peter Rolf @ 2005-11-28 16:37 UTC (permalink / raw)


Vit Zyka wrote:
> 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.

Both examples work here (win xp).

pdfeTeX, Version 3.141592-1.30.4-20050924-2.2 (Web2C 7.5.5)
ConTeXt  ver: 2005.11.16  fmt: 2005.11.17  int: english  mes: german
MetaPost, Version 0.901 (Web2c 7.5.3)

Peter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-28 13:56     ` Hans Hagen
  2005-11-28 14:45       ` Taco Hoekwater
@ 2005-11-29  0:35       ` Vit Zyka
  2005-11-29  8:59         ` Hans Hagen
  1 sibling, 1 reply; 13+ messages in thread
From: Vit Zyka @ 2005-11-29  0:35 UTC (permalink / raw)


Hans Hagen wrote:
> 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.
> 
> 
> 
> it's related to the fact that there can be 1000 specials only (this 
> /1000 in mp-spec)
> 
> if you add:
> 
> \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
> \def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}
> 
> \startMPinclusions
> _special_div_ := 10000 ;
> \stopMPinclusions
> 
> to the file, and change all 1000's in mp-spec.tex into _special_div_ it 
> works ok; so, the question (for taco is): does mp have the right 

Really? Hmmm, not for me. I have got the graphics with flat color per 
picture; every picture in the sequence has lighter and lighter color 
(starting from black). (After performing your instructions in the 
mp-spec.mp and refreshing metafun.mem.)

------------------------------------------
\def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
\def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}

\startMPinclusions
   _special_div_ := 10000 ;
\stopMPinclusions

\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
------------------------------------------

> precission (it looks ok to me, unless we need to start calculating with it)
> 
> so, it may be a dangerous patch. I'll adapt spec-mp to  this new 
> constant but for the moment keep the 10000 in my cont-loc file
> 
> Hans
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 

-- 
=======================================================
Ing. Vít Zýka, Ph.D.                         TYPOkvítek

database publishing              databazove publikovani
data maintaining and typesetting in typographic quality
priprava dat a jejich sazba v typograficke kvalite

tel.: (+420) 777 198 189     www: http://typokvitek.com
=======================================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-29  0:35       ` Vit Zyka
@ 2005-11-29  8:59         ` Hans Hagen
  2005-11-29 13:14           ` Vit Zyka
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2005-11-29  8:59 UTC (permalink / raw)


Vit Zyka wrote:

> Hans Hagen wrote:
>
>> 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.
>>
>>
>>
>>
>> it's related to the fact that there can be 1000 specials only (this 
>> /1000 in mp-spec)
>>
>> if you add:
>>
>> \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
>> \def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}
>>
>> \startMPinclusions
>> _special_div_ := 10000 ;
>> \stopMPinclusions
>>
>> to the file, and change all 1000's in mp-spec.tex into _special_div_ 
>> it works ok; so, the question (for taco is): does mp have the right 
>
>
> Really? Hmmm, not for me. I have got the graphics with flat color per 
> picture; every picture in the sequence has lighter and lighter color 
> (starting from black). (After performing your instructions in the 
> mp-spec.mp and refreshing metafun.mem.)

can you try the experimental zip i posted yesterday (.../temp/cont-tmf.zip)
forget about the definitions, just set \settrue \manyMPspecials in your 
file

should work

Hans

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-29  8:59         ` Hans Hagen
@ 2005-11-29 13:14           ` Vit Zyka
  2005-11-29 14:42             ` Hans Hagen
  0 siblings, 1 reply; 13+ messages in thread
From: Vit Zyka @ 2005-11-29 13:14 UTC (permalink / raw)


Hans Hagen wrote:
> Vit Zyka wrote:
> 
>> Hans Hagen wrote:
>>
>>> 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.
>>>
>>> it's related to the fact that there can be 1000 specials only (this 
>>> /1000 in mp-spec)
>>>
>>> if you add:
>>>
>>> \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#10000.00000\relax}
>>> \def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5}
>>>
>>> \startMPinclusions
>>> _special_div_ := 10000 ;
>>> \stopMPinclusions
>>>
>>> to the file, and change all 1000's in mp-spec.tex into _special_div_ 
>>> it works ok; so, the question (for taco is): does mp have the right 
>>
>>
>>
>> Really? Hmmm, not for me. I have got the graphics with flat color per 
>> picture; every picture in the sequence has lighter and lighter color 
>> (starting from black). (After performing your instructions in the 
>> mp-spec.mp and refreshing metafun.mem.)
> 
> 
> can you try the experimental zip i posted yesterday (.../temp/cont-tmf.zip)
> forget about the definitions, just set \settrue \manyMPspecials in your 
> file
> 
> should work
 >
 > Hans

yes, it works!

Now it works even on my old distrib also. Seems the crutial line was
inside this vardef:

vardef add_special_signal = % write the version number
   if (length _global_specials_ <> 0) or (length _local_specials_ <> 0) :
     special ("%%MetaPostSpecials: 2.0 " & decimal _special_signal_ & " 
" & decimal _special_div_) ;
   fi ;
enddef ;

Again many thanks, Hans
Vit

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: shading box many times
  2005-11-29 13:14           ` Vit Zyka
@ 2005-11-29 14:42             ` Hans Hagen
  0 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2005-11-29 14:42 UTC (permalink / raw)


Vit Zyka wrote:

> yes, it works!
>
> Now it works even on my old distrib also. Seems the crutial line was
> inside this vardef:
>
> vardef add_special_signal = % write the version number
>   if (length _global_specials_ <> 0) or (length _local_specials_ <> 0) :
>     special ("%%MetaPostSpecials: 2.0 " & decimal _special_signal_ & " 
> " & decimal _special_div_) ;
>   fi ;
> enddef ;
>
indeed, i pass the value to the mp to pdf converter so that old files 
still work ok; otherwise we get a truckload of compatibility problems

Hans

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-11-29 14:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-28  9:02 shading box many times Vit Zyka
2005-11-28 11:16 ` Hans Hagen
2005-11-28 12:36   ` Taco Hoekwater
2005-11-28 13:38     ` Vit Zyka
2005-11-28 16:37       ` Peter Rolf
2005-11-28 13:56     ` Hans Hagen
2005-11-28 14:45       ` Taco Hoekwater
2005-11-28 15:43         ` Hans Hagen
2005-11-29  0:35       ` Vit Zyka
2005-11-29  8:59         ` Hans Hagen
2005-11-29 13:14           ` Vit Zyka
2005-11-29 14:42             ` Hans Hagen
2005-11-28 13:02   ` Vit Zyka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).