1 / 25

L-Systems and Procedural Plants

L-Systems and Procedural Plants. CSE 3541 Matt Boggus. Content. Parameterized models of trees Lindenmayer Systems Self-similarity, Rewriting D0L-systems Grammars Graphic Interpretation SpeedTree – a commercial tool for plant modeling. Parameterized trees. Trunk (linkage)

valmai
Download Presentation

L-Systems and Procedural Plants

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. L-Systems and Procedural Plants CSE 3541 Matt Boggus

  2. Content • Parameterized models of trees • Lindenmayer Systems • Self-similarity, Rewriting • D0L-systems • Grammars • Graphic Interpretation • SpeedTree – a commercial tool for plant modeling

  3. Parameterized trees • Trunk (linkage) • Branches (linkage, child of trunk node) • Buds/flowers/fruit (child of branches)

  4. Trunk • Trunk – circular extrusion along a path • For one segment, the radius of the cross section will remain constant or decrease from base to tip • Specifying a radius at each end and interpolate • Path – set of points • Straight line • Add random rotation for each segment • Specify desired length, number of branches

  5. Branching • The trunk can spawn branches • Each branch can spawn new branches • For a branch, specify • Starting position – how close to base of the segment? • Branching angle – which direction does the branch extend in? • Length – how long should the branch be? • Add randomness, but impose limits on all of those values θt θb

  6. L-Systems • A model of morphogenesis, based on formal grammars (set of rules and symbols) • Introduced in 1968 by the Swedish biologist A. Lindenmayer • Originally designed as a formal description of the development of simple multi-cellular organisms • Later on, extended to describe higher plants and complex branching structures

  7. Self-Similarity “When a piece of a shape is geometrically similar to the whole, both the shape and the cascade that generate it are called self-similar” (Mandelbrot, 1982) The recursive nature of the L-system rules leads to self-similarity and fractal-like forms are easy to describe with an L-system.

  8. Self-Similarity in Fractals • Exact • Example Koch snowflake curve • Starts with a single line segment • On each iteration replace each segment by • As one successively zooms in the resulting shape is exactly the same

  9. Self-similarity in Nature • Approximate • Only occurs over a few discrete scales (3 in this Fern) • Self-similarity in plants is a result of developmental processes, since in their growth process some structures repeat regularly. (Mandelbrot, 1982)

  10. Rewriting • Define complex objects by successively replacing parts of a simple object using a set of rewriting rules or productions. • Example: Graphical object defined in terms of rewriting rules - Snowflake curve • Construction: recursively replacing open polygons First four orders of the Koch Curve

  11. Rewriting Systems on Character Strings • The most extensively studied rewriting systems operate on character strings (Late 50s, Chomsky`s work on formal grammars) • Later applications to Computer and formal Languges (BNF form) • A. Lindenmayer (1968) new type of string-rewriting mechanism (L-systems). • In L-systems productions are applied in parallel Reflects Biological motivation of L-systems

  12. Types of L-systems • Context-free: production rules refer only to an individual symbol • Context-sensitive: the production rules apply to a particular symbol only if the symbol has certain neighbours • Deterministic: If there is exactly one production for each symbol, • Stochastic: If there are several, and each is chosen with a certain probability during each iteration

  13. D0L-systems • Simplest class of L-systems, deterministic and context free. • Example: • Alphabet = {a,b} • Rules = {a →ab, b → a} • Axiom: b b | a └ a b ┘ │ a b a ┘ │ └ a b a a b _/ / ┘ └ \ a b a a b a b a Example of a derivation in a DOL-System Syntax of a production rule: Initiator→ Generator

  14. Grammar (C++ statements) <compound stmt> --> { <stmt list> } <stmt list> --> <stmt> <stmt list> | epsilon <stmt> --> <compound stmt> <stmt> --> if ( <expr> ) <stmt> <stmt> --> if ( <expr> ) <stmt> else <stmt> <stmt> --> while ( <expr> ) <stmt> <stmt> --> do <stmt> while ( <expr> ) ; <stmt> --> for ( <stmt> <expr> ; <expr> ) <stmt> <stmt> --> case <expr> : <stmt> <stmt> --> switch ( <expr> ) <stmt> <stmt> --> break ; | continue ; <stmt> --> return <expr> ; | goto <id> ;

  15. L-System Graphic Interpretation • L-systems were conceived as a formal theory of development. • Later, geometrical interpretations were proposed as a tool for fractal and plant modelling • Graphic Interpretation of strings, based on turtle geometry (Prusinkiewicz et al, 89). State of the turtle: (x, y, α) • (x, y): Cartesian coordinates, turtle position • α: angle (heading) direction in which the turtle is facing • Given the step size d and the angle increment δ, the turtle can respond to the commands represented by symbols

  16. Turtle Interpretation of Strings F  Move forward a step of length d. The state of the  turtle  changes to (x',y',α), where  x'= x + d cos(α) and y'= y + d sin(α). A line segment between points (x,y) and (x',y') is drawn  f    Move forward a step of length d without drawing a line. The state of the turtle changes as above +   Turn left by angle δ. The next state of the turtle is (x, y, α + δ) -   Turn right by angle δ. The next state of  the turtle is (x, y, α- δ)

  17. Turtle Interpretation of Strings w: F+F+F+F    p: F →F+F-F-FF+F+F-F Angle (δ) = 90º Quadratic Koch island n= 0 n = 1 n = 2

  18. Bracketed L-systems • To represent branching structures, L-systems alphabet is extended with two new symbols: [Push the current state of the turtle onto a stack ] Pop a state from the stack and make it the current state of the turtle (i.e. change position and heading)

  19. Turtle Interpretation of Bracketed Strings w: F    p: F → F[-F]F[+F][F] Angle (δ) = 60º n = 1 - 5

  20. Stochastic L-systems Avoid regularity in the system by specifying different productions for the same symbol and choose between them based on probabilities and random numbers. For example, the productions : p1 : a -> (0.7) b a p2 : a -> (0.3) c aare 2 rewriting rules for the letter a. In one derivation step, either p1 or p2 will be applied to each occurrence of a, according to the given distribution (0.7 and 0.3).

  21. Modeling in Three Dimensions • Turtle interpretation of strings can be extended to 3D • Represent the current orientation of the turtle in space by 3 vectors: H, L, U, indicating turtle’s Heading, the direction to the Left, and, the direction to the Right. • 3 rotation matrices: RU, RL, and RH and a fixed angle δ • The following symbols control turtle orientation in space: • +, - : Turn left and right, using matrix RU(δ) • &, ^ : Pitch down and up, using matrix RL(δ) • \, / : Roll left and right, using matrix RH(δ) • | : Turning around, using matrix RU(180º)

  22. 3D L-Systems

  23. 3D Bracketed L-Systems

  24. SpeedTree • Specialized commercial tool to model trees • Mix of procedural and hand drawing modeling • SpeedTreeModel Library (150+ species, 500+ models, 2000+ textures and meshes)

  25. References • AristidLindenmayer. Mathematicalmodelsforcellularinteraction in development. parts I and II. Journal of TheoreticalBiology, 18:280–299 and 300–315, 1968. • P. Prusinkiewicz and A. Lindenmayer. TheAlgorithmicBeauty of Plants. Springer-Verlag, 1990. • Algorithmic Beauty of Plants • An Introduction to L-Systems • Speedtree

More Related