Documente Academic
Documente Profesional
Documente Cultură
Faculty of Science
Department of Mathematics
Presented by
Fatma Said Abou Saleh Abdeo
(B.Sc.2003)
Supervised By
(Late) Prof. Dr. Mohamed Hamed El-Zahar
Ass. Prof. Sameh Samy Daoud Dr. Yasser Mohamed Abd EI-Latif
Department of Mathematics
Faculty of Science
Ain Shams University
Submitted to
Department of Mathematics
Faculty of Science
Ain Shams University
CAIRO, EGYPT
2009
4^9 <tuU*ll <U/bU$J! u L w j j l ^ jilJLftlwl j ^
C H 4-aJtl^
ui)> ^1
( 4 i ! < U * J J ) J U J J | JuaU A A X A / J ,1 - ^
cbU.
J j j J ^j-«Lu» ^ A L U J /JJ -Y
^ 1 A-aJlLs
v
1.5.1.3 Ra+1 Projection Algorithm 43
Chapter 2: Introduction to Fractal Geometry 46
2.1 Introduction 46
2.2 Fractal Geometry and Euclidean Geometry .... 47
2.3 Fractal Object 49
2.3.1 Calculation of Fractal Dimension 50
2.4 Types of Fractal Geometry 52
2.4.1 Iterated Function System Fractals (IFS)
53
2.4.1.1 Sierpinski Triangle 55
2.4.1.2 Sierpinski Carpet 59
2.4.1.3 Koch Curve 61
2.4.1.4 Cantor Set 64
2.4.1.5 Fern Leaf 65
2.4.2 The Complex Fractal Objects 72
Chapter 3: Lindenmayer Systems (L-systems) 74
3.1 Introduction 74
3.2 Deterministic Context-free L-systems (D0L-
systems) i 76
3.3 Graphic Interpretation of L-systems Strings... 78
3.4 Modeling in Three Dimensions 84
3.5 Bracketed L-systems and Models of Plants
Architecture 85
3.6 Stochastic L-systems 88
3.7 Context-sensitive L-systems 89
3.8 Parametric L-systems 91
vi
3.8.1 Parametric OL-systems 91
3.8.2 Turtle Interpretation of Parametric
Words 97
Chapter 4: Surfaces Representation using L-systems 99
4.1 Introduction 99
4.2 The Algorithm 100
4.3 Experimental Results and Discussions 103
Chapter 5: Conclusion and Future Work 114
5.1 Conclusion 114
5.2 Future Work 115
Appendix 116
Bibliography 161
vii
List of Figures
Figure 1.1: (a) Set S of points and (b) Convex hull
CH(S)ofS. 15
Figure 1.2: Beginning the Graham Scan 18
Figure 1.3: Points /, r and h subdivide the set &l) and
eliminate all points in the shaded triangle from further
consideration 20
Figure 1.4: Two-dimensional illustration of the
"beneath/beyond" notions 23
Figure 1.5: The sequence (rci, 7c2, n3) of hyperplanes, so
that 7t3 contains the initial facet of the process 26
Figure 1.6: (a) Illustration of the half-plane determined
by e and p forming the largest convex angle with the
half-plane containing F (b) Illustration of the
calculation of the cotangent 29
Figure 1.7; Angle criterion in Delaunay Triangulation.. 37
Figure 1.8: The Voronoi diagram of a planar point set
(a) and associated CPt<a) ,Cp(b) (b) 38
Figure 1.9: Voronoi diagram (dashed) and Delaunay
triangulation (solid) 40
Figure 1.10: (a) New point to be added to existing
triangular mesh (b) Circumscribing circles that contain
the new point (c) The new triangulation obtained after
inserting the new point 41
•• *
vin
Figure 1.11: The projection algorithm: Project the
points in R to the R paraboloid. Calculate the convex
hull, here only shown he lower part 43
Figure 1.12: The projection algorithm: Project the
convex hull edges back onto R and get the Delaunay
triangulation 44
Figure 2.1: Subdividing objects with Euclidean
dimensions 52
Figure 2.2: Classification of IFS and complex fractals.. 53
Figure 2.3: The first three stages in the construction of
the Sierpinski triangle 56
Figure 2.4: Sierpinski triangle generated using the IFS
description 58
Figure 2.5: The first two iterations in the construction
of the Sierpinski carpet 59
Figure 2.6: The first three steps in the construction of
the Koch curve 62
Figure 2.7: The first iteration in the construction of the
Koch curve using the IFS description 63
Figure 2.8: Koch snowflake curve 63
Figure 2.9: The first five iterations in the construction
of the Cantor set 65
Figure 2.10: Fractal fern using IFS 66
Figure 2.11: Fern leaf using IFS 68
Figure 2.12: The fern leaf generated using the values
of Example 2.1 1 69
ix
Figure 2.13: The fern leaf generated using the values
of Example 2.2 70
Figure 2.14: The fern leaf generated using the values
of Example 2.3 70
Figure 2.15: The fern leaf generated using the values
of Example 2.4 71
Figure 2.16: The fern leaf generated using the values
of Example 2.5 71
Figure 2.17: The fern leaf generated using the values
of Example 2.6 72
Figure 3.1: Example of a derivation in a DOL-system.... 77
Figure 3.2: (a) Turtle interpretation of string symbols
F, +, - (b) Interpretation of a string 80
Figure 3.3: Generating a quadratic Koch island 81
Figure 3.4: Examples of Koch curves generated using
L-systems 82
Figure 3.5: A sequence of Koch curves obtained by
successive modification of the production successor 83
Figure 3.6: Controlling the turtle in three dimensions .. 85
Figure 3.7: Examples of two-dimensional plant-like
structures generated by bracketed OL-systems 87
Figure 3.8: Examples of three-dimensional plant-like
structures generated by bracketed OL-systems 88
Figure 3.9: The initial sequence of strings generated by
the parametric L-system specified in equation (3.2) 97
x
Figure 4.1: The fractal plant generated from the
L-System of Example 1 renders as lines 104
Figure 4.2: The fractal plant generated from the
L-System of Example 2 renders as lines 105
Figure 4.3: The fractal plant generated from the
L-System of Example 3 renders as lines 105
Figure 4.4: The fractal plant generated from the
L-System of Example 4 renders as lines 106
Figure 4.5: The fractal plant generated from the
L-System of Example 5 renders as lines 107
Figure 4.6: The fractal plant generated from the
L-System of Example 6 renders as lines 108
Figure 4.7: The fractal plant generated from the
L-System of Example 7 renders as lines 109
Figure 4.8: The fractal plant generated from the
L-System of Example 8 renders as lines 109
Figure 4.9: The fractal plant generated from the
L-System of Example 9 renders as lines 110
Figure 4.10: The fractal plant generated from the
L-System of Example 10 renders as lines Ill
Figure 4.11: The fractal plant generated from the
L-System of Example 11 renders as lines Ill
Figure 4.12: The fractal plant generated from the
L-System of Example 12 renders as lines 112
Figure 4.13: The fractal plant generated from the
L-System of Example 13 renders as lines 113
xi
List of Tables
Table 2.1: The differences between fractal geometry
and Euclidean geometry 48
Table 3.1: Operator precedence and associativity 93
Table 4.1: Results of Examples 1-13 113
xn
ii
Sierpinski triangle, Sierpinski carpet, Cantor set, Koch curve,
and Fern leaf. Then we describe how we can create these fractals
using IFS in 2-dimensional space.
iii
The appendix includes three sections. The first section
contains the source codes that are used to generate some of the
fractal objects discussed in Chapter two using IFS. The programs
of the first section are written in the Java applet language. The
second section contains the source codes that are used to generate
the fractal objects discussed in Chapter three using L-systems.
The programs of the second section are written in the Matlab
language. The third section contains an implementation of the
iterative steps of the algorithm presented in Chapter four and the
program written in the Matlab language.
iv
Arabic summary
4^9 <tuU*ll <U/bU$J! u L w j j l ^ jilJLftlwl j ^
C H 4-aJtl^
ui)> ^1
( 4 i ! < U * J J ) J U J J | JuaU A A X A / J ,1 - ^
cbU.
J j j J ^j-«Lu» ^ A L U J /JJ -Y
^ 1 A-aJlLs
yy"«■ ■
'■
■ t W^i IIW
w* \
Y* *1 j ?L!A1! 4JLui
W
J j U /«^tui 7t»aLui / J - t
Graham ^Ul ja> oa^i JLQ ^Uull .^ull ^ SJluuJI &JA <J=J CJU*JJ!jaJI
lja_J ^JU-iij .QuickHull techniques £^>-uJ 3JUaJI LJJLJJ Sba/7
6JA J=J QuickHull £&>*& AjtUJij Gift-wrapping Uukill ^ ^ j j j ^
iaUiit QA A&JA-\ A\ UJJJAS! AJLui-a (JJOJ^J ijJA.!j . J J £ ! j l ^Lu! AiDta ^Jj <ilwuJi
JljJI Jaj ^hVhuU ti>bjxall! a^A j j l i jl JLOJ ; tfi cLwaj ^J .Fern leaf
jiil 13 a___j .AJJJUJ £11 d i u j l £ l ! -lilj^J Lol^kjjuil CjLnsull JJ£1 <j« 1^.1 j jfl*j
. t—JL)ljLoil
Presented by
Fatma Said Abou Saleh Abdeo
(B.Sc.2003)
Supervised By
(Late) Prof. Dr. Mohamed Hamed El-Zahar
Ass. Prof. Sameh Samy Daoud Dr. Yasser Mohamed Abd EI-Latif
Department of Mathematics
Faculty of Science
Ain Shams University
Submitted to
Department of Mathematics
Faculty of Science
Ain Shams University
CAIRO, EGYPT
2009
a ^ j y l l (j^d^.^)]) J&l a-ul
U % Ul ^ V ^ k S j f t f ■ " . .
-»
k^kJl 3&31 £21 ^ 12
( r ^ y i ) sjyi SJJ-,
Acknowledgements
First of all, gratitude and thanks to ALLAH who always
helps and guides us.
i
Summary
1
Summary
The main object of this thesis is to study the application of
computational geometry algorithms in computer graphics. We
have chosen the set of fractal objects as a representative for
computer graphics. This thesis consists of an introduction, five
chapters, and an appendix. It is organized as follows:
ii
Sierpinski triangle, Sierpinski carpet, Cantor set, Koch curve,
and Fern leaf. Then we describe how we can create these fractals
using IFS in 2-dimensional space.
iii
The appendix includes three sections. The first section
contains the source codes that are used to generate some of the
fractal objects discussed in Chapter two using IFS. The programs
of the first section are written in the Java applet language. The
second section contains the source codes that are used to generate
the fractal objects discussed in Chapter three using L-systems.
The programs of the second section are written in the Matlab
language. The third section contains an implementation of the
iterative steps of the algorithm presented in Chapter four and the
program written in the Matlab language.
iv
Contents
v
1.5.1.3 Ra+1 Projection Algorithm 43
Chapter 2: Introduction to Fractal Geometry 46
2.1 Introduction 46
2.2 Fractal Geometry and Euclidean Geometry .... 47
2.3 Fractal Object 49
2.3.1 Calculation of Fractal Dimension 50
2.4 Types of Fractal Geometry 52
2.4.1 Iterated Function System Fractals (IFS)
53
2.4.1.1 Sierpinski Triangle 55
2.4.1.2 Sierpinski Carpet 59
2.4.1.3 Koch Curve 61
2.4.1.4 Cantor Set 64
2.4.1.5 Fern Leaf 65
2.4.2 The Complex Fractal Objects 72
Chapter 3: Lindenmayer Systems (L-systems) 74
3.1 Introduction 74
3.2 Deterministic Context-free L-systems (D0L-
systems) i 76
3.3 Graphic Interpretation of L-systems Strings... 78
3.4 Modeling in Three Dimensions 84
3.5 Bracketed L-systems and Models of Plants
Architecture 85
3.6 Stochastic L-systems 88
3.7 Context-sensitive L-systems 89
3.8 Parametric L-systems 91
vi
3.8.1 Parametric OL-systems 91
3.8.2 Turtle Interpretation of Parametric
Words 97
Chapter 4: Surfaces Representation using L-systems 99
4.1 Introduction 99
4.2 The Algorithm 100
4.3 Experimental Results and Discussions 103
Chapter 5: Conclusion and Future Work 114
5.1 Conclusion 114
5.2 Future Work 115
Appendix 116
Bibliography 161
vii
List of Figures
Figure 1.1: (a) Set S of points and (b) Convex hull
CH(S)ofS. 15
Figure 1.2: Beginning the Graham Scan 18
Figure 1.3: Points /, r and h subdivide the set &l) and
eliminate all points in the shaded triangle from further
consideration 20
Figure 1.4: Two-dimensional illustration of the
"beneath/beyond" notions 23
Figure 1.5: The sequence (rci, 7c2, n3) of hyperplanes, so
that 7t3 contains the initial facet of the process 26
Figure 1.6: (a) Illustration of the half-plane determined
by e and p forming the largest convex angle with the
half-plane containing F (b) Illustration of the
calculation of the cotangent 29
Figure 1.7; Angle criterion in Delaunay Triangulation.. 37
Figure 1.8: The Voronoi diagram of a planar point set
(a) and associated CPt<a) ,Cp(b) (b) 38
Figure 1.9: Voronoi diagram (dashed) and Delaunay
triangulation (solid) 40
Figure 1.10: (a) New point to be added to existing
triangular mesh (b) Circumscribing circles that contain
the new point (c) The new triangulation obtained after
inserting the new point 41
•• *
vin
Figure 1.11: The projection algorithm: Project the
points in R to the R paraboloid. Calculate the convex
hull, here only shown he lower part 43
Figure 1.12: The projection algorithm: Project the
convex hull edges back onto R and get the Delaunay
triangulation 44
Figure 2.1: Subdividing objects with Euclidean
dimensions 52
Figure 2.2: Classification of IFS and complex fractals.. 53
Figure 2.3: The first three stages in the construction of
the Sierpinski triangle 56
Figure 2.4: Sierpinski triangle generated using the IFS
description 58
Figure 2.5: The first two iterations in the construction
of the Sierpinski carpet 59
Figure 2.6: The first three steps in the construction of
the Koch curve 62
Figure 2.7: The first iteration in the construction of the
Koch curve using the IFS description 63
Figure 2.8: Koch snowflake curve 63
Figure 2.9: The first five iterations in the construction
of the Cantor set 65
Figure 2.10: Fractal fern using IFS 66
Figure 2.11: Fern leaf using IFS 68
Figure 2.12: The fern leaf generated using the values
of Example 2.1 1 69
ix
Figure 2.13: The fern leaf generated using the values
of Example 2.2 70
Figure 2.14: The fern leaf generated using the values
of Example 2.3 70
Figure 2.15: The fern leaf generated using the values
of Example 2.4 71
Figure 2.16: The fern leaf generated using the values
of Example 2.5 71
Figure 2.17: The fern leaf generated using the values
of Example 2.6 72
Figure 3.1: Example of a derivation in a DOL-system.... 77
Figure 3.2: (a) Turtle interpretation of string symbols
F, +, - (b) Interpretation of a string 80
Figure 3.3: Generating a quadratic Koch island 81
Figure 3.4: Examples of Koch curves generated using
L-systems 82
Figure 3.5: A sequence of Koch curves obtained by
successive modification of the production successor 83
Figure 3.6: Controlling the turtle in three dimensions .. 85
Figure 3.7: Examples of two-dimensional plant-like
structures generated by bracketed OL-systems 87
Figure 3.8: Examples of three-dimensional plant-like
structures generated by bracketed OL-systems 88
Figure 3.9: The initial sequence of strings generated by
the parametric L-system specified in equation (3.2) 97
x
Figure 4.1: The fractal plant generated from the
L-System of Example 1 renders as lines 104
Figure 4.2: The fractal plant generated from the
L-System of Example 2 renders as lines 105
Figure 4.3: The fractal plant generated from the
L-System of Example 3 renders as lines 105
Figure 4.4: The fractal plant generated from the
L-System of Example 4 renders as lines 106
Figure 4.5: The fractal plant generated from the
L-System of Example 5 renders as lines 107
Figure 4.6: The fractal plant generated from the
L-System of Example 6 renders as lines 108
Figure 4.7: The fractal plant generated from the
L-System of Example 7 renders as lines 109
Figure 4.8: The fractal plant generated from the
L-System of Example 8 renders as lines 109
Figure 4.9: The fractal plant generated from the
L-System of Example 9 renders as lines 110
Figure 4.10: The fractal plant generated from the
L-System of Example 10 renders as lines Ill
Figure 4.11: The fractal plant generated from the
L-System of Example 11 renders as lines Ill
Figure 4.12: The fractal plant generated from the
L-System of Example 12 renders as lines 112
Figure 4.13: The fractal plant generated from the
L-System of Example 13 renders as lines 113
xi
List of Tables
Table 2.1: The differences between fractal geometry
and Euclidean geometry 48
Table 3.1: Operator precedence and associativity 93
Table 4.1: Results of Examples 1-13 113
xn
Introduction
§5 Introduction
INTRODUCTION
2
§5 Introduction
3
^85 Introduction
4
^ Introduction
5
^j? Introduction ,
Plants" [361. In this book, the raw power of the L-systems were
displayed by producing beautifully magnificent plants and
structures. Besides a lot of biological models, some of the
topics covered are rewriting systems, DOL-systems, turtle
interpretation of strings, bracketed L-systems, stochastic,
parameterized, conditional, context sensitive and timed
L-systems, growth functions, and surface models.
Prusinkiewicz has continued research with colleges into the
modeling of plants. This includes: smooth animation of plant
development, improving and extending upon the base
L-system language constructs, and also developed methods to
help increase visual realism((371'[381'l391).
6
Chapter I
Introduction to
Computational Geometry
^ Introduction To Computational Geometry
CHAPTER 1
INTRODUCTION TO
COMPUTATIONAL GEOMETRY