ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vit Zyka <vit.zyka@seznam.cz>
Subject: Re: shading box many times
Date: Tue, 29 Nov 2005 01:35:29 +0100	[thread overview]
Message-ID: <438BA251.90007@seznam.cz> (raw)
In-Reply-To: <438B0C95.6000700@wxs.nl>

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

  parent reply	other threads:[~2005-11-29  0:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28  9:02 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438BA251.90007@seznam.cz \
    --to=vit.zyka@seznam.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).