Article View: comp.lang.postscript
Article #3441Re: Byte's fern postscript program
From: Jim Graham
Date: Tue, 23 Oct 1990 20:15
Date: Tue, 23 Oct 1990 20:15
41 lines
2257 bytes
2257 bytes
In article <5830@munnari.oz.au>, danielce@ecr.mu.oz.au (Daniel Ake
Massimo Paolo Carosone) writes:
|> In article <1990Oct19.160619@bendenweyr.Eng.Sun.COM>
|> flar@bendenweyr.Eng.Sun.COM (Jim Graham) writes:
|> >In article <1990Oct18.204534.9186@julius.cs.uiuc.edu>,
|> >nelson@melodian.cs.uiuc.edu (Taed Nelson) writes:
|> >
|> >> [Some PS code involving rlineto]
|> >
|> >What am I missing here? In the first repeat loop, a lot of moveto
|> >rlineto's get generated but the result is never stroked or filled,
|> >it is just thrown away with a newpath. What's the point (only side
|> >effect that I can see is the execution of 20 rand's, so it essentially
|> >just throws out 20 random numbers and takes a long time to do it.
|>
|> But it *does* move the Current Point. There is *no* gsave ... grestore,
|> so this has the effect of going through the IFS transformations,
|> and eventually places ink at the appropriate places..
Not only is a newpath executed (which tosses the currentpoint), but the
code in the following repeat loop does a moveto before each rlineto, so
the currentpoint after the first repeat loop would be meaningless even
if it weren't destroyed by newpath. So, the question still remains:
What does the first loop do?
|> /doit {
|> problistcreate 1 1 20 {
|> problist rand -24 bitshift get transform 2 copy
|> moveto 0.001 10 rlineto
|> }
|> repeat newpath numdots {
|> problist rand -24 bitshift get transform 2 copy
|> moveto 0.001 0 rlineto stroke
|> }
|> repeat
|> }
|> bind def
...jim
Technical Details
Message-ID:
<1990Oct23.131527@bendenweyr.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!bendenweyr!flarReferences:
<1990Oct18.182149.861@infonode.ingr.com> <1990Oct19.160619@bendenweyr.Eng.Sun.COM> <5830@munnari.oz.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!bendenweyr!flar From: flar@bendenweyr.Eng.Sun.COM (Jim Graham) Newsgroups: comp.lang.postscript Subject: Re: Byte's fern postscript program Message-ID: <1990Oct23.131527@bendenweyr.Eng.Sun.COM> Date: 23 Oct 90 20:15:27 GMT References: <1990Oct18.182149.861@infonode.ingr.com> <1990Oct19.160619@bendenweyr.Eng.Sun.COM> <5830@munnari.oz.au> Sender: news@exodus.Eng.Sun.COM Reply-To: flar@bendenweyr.Eng.Sun.COM (Jim Graham) Distribution: na Organization: Sun Microsystems, Inc. Lines: 41