Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #825

Re: 3D in PS

From luser- -droog <mijoryx@yahoo.com>
Newsgroups comp.lang.postscript
Subject Re: 3D in PS
Date 2012-07-22 02:40 -0700
Organization http://groups.google.com
Message-ID <5df148e4-ece3-433d-89d8-55592e4d8140@googlegroups.com> (permalink)
References (1 earlier) <pmmrkytn2cfy.xr078m3tiehu.dlg@40tude.net> <e5c825f7-427e-484d-a981-0d01e7e0e83c@googlegroups.com> <wbw650l5itai$.rtaypmzhtha7$.dlg@40tude.net> <befb5281-2482-4b0e-b97f-2e1d30faebe1@googlegroups.com> <1b7o4pzvuqf99.j01aa5p3ya7v.dlg@40tude.net>

Show all headers | View raw


On Saturday, July 21, 2012 9:16:07 PM UTC-5, tlvp wrote:
> On Sat, 21 Jul 2012 13:23:34 -0700 (PDT), luser- -droog wrote:
> 
[some google-butchered code]
> Wow! I&#39;m out of breath! 
> 
> Ages ago, as a college frosh, it would take me an hour to digest a page in
> my calculus textbook. Today, it seems to me, it&#39;d take me an hour to grok
> each *line* of that PS routine. With lotsa luck, I might even get to grasp
> it all by the end of the month, if I put in enough time each day.
> 
> Without the comments, even 1 line per day would be super-optimistic :-) .
> So: many thanks! And cheers, -- tlvp
> -- 
> Avant de repondre, jeter la poubelle, SVP.

Well, there are at least two levels going on.
First is the the program. How it cracks and
reconstructs an array, performing substitutions
on each element, and how the result is then
used as graphics commands.

Second is how the transformations of the strings
guide the evolution of the image. For this I
have to use paper. Sketching out the first few
stages to see how it grows. 

The wikipedia page is essentially a book review
for this amazing free book:
http://algorithmicbotany.org/papers/#abop

Here's the first one I've actually devised 
the strings for.

%Pythagoras Tree
<</F{G - - G - - H - - G - - G} % replace line with CCW square
/H{G + + + [ F + + F ] + + + G} % replace line with CW rt tri
>>begin
{F} % start with a line
19 % after about 15 it starts to "bloom"
{[exch{currentdict exch 2 copy known{get aload pop}{exch pop}ifelse}forall] %expand
cvx 
%dup ==  % watch the strings grow 
%  (if you dare! (try a smaller repeat number, like 4))
}repeat
<</r 90/a 45
/F{r 0 rlineto}/G 1 index/H 1 index/-{a rotate}/+{a neg rotate}
([){/r r 2 copy 2 sqrt div def} %save length, reduce
(]){def} %restore length
>>begin
250 150 moveto exec stroke showpage

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

3D in PS luser- -droog <mijoryx@yahoo.com> - 2012-07-18 23:28 -0700
  Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-19 03:47 -0400
    Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2012-07-20 20:43 -0700
      Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-21 01:27 -0400
        Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2012-07-21 13:23 -0700
          Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-21 22:16 -0400
            Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2012-07-22 02:40 -0700
              Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-23 03:23 -0400
                Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2012-07-23 20:40 -0700
                Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-24 01:21 -0400
            Re: 3D in PS Bogus@Embarq.com (Steve) - 2012-07-22 11:23 +0000
  Re: 3D in PS gernot.hoffmann@hs-emden-leer.de - 2012-07-20 10:58 -0700
  Re: 3D in PS Herbert Voss <Herbert.Voss@alumni.tu-berlin.de> - 2012-08-08 15:48 +0200
    Re: 3D in PS Peter Billam <peter@www.pjb.com.au> - 2012-08-08 23:17 +0000
    Re: 3D in PS JohnF <john@please.see.sig.for.email.com> - 2012-08-09 01:28 +0000
      Re: 3D in PS Herbert Voss <Herbert.Voss@alumni.tu-berlin.de> - 2012-08-09 12:19 +0200
        Re: 3D in PS JohnF <john@please.see.sig.for.email.com> - 2012-08-10 05:05 +0000
    Re: 3D in PS tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-08 21:57 -0400
  Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2013-08-31 15:42 -0700
    Re: 3D in PS Mark Carroll <mtbc@bcs.org> - 2013-09-01 09:28 +0100
      Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2013-09-13 22:17 -0700
    Re: 3D in PS luser- -droog <mijoryx@yahoo.com> - 2013-09-19 02:51 -0700

csiph-web