Experimenting with Grammars to Generate L-Systems October 29, 2007

Slides:



Advertisements
Similar presentations
{ Technical Drawing 2 1 st ANGLE AND 3 rd ANGLE PROJECTIONS.
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Prof. Busch - LSU1 Simplifications of Context-Free Grammars.
L-System Aristid Lindenmayer (1968), biologist. L-System A method of constructing a FRACTAL that is also a MODEL for plant growth. The Computational Beauty.
Computer Science 1000 LOGO I. LOGO a computer programming language, typically used for education an old language (1967) the basics are simple: move a.
So far we’ve done… Dynamics and chaos Thermodynamics, statistical mechanics, entropy, information Computation, Turing machines, halting problem Evolution,
Introduction to Computability Theory
L systems (Aristid Lindenmayer)
L-systems Presented by Luv Kohli COMP258 October 30, 2002 Images copyright © 1992 D. Fowler, P. Prusinkiewicz, and J. Battjes.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.1: Context-Free Grammars) David Martin With some.
Procedural Modeling L-Systems Procedural Terrain Procedural Behavior Based on the slides from Spring 2007.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
CS39N The Beauty and Joy of Computing Lecture #11 Recursion III It has been a challenge to power electronic components implanted within a body.
Fractals Complex Adaptive Systems Professor Melanie Moses March
Lecture 9UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 9.
Plant Modeling using L-Grammars Andreea Francu - Department of Electrical and Computer Engineering.
An Interactive Approach to Formal Languages and Automata with JFLAP
Approaches To Infinity. Fractals Self Similarity – They appear the same at every scale, no matter how much enlarged.
8.3a-Vectors Terms Operations Practice Problems.
IlliDOL: A Framework for Exploration of L- Systems in Three Dimensions Vilas Dhar Math 198 Spring 2003.
05/09/2015SJF L31 F21SF Software Engineering Foundations Formatting Converting numbers to Strings and vice versa Monica Farrow EM G30
Lecture 21: Languages and Grammars. Natural Language vs. Formal Language.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Chapter 5 .3 Riemann Sums and Definite Integrals
Area & Perimeter of Parallelograms. w l The distance around a geometric figure is its perimeter. To find the perimeter P of a polygon, you can add the.
L-Systems and Procedural Plants CSE 3541 Matt Boggus.
Lecture 3 Drawing Basic Shapes Professor: Dr. Miguel Alonso Jr.
Art 315 Lecture 6 Dr. J. Parker. Variables Variables are one of a few key concepts in programming that must be understood. Many engineering/cs students.
College of Computer and Information Science, Northeastern UniversityOctober 13, CS U540 Computer Graphics Prof. Harriet Fell Spring 2007 Lecture.
The Artificial Life of Plants Przemyslaw Prusinkiewicz, Mark Hammel, Radom´ır Mˇech Department of Computer Science University of Calgary Calgary, Alberta,
Examining the World of Fractals. Myles Akeem Singleton Central Illinois Chapter National BDPA Technology Conference 2006 Los-Angeles, CA.
Week 11 Similar figures, Solutions, Solve, Square root, Sum, Term.
Languages & Grammars. Grammars  A set of rules which govern the structure of a language Fritz Fritz The dog The dog ate ate left left.
L-Systems Lindenmayer Systems Prusinkiewicz and Lindenmayer
Summer School „Modelling and Simulation with GroIMP“ / Tutorial for beginners University of Göttingen (Germany), September, 2010 Winfried Kurth Some.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Lindenmayer systems Martijn van den Heuvel May 26th, May 26th, 2011.
L-system and SVG 2D SVG Tree 2002/10/16.
Computer Science Term 1, 2006 Tutorial 3 Assignment 4 – Special Effects.
Evolutionary Robotics Using A Formal Grammar To Evolve Robot Bodies and Brains Hornby, G.S., Pollack, J. (2001) Creating high-level components with a generative.
How to Draw a Tree L-Systems in Computer Graphics Steven Janke.
Geometry Review AREA 1. Find the measure of each interior angle of the regular polygon shown below. 2.
1 10/27/ :26 UML Simplicity in Complexity. 2 10/27/ :26 UML Rewriting Systems Classic Example: Koch 1905 Initiator Generator.
Procedural Modelling of Plant Scenes Presented by: Kim R 2 Supervisors:Shaun Bangay Adele Lobb A research project for Computer Science Honours 2004.
Sketching & Drawing Projects
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
1 Programming Project #2 (Moldels of Computation, Spring, 2001) Due: April 20 (Friday) This assignment is the second half of the programming project which.
 Make sure you are subscribed to announcements on Moodle.  Activity 5 will be due before the beginning of lab next week.  Check Moodle for complete.
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
NCSC Sample Instructional Unit - Elementary Measurement Lesson 4
Names of the Notes Exercise in finding the names of the notes.
Functions. functions: a collection of lines of code with a name that one can call. Functions can have inputs and outputs.
Patterns and Expressions Lesson 1-1
Experimenting with Grammars to Generate L-Systems – in JFLAP March 31, 2011 Prof. Susan Rodger Computer Science Dept.
Grammars, L-Systems Jim Whitehead UC Santa Cruz School of Engineering courses.soe.ucsc.edu/courses/cmps265/Spring14/01 23 Apr 2014.
Changes to JFLAP to Increase Its Use in Courses Susan H. Rodger Duke University ITiCSE 2011 Darmstadt, Germany June 29, 2011 NSF Grants.
Module 2: Investigation 2
LOGO 32 By: Xenon 9S.
Theory Of Automata By Dr. MM Alam
At the end of this chapter you will be able to: Define polygon
CSE322 LEFT & RIGHT LINEAR REGULAR GRAMMAR
Exercise (1) What does function chai draw? def chai(size):
Trees and Colored Edge Detection
Similar Figures The Big and Small of it.
Open the program Paint on your computer
Prof. Susan Rodger Computer Science Dept
The Pythagorean Theorem a2 + b2 = c2
Presentation transcript:

Experimenting with Grammars to Generate L-Systems October 29, 2007 Prof. Susan Rodger Computer Science Dept

L-Systems Model biological systems and create fractals Similar to Chomsky grammars, except all variables are replaced in each step, not just one! Successive strings are interpreted as strings of render commands and displayed graphically

English Grammar <sentence>  <subject> <verb> <direct obj> <subject>  <noun> | <article> <noun> <verb>  hit | ran | ate <direct obj>  <article><noun> | <noun> <noun>  Fritz | ball <article>  the | an | a Variables (shown in < >) are replaced by right side of arrow

Example: Derive a sentence <sentence>  <subject> <verb> <direct obj>  <noun> <verb> <direct obj>  Fritz <verb> <direct obj>  Fritz hit <direct obj>  Fritz hit <article> <noun>  Fritz hit the <noun>  Fritz hit the ball

Parts of an L-System (a type of grammar) Defined over an alphabet Three parts Axiom (starting place) Replacement rules (replaces all variables at once) Geometric rules (for drawing) g means move forward one unit with pen down f means move forward one unit with pen up + means turn right by the default angle - means turn left by the default angle

Example – lsys-samp1 Axiom Replacement Rules Geometric Rules NOTE: Must use spaces as separator between symbols

Example – lsys-samp1(cont) Derivation of strings X gggX+Y ggggggX + Y + g gggggggggX+Y+g+g ggggggggggggX+Y+g+g+g Note: replace both X and Y each time

More Geometric rules % change direction 180 degrees ~ decrement the width of the next lines [ save in stack current state info ] recover from stack state info { start filled in polygon } end filled in polygon

Example – lsys-samp2

Example – lsys-samp2 (cont) g[~+Yg]gX g[~++Yg]gg[~+Yg]gX g[~+++Yg]gg[~++Yg]gg[~+Yg]gX …

Example - tree

Example – tree rendered

Stochastic Tree Add a rule T -> T Now there is a choice for T, draw a line or don’t

Same Stochastic L-System Rendered 3 times, each at 8th derivation

JFLAP JFLAP is available for free: www.jflap.org JFLAP was developed by many Duke undergraduates over many years, has many other parts to it for studying theoretical computer science concepts JFLAP is downloaded in over 160 countries. Duke School of Environment uses L-systems to model pine needles in Duke Forest

Exercise 1 Write an L-system for the picture below. Symbols needed are: g, + and one variable Distance of the line is 100, rendering at 1 draws the first line, each additional render draws another line.

Exercise 2 Write an L-system for the picture below. Symbols may need: g and + Distance is set to 10, angle to 90, first rendering draws smallest square, additional render draws next larger square

Exercise 3 Write an L-system for the picture below. Symbols may need: g, %, + Distance set to 15, angle set to 45, side of square is length 30, first diagonal line is 60 1st, 2nd and 6th renderings shown

Exercise 4 Write an L-system for the picture below (this is a sample tree to focus on branching, don’t look at the tree from before). Symbols may need: g, +, -, [ ] angle set to 30, distance set to 20 3rd rendering shown

Exercise 5 Write an L-system for the picture below. Symbols may need: g, +, -, [ ] Angle set to 90, distance set to 15 Shows 1st, 2nd and 3rd renderings