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

  1. /*
  2.  * A plant generated by an L-system.
  3.  *
  4.  * The Algorithmic Beauty of Plants, p. 27
  5.  */
  6.  
  7. lsystem Plant;
  8.  
  9. table PlantTable {
  10.  
  11.  plant -> internode tu(18) [plant tu(18) flower] tu(-36)
  12.           ro(36) [tu(-36) leaf] internode [tu(36) leaf]
  13.           tu(-18) [plant flower] tu(36) plant flower;
  14.             
  15.  
  16.  internode ->F seg [ro(36) pt(-36) leaf] [ro(36) pt(36) leaf] F seg;
  17.  
  18.   seg -> seg F seg;
  19.  
  20.   leaf -> [ {sv tu(18) G sv tu(-18) G(10) sv tu(-18) G sv tu(216)
  21.              G sv tu(-18) G(10) sv tu(-18) G sv}];
  22.  
  23.   flower -> [ pt(-54) pedical co("red") ro(18)
  24.         wedge ro(72) wedge ro(72) wedge ro(72) wedge ro(72) wedge ];
  25.  
  26.   pedical -> F F;
  27.  
  28.   wedge -> [co("yellow") pt(18) F]
  29.            [{sv pt(-72) tu(-18) G sv tu(18) G sv tu(162) G sv tu(18) G sv}]; 
  30. };
  31.  
  32. attributes {
  33.     axiom  co("green") plant;
  34.     derivation PlantTable(5);
  35.     forward 5;
  36. };
  37.