ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Random repeat?
@ 2001-09-10  7:33 Eckhart Guthöhrlein
  2001-09-10  8:47 ` Frans Goddijn
  2001-09-10 11:15 ` Hans Hagen
  0 siblings, 2 replies; 8+ messages in thread
From: Eckhart Guthöhrlein @ 2001-09-10  7:33 UTC (permalink / raw)


At 20:54 09.09.2001 +0200, Frans Goddijn wrote:
>Every once in a while a randomly created logo wrap comes out exceptionally
>nice. Is there a way that I could reproduce that later on? In the log file
>of the present one which looks like a funny poke at a heraldic design I
>read:
>
>Randomizer initialized to 1458579309.
>
>Can I feed that same number back in some way to get the same result again if
>I ever want to? Of course it's typical for me to be really happy with a
>truly random result and then wishing I could control that ;=}}

As far as I know, this value is only used for the random number generator 
in TeX. Have a look in your xxx-mpgraph.log after the run with the nice 
result, there you will find a line

{randomseed:=...}

assigning some value initializing mp's randomizer. Note this value, e.g. 
292, and then say

randomseed:=292

in your graphics, and the results will always be identically random :-)

Eckhart


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

* Re: Random repeat?
  2001-09-10  7:33 Random repeat? Eckhart Guthöhrlein
@ 2001-09-10  8:47 ` Frans Goddijn
  2001-09-10 10:37   ` Eckhart Guthöhrlein
  2001-09-10 11:14   ` Hans Hagen
  2001-09-10 11:15 ` Hans Hagen
  1 sibling, 2 replies; 8+ messages in thread
From: Frans Goddijn @ 2001-09-10  8:47 UTC (permalink / raw)


Thanks Eckhart!

But where in the graphics should I put the "randomseed" info?

the following won't work, halting the compile operation at the mention of
randomseed:

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

----- Original Message -----
From: Eckhart Guthöhrlein <e_w_g@t-online.de>

> Have a look in your xxx-mpgraph.log after the
> run with the nice result, there you will find
> a line
>
> {randomseed:=...}
>
> assigning some value initializing mp's randomizer.
> Note this value, e.g. 292, and then say
>
> randomseed:=292
>
> in your graphics, and the results will always be
> identically random :-)


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

* Re: Random repeat?
  2001-09-10  8:47 ` Frans Goddijn
@ 2001-09-10 10:37   ` Eckhart Guthöhrlein
  2001-09-10 11:51     ` Frans Goddijn
  2001-09-10 11:14   ` Hans Hagen
  1 sibling, 1 reply; 8+ messages in thread
From: Eckhart Guthöhrlein @ 2001-09-10 10:37 UTC (permalink / raw)


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


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

* Re: Random repeat?
  2001-09-10  8:47 ` Frans Goddijn
  2001-09-10 10:37   ` Eckhart Guthöhrlein
@ 2001-09-10 11:14   ` Hans Hagen
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2001-09-10 11:14 UTC (permalink / raw)
  Cc: NTG-ConTeXt mailing list

At 10:47 AM 9/10/2001 +0200, Frans Goddijn wrote:

>   draw fulldiamond xyscaled (OverlayWidth,OverlayHeight)
>    randomseed:=2022

I suggest that you add a ; after the 2022

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Random repeat?
  2001-09-10  7:33 Random repeat? Eckhart Guthöhrlein
  2001-09-10  8:47 ` Frans Goddijn
@ 2001-09-10 11:15 ` Hans Hagen
  2001-09-10 12:06   ` Frans Goddijn
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2001-09-10 11:15 UTC (permalink / raw)
  Cc: Frans Goddijn, NTG-ConTeXt mailing list

At 09:33 AM 9/10/2001 +0200, Eckhart Guthöhrlein wrote:
>At 20:54 09.09.2001 +0200, Frans Goddijn wrote:
>>Every once in a while a randomly created logo wrap comes out exceptionally
>>nice. Is there a way that I could reproduce that later on? In the log file
>>of the present one which looks like a funny poke at a heraldic design I
>>read:
>>
>>Randomizer initialized to 1458579309.
>>
>>Can I feed that same number back in some way to get the same result again if
>>I ever want to? Of course it's typical for me to be really happy with a
>>truly random result and then wishing I could control that ;=}}
>
>As far as I know, this value is only used for the random number generator 
>in TeX. Have a look in your xxx-mpgraph.log after the run with the nice 
>result, there you will find a line
>
>{randomseed:=...}
>
>assigning some value initializing mp's randomizer. Note this value, e.g. 
>292, and then say
>
>randomseed:=292
>
>in your graphics, and the results will always be identically random :-)

it is also possible to say \setupsystem[random=292]

Hans

PS. Randomseed is a strange one, you can set it but not ask for it in mp

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: Random repeat?
  2001-09-10 10:37   ` Eckhart Guthöhrlein
@ 2001-09-10 11:51     ` Frans Goddijn
  0 siblings, 0 replies; 8+ messages in thread
From: Frans Goddijn @ 2001-09-10 11:51 UTC (permalink / raw)


Dear Eckhart,

thanks for your explanation and the example how to do it. I works!

Lately I've been dropping quite a load of questions here and within a week
of these Q&A's I've been advancing tremendously, besides having great fun in
the process. Thanks to all!!

Regards, Frans

----- Original Message -----
From: Eckhart Guthöhrlein <e_w_g@t-online.de>
> 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.


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

* Re: Random repeat?
  2001-09-10 11:15 ` Hans Hagen
@ 2001-09-10 12:06   ` Frans Goddijn
  0 siblings, 0 replies; 8+ messages in thread
From: Frans Goddijn @ 2001-09-10 12:06 UTC (permalink / raw)


> it is also possible to say \setupsystem[random=292]

Promptly tried it but when I use the \setupsystem command, I get random
results. The log gave {randomseed:=1091} with the following:

\setupsystem[random=2022]
\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

This is no "problem" as I can get the desired resul using the
"randomseed:=2022;" line. I just mention the odd result for accuracy.

regards,

Frans


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

* Random repeat?
@ 2001-09-09 18:54 Frans Goddijn
  0 siblings, 0 replies; 8+ messages in thread
From: Frans Goddijn @ 2001-09-09 18:54 UTC (permalink / raw)


Every once in a while a randomly created logo wrap comes out exceptionally
nice. Is there a way that I could reproduce that later on? In the log file
of the present one which looks like a funny poke at a heraldic design I
read:

Randomizer initialized to 1458579309.

Can I feed that same number back in some way to get the same result again if
I ever want to? Of course it's typical for me to be really happy with a
truly random result and then wishing I could control that ;=}}

Thanks for your time,

Frans
www.goddijn.com


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

end of thread, other threads:[~2001-09-10 12:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-10  7:33 Random repeat? Eckhart Guthöhrlein
2001-09-10  8:47 ` Frans Goddijn
2001-09-10 10:37   ` Eckhart Guthöhrlein
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

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).