ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: e_w_g@t-online.de (Eckhart Guthöhrlein)
Subject: Re: Random repeat?
Date: Mon, 10 Sep 2001 12:37:58 +0200	[thread overview]
Message-ID: <5.1.0.14.0.20010910122706.00aa61f0@public.uni-hamburg.de> (raw)
In-Reply-To: <002301c139d7$8919b600$6501a8c0@lap>

At 10:47 10.09.2001 +0200, Frans Goddijn wrote:
>But where in the graphics should I put the "randomseed" info?

It is not used as a parameter for draw, make it a separate assignment. All 
subsequently generated random numbers will be identical for future mp runs.
This might me a problem if you want it to affect only a single draw (do 
you?), then it would have to be a local assignment. Or you would have to 
assign it a new value after this single draw, randomly generated from 
another source, maybe passed from TeX. But I'm not that experienced with 
mp/context to present you a solution to this problem on the fly. Ah, 
however, except putting the randomseed assignment and the commands to be 
affected at the very end of your graphic. But if you need something like 
this, Hans will surely have a good idea.

For this graphic,

\startreusableMPgraphic{omcirkeld}
    randomseed:=2022;
    draw fulldiamond xyscaled (OverlayWidth,OverlayHeight)
      randomized (30*OverlayLineWidth)
      withpen pencircle scaled OverlayLineWidth
      withcolor OverlayLineColor ;
   path b ; b := boundingbox currentpicture ;
   setbounds currentpicture to b enlarged 10pt ;
\stopreusableMPgraphic

should do it.

Eckhart


  reply	other threads:[~2001-09-10 10:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-10  7:33 Eckhart Guthöhrlein
2001-09-10  8:47 ` Frans Goddijn
2001-09-10 10:37   ` Eckhart Guthöhrlein [this message]
2001-09-10 11:51     ` Frans Goddijn
2001-09-10 11:14   ` Hans Hagen
2001-09-10 11:15 ` Hans Hagen
2001-09-10 12:06   ` Frans Goddijn
  -- strict thread matches above, loose matches on Subject: below --
2001-09-09 18:54 Frans Goddijn

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=5.1.0.14.0.20010910122706.00aa61f0@public.uni-hamburg.de \
    --to=e_w_g@t-online.de \
    /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).