home *** CD-ROM | disk | FTP | other *** search
- /*
- * A plant generated by an L-system.
- *
- * The Algorithmic Beauty of Plants, p. 27
- */
-
- lsystem Plant;
-
- table PlantTable {
-
- plant -> internode tu(18) [plant tu(18) flower] tu(-36)
- ro(36) [tu(-36) leaf] internode [tu(36) leaf]
- tu(-18) [plant flower] tu(36) plant flower;
-
-
- internode ->F seg [ro(36) pt(-36) leaf] [ro(36) pt(36) leaf] F seg;
-
- seg -> seg F seg;
-
- leaf -> [ {sv tu(18) G sv tu(-18) G(10) sv tu(-18) G sv tu(216)
- G sv tu(-18) G(10) sv tu(-18) G sv}];
-
- flower -> [ pt(-54) pedical co("red") ro(18)
- wedge ro(72) wedge ro(72) wedge ro(72) wedge ro(72) wedge ];
-
- pedical -> F F;
-
- wedge -> [co("yellow") pt(18) F]
- [{sv pt(-72) tu(-18) G sv tu(18) G sv tu(162) G sv tu(18) G sv}];
- };
-
- attributes {
- axiom co("green") plant;
- derivation PlantTable(5);
- forward 5;
- };
-