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.
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
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
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.
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.
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.
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,
Week 11 Similar figures, Solutions, Solve, Square root, Sum, Term.
L-Systems Lindenmayer Systems Prusinkiewicz and Lindenmayer
Lindenmayer systems Martijn van den Heuvel May 26th, May 26th, 2011.
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.
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.
Chapter 7 Vocab Review. 1. Write the generic formula (proportion) for geometric mean (x) of two positive numbers a & b.
Ch 6.6 Absolute Value Inequalities Objective: To solve and graph one variable absolute value inequalities.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
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.
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.
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
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.
Module 2: Investigation 2
Formal Languages, Automata and Models of Computation
Computability Joke. Context-free grammars Parsing. Chomsky
Shape and Space Triangles The aim of this unit is to teach pupils to:
Chapter 12.5 The Binomial Theorem.
LOGO BY Kaotip 9S.
LOGO 32 By: Xenon 9S.
Context-Free Grammars: an overview
The Graphic Language.
Similar Polygons.
Creating Functions with Parameters
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
Simplifications of Context-Free Grammars
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
Context-free Languages
CHAPTER 2 Context-Free Languages
Trees and Colored Edge Detection
Similar Figures The Big and Small of it.
Open the program Paint on your computer
Context-Free Languages
The Pythagorean Theorem a2 + b2 = c2
Presentation transcript:

Prof. Susan Rodger Computer Science Dept Experimenting with Grammars to Generate L-Systems – in JFLAP April 3, 2018 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 8th derivation

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

Classwork 6- 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 1st, 2nd and 6th 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 1st, 2nd and 3rd renderings