home *** CD-ROM | disk | FTP | other *** search
- /*
- * Example of a rose leaf.
- *
- * The Algorithmic Beauty of Plants, p. 126
- */
-
- lsystem roseleaf;
-
- const LA = 5; // initial length - main segment
- RA = 1.15; // growth rate - main segment
- LB = 1.3; // initial length - lateral segment
- RB = 1.25; // growth rate - lateral segment
- LC = 3; // inital length - marginal notch
- RC = 1.19; // growth rate - marginal notch
-
- table roseleaf {
- A(t,d) :d == 0 -> sv G (LA, RA) sv [ tu(60) B(t) G(LC, RC, t) sv }]
- [tu(60) B(t) { sv ] A(t+1, d);
- A(t,d) :d == 1 -> sv G (LA, RA) sv [ tu(-60) B(t) G(LC, RC, t) sv }]
- [tu(-60) B(t) { sv ] A(t+1, d);
- B(t) :t>0 -> G(LB, RB) B(t-1);
- G(s,r) -> G(s*r, r);
- G(s,r,t):t>1 -> G(s*r,r, t-1);
- };
-
- attributes {
- axiom co("Green") [ {A(0,0) sv} ] [ {A(0,1) sv} ];
- derivation roseleaf(25);
- };