home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / graphtal / examples / leaf.lsy < prev    next >
Text File  |  1992-11-02  |  646b  |  29 lines

  1. /*
  2.  * Example of a leaf.
  3.  *
  4.  * The Algorithmic Beauty of Plants, p. 124
  5.  */
  6.  
  7. lsystem Leaf;
  8.  
  9. table Leaf {
  10.   const    LA=5;     // initial length - main segment
  11.         RA=1.1;   // growth rate - main segment
  12.         LB=2.2;   // initial length - lateral segment
  13.         RB=1.21;  // growth rate - lateral segment
  14.         SD=1;     
  15.         DW=1.01;  
  16.         PD=0.9;   // growth potential decrement
  17.  
  18.   A(t) -> F(LA,1, RA) 
  19.       [ tu(-60) B(t) sv ]
  20.           [ A(t+1) ]
  21.           [ tu(60) B(t) sv ];
  22.   B(t) :t>0 -> F(LB, SD, RB) B(t-PD);
  23.   F(s,w,r) -> F(s*r, w*DW, r);
  24. };
  25.  
  26. attributes {
  27.    axiom  co("Green") wi(1) { sv A(0) };
  28.    derivation Leaf(20);
  29. };