L-systems II
From GenerativeArt
(Difference between revisions)
{{SingleImage|imageWidthPlusTen=510|imageURL=http://www-viz.tamu.edu/courses/viza658/wiki/lsys2/01.jpg|caption=}} | {{SingleImage|imageWidthPlusTen=510|imageURL=http://www-viz.tamu.edu/courses/viza658/wiki/lsys2/01.jpg|caption=}} | ||
+ | |||
+ | |||
+ | == How context sensitive L-systems transmit signals == | ||
+ | |||
+ | Here is a simple example of signal transmission: | ||
+ | The following sample L-system makes use of context to simulate signal | ||
+ | propagation throughout a string of symbols: | ||
+ | |||
+ | w: baaaaaaaa | ||
+ | p1: b < a → b | ||
+ | pg: b → a | ||
+ | |||
+ | The first few words generated by this L-system are given below: | ||
+ | |||
+ | baaaaaaaa | ||
+ | abaaaaaaa | ||
+ | aabaaaaaa | ||
+ | aaabaaaaa | ||
+ | aaaabaaaa | ||
+ | |||
+ | |||
+ | For fully animated growth models see "Timed DOL-systems" in section 6.1 of The [http://algorithmicbotany.org/papers/#abop Algorithmic Beauty of Plants.] | ||
+ | |||
+ | |||
+ | == How parametric (context free) OL-systems work == | ||
+ | |||
+ | Here is a simple example of a parametric (context free) OL-system: | ||
+ | |||
+ | ω : B(2) A(4, 4) | ||
+ | p1 : A(x, y) : y ≤ 3 → A(x × 2, x + y) | ||
+ | p2 : A(x, y) : y > 3 → B(x) A(x/y, 0) | ||
+ | p3 : B(x) : x < 1 → C | ||
+ | p4 : B(x) : x ≥ 1 → B(x - 1) | ||
+ | |||
+ | {{SingleImage|imageWidthPlusTen=290|imageURL=http://www-viz.tamu.edu/courses/viza658/wiki/lsys2/02.jpg|caption=}} | ||
+ | |||
+ | |||
+ | Here are the extended control symbols used in a 3D parametric L-system | ||
+ | |||
+ | <table> | ||
+ | <tr> | ||
+ | <td valign="top" width="10%"><i>F</i>(<i>a</i>)</td> | ||
+ | <td>Move forward a step of length <i>a</i> > 0. The position of the | ||
+ | turtle changes to (<i>x', y', z'</i>), where <i>x'</i> = <i>x</i> + <i>aH<sub>x</sub></i>, <i>y'</i> = <i>y</i> + <i>aH<sub>y</sub></i> and <i>z'</i> = <i>z</i> + <i>aH<sub>z</sub></i>. A line segment is drawn between points (<i>x, y, z</i>) and (<i>x', y', z'</i>).</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td valign="top" width="10%"><i>f</i>(<i>a</i>)</td> | ||
+ | <td>Move forward a step of length a without drawing a line.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td valign="top" width="10%">+(<i>a</i>)</td> | ||
+ | <td>Rotate around U by an angle of <i>a</i> degrees. If <i>a</i> is positive, the turtle is turned to the left and if a is negative, the turn is to the right.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td valign="top" width="10%">&(<i>a</i>)</td> | ||
+ | <td>Rotate around <i>L</i> by an angle of <i>a</i> degrees. If <i>a</i> is positive, the turtle is pitched down and if <i>a</i> is negative, the turtle is pitched up.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td valign="top" width="10%">/(<i>a</i>)</td> | ||
+ | <td>Rotate around <i>H</i> by an angle of <i>a</i> degrees. If <i>a</i> is positive, the turtle is rolled to the right and if <i>a</i> is negative, it is rolled to the left.</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | How parametric (context sensitive) 2L-systems work |