Experimenting with Grammars to Generate L-Systems – in JFLAP March 31, 2011 Prof. Susan Rodger Computer Science Dept.

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.
15-5 The Binomial Theorem Pascal’s Triangle. At the tip of Pascal's Triangle is the number 1, which makes up the zeroth row. The first row (1 & 1)
Introduction to Computability Theory
L systems (Aristid Lindenmayer)
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.
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
Plant Modeling using L-Grammars Andreea Francu - Department of Electrical and Computer Engineering.
Approaches To Infinity. Fractals Self Similarity – They appear the same at every scale, no matter how much enlarged.
IlliDOL: A Framework for Exploration of L- Systems in Three Dimensions Vilas Dhar Math 198 Spring 2003.
Dragon Curve Drawn in Project 4… How to generate the string of drawing commands? How does the dragon curve come about? 1.
Today we will derive and use the formula for the area of a triangle by comparing it with the formula for the area of a rectangle. derive = obtain or receive.
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.
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.
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.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
LINDFERN Lindenmayer Systems in VPython Nick Langhammer.
Context Free Grammars CFGs –Add recursion to regular expressions Nested constructions –Notation expression  identifier | number | - expression | ( expression.
Ch 6.6 Absolute Value Inequalities Objective: To solve and graph one variable absolute value inequalities.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
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.
Experimenting with Grammars to Generate L-Systems October 29, 2007
 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.
Today’s Activity Solving Multi-Step Equations. Instructions You should have a baggie of colored strips. Using the strips provided, have each person of.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
Functions. functions: a collection of lines of code with a name that one can call. Functions can have inputs and outputs.
CS 154 Formal Languages and Computability March 8 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
Grammars, L-Systems Jim Whitehead UC Santa Cruz School of Engineering courses.soe.ucsc.edu/courses/cmps265/Spring14/01 23 Apr 2014.
Module 2: Investigation 2
LOGO BY Kaotip 9S.
LOGO 32 By: Xenon 9S.
L-systems L-systems are grammatical systems introduced by Lyndenmayer to describe biological developments such as the growth of plants and cellular organisms.
Simplifications of Context-Free Grammars
At the end of this chapter you will be able to: Define polygon
Open the program Paint on your computer
Prof. Susan Rodger Computer Science Dept
Context-Free Languages
The Pythagorean Theorem a2 + b2 = c2
Presentation transcript:

Experimenting with Grammars to Generate L-Systems – in JFLAP March 31, 2011 Prof. Susan Rodger Computer Science Dept

L-Systems Grammatical systems introduced by Lyndenmayer 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

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

L-System

h(w)

Graphically represent

Example: example1 axiom X X -> g f g X distance 15 lineWidth 5 color black L = What does this draw?

Geometric rules + change direction to the right - change direction to the left % 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-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

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 8 th derivation

JFLAP JFLAP is available for free: Duke School of Environment uses L-systems to model pine needles in Duke Forest

Classwork 5 - 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, %, + Distance set to 15, angle set to 45, side of square is length 30, first diagonal line is 60 1 st, 2 nd and 6 th renderings shown

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