Sunteți pe pagina 1din 45

Am Shams University

Faculty of Science
Department of Mathematics

On Using Computational Geometry


Algorithms in Computer Graphics
Thesis
Submitted in Partial Fulfillment of the Requirements
Of the Award of the (M. Sc.) Degree
(Computer Science)

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

jLjkui ^»P x o ^ >«Lj /J „r

^ 1 A-aJlLs

Powered by TCPDF (www.tcpdf.org)


Contents

List of Figures viii


List of Tables xii
Introduction 1
Chapter 1: Introduction to Computational Geometry 7
1.1 Introduction 7
1.2 Basic Definitions 8
1.3 Types of Computational Geometry Problems. 11
1.3.1 Static Problems 11
1.3.2 Geometric Query Problems 12
1.3.3 Dynamic Problems 13
1.4 Convex Hull Problem... 14
1.4.1 Convex Hulls in Two-Dimensional
Space 16
1.4.1.1 Graham Scan 17
1.4.1.2 QuickHull Techniques 20
1.4.2 Convex Hulls in Three-Dimensions 23
1.4.2.1 The Gift-wrapping Method 24
1.4.2.2 QuickHull Algorithm 31
1.5 Triangulation 35
1.5.1 Delaunay Triangulation 36
1.5.1.1 Voronoi Diagram and Delaunay
Triangulation 37
1.5.1.2 Bowyer-Watson Algorithm 40

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

Powered by TCPDF (www.tcpdf.org)


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:

In the first chapter: we introduce the basic concepts of


computational geometry and its applications. Then we discuss
some of its important problems such as Convex hull, Point
Location, Closest Pair, Voronoi Diagram, and Polygon
Triangulation. We discuss in detail the problem of convex hull in
the plane. Then we present some algorithms for solving this
problem in 2-dimensional space such as Graham scan and
QuickHull techniques. We also present the Gift-wrapping and
QuickHull algorithms for solving this problem in three or more
dimensional space. Finally we study the triangulation problem
for a set of points and present some algorithms for solving this
problem such as Bowyer-Watson and Projection algorithms.

In the second chapter: we introduce a brief introduction


to the fractal geometry. Then we discuss the basic types of fractal
geometry which are iterated function systems (IFS) fractals and
complex fractals. We also present some of fractal objects such as

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.

In the third chapter: we introduce the basic definition of


the Lindenmayer system (L-system) which is considered one of
the most common techniques used for generating fractal objects.
Then we discuss the different types of L-systems such as
Deterministic Context-free L-system, Stochastic L-system,
Parametric L-system, and Context-sensitive L-system: We also
describe how we can use L-systems technique to model plants
such as trees in 2-dimensional and 3-dimensional space.

In the fourth chapter: we introduce our main new


results. In this chapter, we present a new algorithm that generates
a 3D fractal plant according to the given 3D L-system and also
creates the triangulation shape of the vertices generated from the
last stage of the L-system rewriting process. The resulting shapes
can be used as surfaces models for architectural objects. The
results of this chapter are original and are published in The
International Conference on Computational Geometry (ICCG),
Venice, Italy, (29-31/10/2008).

In the fifth chapter: we give the conclusion about this


work and we also introduce some plans for the future work.

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

jLjkui ^»P x o ^ >«Lj /J „r

^ 1 A-aJlLs
yy"«■ ■
'■
■ t W^i IIW

w* \

Y* *1 j ?L!A1! 4JLui
W
J j U /«^tui 7t»aLui / J - t

4j»^LaJ^ ^j.i)K ^ <Ua! j-c * ^ ^ c ) ^ - 0 4-^J-0


Y../ / Y.. / /
\±Jk

IfJbj u i t j ^ ! J b l^U j j i i ! SiiluiVl S J U I jSJil


^r jjxa£ AjjjuiH! JlSoiVt 4jtjA2k-ft tijpiaJ JS3j . i j m N t l CsU_yuij ^ AJJLU^JI

.IjjliuiaJij A^LmaJI A-uA^il ^JUUAJUOH AJAUAII aiaJ : J j V I Jj-aiJ! ^

, Convex Hull <_JJ*-J 4_JUall J_la ^l^Sl I ^ J L ^


JIS—ul , Closest Pair QJ ,*iWii ^ > J 1 , Pom? Location ^LSj Judau
.Polygon Triangulation ^L^* UJJ&J Voronoi Diagram ijyjjj>

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

. JaliuiVl t^AJjj^j Bowyer-Watson

IjJ &A1\ (Jlj-lSl pisu CJLJJUJ£ ( ^ J A j J J ^ i A J O J ^ I I AJJUULUJV^ p i j j V l (jisbj

UJ Sla J JA ^J^>u) $S\ CJ JJI£JI j * O^*-^ ^ - ^ f ^ J .4>&jd\ ^ ^ J ^ - ^ J

, Sierpinski Carpet ^JS^J^ o^L^ , Sierpinski Triangle J^j^


CJJ—£ tejjj Koch Curve <^j£ LS^1A , Cantor Set jj^ A^J^^

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

L ^1—laill , Deterministic Context-free L-system (DOL-system)


Parametric L- ISJM\J—£\ L fUaili , Stochastic L-system ^ I j ^ l
.Context-sensitive L-system QA>* -*\\ O*&L ^Uaill \J^AJ system
(J,. ,AA CA jLall 4 2LAAJJ L A-cdajVl AJJSU a.Vv'u.tU ^jl ( j £ x J <-JLJ£, L J b j l (-_k^-ajj

tjjua fill 1^ & ^gi .6.1j.laJl A-Uu-Ujll l i a u t i j ( j i a j a j I A J I J J I (Jx-saill ^

J JLIII ^^gJ^J L ^ U a i i i tafia ^sull ^^J^ta ^ J J ^ ^ ^ «^JP fiJuJlaw A ^ j j l j ^ a.iaJ

4—AGAS S j ^ V t A I A - J A I I j - o O ^ I J A I I (JAJjjfi i*iJiVlJ !>l£jji . i i j J ^ - a ^ J .^Ja«-Jl

^ ,,.V g r J L - r t t i ^ V i u i ^ J j L a J A^jUll J l £ i . V l j . L fUajJI A_st& S i c ]

6^—jAik iJi-aiSl lji& ^ tlLo^S ^ g l i ! A O A J J I ^ L J I £ c j l j l j l l x j j . A J J L U L A I I aL.aa.Vl

• ( ^ * * A J J j & l ) yUajJn 1 4 a L > ^ 4 J U I ^ H ^ j J J X J > O J I ^ S U J J ^ J aJ A 5 j

<J^a*j U i a j l A ^ S j j U ^ * ^ ^ (J^ 3 1 - A x - a ! i i i J l ^ Hn \ '. ( j a x l - i J l <J*-aa]l ^ i

•L5—all 2^*1 j — i l l ^gic- (^j4a*J L ) J V 1 juaiall ,ALUJ£II Ai£>to ( j ^ U l l j , n >,>vn

i i l — S i j ^ j l j l l (Jjk-saill j - i Ifriujfll'u aJ 4>5!lll Ajjjuikll d l l j l £ i l J ^ i x j ^ J ^ - ^ - "*

A—aUJl AxL J j V l AwiAil ^ ^ t x l j f l l d s i j ^ A3j . a j j ^ l J I JljJill a l i i J^iajoilj

^a—J ^ p l l 4jJjui£Jl CJUJI£1I AiijiS A,^"UJIU ^ ^ 1 ^ - t t l j f l l ^gic ij J ^ ^ I j l l aju^l

c r - i g-olJill d u ^ Aflj . L AxikiVl ^ I ^ . ^ U < i l l i j d>l\jJl Jx-aall ^ l^liSlia

Cllj—kaJt ^ j V u l ^ s b j j ^^ic. (Jj^J t l i l l j l l AJUJAII .CJL^Lall A i L ^ I J S I AJOIAII

4 — i L U J J , , , Ti^^ ^ - « 1 — J j i l l j A jl j i l (J*-^^^ ( ^ A-oJiAll A j ^ j j l j i U l AJJ) j ^ l l l

. t—JL)ljLoil

Powered by TCPDF (www.tcpdf.org)


Am Shams University
Faculty of Science
Department of Mathematics

On Using Computational Geometry


Algorithms in Computer Graphics
Thesis
Submitted in Partial Fulfillment of the Requirements
Of the Award of the (M. Sc.) Degree
(Computer Science)

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

a!a*Jt iJll (3^ u-:3

( r ^ y i ) sjyi SJJ-,
Acknowledgements
First of all, gratitude and thanks to ALLAH who always
helps and guides us.

I would like to express my deepest thanks to my


supervisor Prof. Sameh Samy Daoud for the discussions about
this work. He provided many incisive observations which
improved both the content and presentation immensely. In
addition, I thank him for improving my writing skills.

Also, I would like to express my deep gratitude to my


supervisor Dr. Yasser Mohamed Abd El-Latif for the huge
amount of efforts he spent in guiding my research. He is always
been there to share him quick wit, to clarify and enhance my
thinking, and to spark new ideas.

Lastly, I would like to thank my family especially my


parents, whose strength and support have been with me without
fail throughout the master preparation.

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:

In the first chapter: we introduce the basic concepts of


computational geometry and its applications. Then we discuss
some of its important problems such as Convex hull, Point
Location, Closest Pair, Voronoi Diagram, and Polygon
Triangulation. We discuss in detail the problem of convex hull in
the plane. Then we present some algorithms for solving this
problem in 2-dimensional space such as Graham scan and
QuickHull techniques. We also present the Gift-wrapping and
QuickHull algorithms for solving this problem in three or more
dimensional space. Finally we study the triangulation problem
for a set of points and present some algorithms for solving this
problem such as Bowyer-Watson and Projection algorithms.

In the second chapter: we introduce a brief introduction


to the fractal geometry. Then we discuss the basic types of fractal
geometry which are iterated function systems (IFS) fractals and
complex fractals. We also present some of fractal objects such as

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.

In the third chapter: we introduce the basic definition of


the Lindenmayer system (L-system) which is considered one of
the most common techniques used for generating fractal objects.
Then we discuss the different types of L-systems such as
Deterministic Context-free L-system, Stochastic L-system,
Parametric L-system, and Context-sensitive L-system: We also
describe how we can use L-systems technique to model plants
such as trees in 2-dimensional and 3-dimensional space.

In the fourth chapter: we introduce our main new


results. In this chapter, we present a new algorithm that generates
a 3D fractal plant according to the given 3D L-system and also
creates the triangulation shape of the vertices generated from the
last stage of the L-system rewriting process. The resulting shapes
can be used as surfaces models for architectural objects. The
results of this chapter are original and are published in The
International Conference on Computational Geometry (ICCG),
Venice, Italy, (29-31/10/2008).

In the fifth chapter: we give the conclusion about this


work and we also introduce some plans for the future work.

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

List of Figures viii


List of Tables xii
Introduction 1
Chapter 1: Introduction to Computational Geometry 7
1.1 Introduction 7
1.2 Basic Definitions 8
1.3 Types of Computational Geometry Problems. 11
1.3.1 Static Problems 11
1.3.2 Geometric Query Problems 12
1.3.3 Dynamic Problems 13
1.4 Convex Hull Problem... 14
1.4.1 Convex Hulls in Two-Dimensional
Space 16
1.4.1.1 Graham Scan 17
1.4.1.2 QuickHull Techniques 20
1.4.2 Convex Hulls in Three-Dimensions 23
1.4.2.1 The Gift-wrapping Method 24
1.4.2.2 QuickHull Algorithm 31
1.5 Triangulation 35
1.5.1 Delaunay Triangulation 36
1.5.1.1 Voronoi Diagram and Delaunay
Triangulation 37
1.5.1.2 Bowyer-Watson Algorithm 40

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

Geometric objects such as points, lines, and polygons


are the basis of a broad variety of important applications and
give rise to an interesting set of problems and algorithms. The
name geometry reminds us of its earliest use: for the
measurement of land and materials. Today, computers are
being used more and more to solve larger-scale geometric
problems. Over the past two decades, a set of tools and
techniques has been developed that takes advantage of the
structure provided by geometry. This discipline is known as
computational geometry.

Computational geometry is the branch of computer


science that studies algorithms in order to solve geometric
problems. It was named and largely started around 1975 by
Shamos, whose Ph.D. thesis1441 attracted considerable attention.
After a decade of development, the field came into its own in
1985, when three components of any healthy discipline were
realized: a textbook, a conference, and a journal. In 1985,
Preparata and Shamos introduced their book "Computational
Geometry: An Introduction^" which is considered the first
textbook solely devoted to the topic. Since 1985, several texts,
collections, and monographs have appeared(f271'(431'(12]'[291, |101,
[28])

In modern engineering and mathematics, computational


geometry has applications in, among other fields, computer
1
^ Introduction

graphics, robotics, computer-aided design, and statistics. The


input to a computational-geometry problem is typically a
description of a set of geometric objects, such as a set of
points, a set of line segments, or the vertices of a polygon in
counterclockwise order. The output is often a response to a
query about the objects, such as whether any of the lines
intersect, or perhaps a new geometric object, such as the
convex hull (smallest enclosing convex polygon) of the set of
points.

One of the new branches which can be studied using the


algorithms of computational geometry is the fractal geometry.

Fractal geometry is a new branch of mathematics used


to model natural objects which cannot be easily represented by
the Euclidean geometry. Although Cantor, Van Koch and
Sierpinski discovered the first fractal objects at the beginning
of the 20th century, the real development of the theory of
fractals was started in the 1970s by a French mathematician of
Polish origin - Benoit Mandelbrot. In 1982, Mandelbrot
published his book "The Fractal Geometry ofNature[U]" that
demonstrated the potential application of fractals to nature and
mathematics. Through his computer experiments Mandelbrot
also developed the idea of reconstructing natural scenes on
computer screens using fractals. Also, the use of a computer
enabled him to create, among the others, a graphical image of
the most famous object of contemporary mathematics, which
came to be called Mandelbrot's set, after its creator.

2
§5 Introduction

Simply defined, fractals are geometric patterns that


exhibit self-similarity on all scales, at any level of
magnification. Fractals achieve self-similarity by being
recursive in nature - each piece of a fractal is defined based
upon other pieces of the fractal. Because more detail may be
revealed at any level of magnification, fractals are often
referred to as "infinitely complex"1401. A canonical example of
fractal geometry in action can be seen in the synthesis of the
Koch snowflake. Rather, fractals simply need to display the
same type of structures on all scales. Most fractals exhibit
approximate self-similarity rather than precise self-similarity,
as seen in the Mandelbrot set.

Approximate self-similarity is a recurring theme in


nature. Many natural forms fit neatly into the paradigm of self-
similarity, including higher plants (such as trees), clouds,
lightning, river networks, and blood vessels. This property is
highly mathematical, and as such, provides a mechanism for
algorithmically defining or simulating natural phenomena.
Fractal objects can be artificially generated using a number of
methods. Two of these methods are Iterated Function Systems
and Lindenmayer Systems.

An Iterated Function System, or IFS for short, is any


system which recursively iterates a function or a collection of
arbitrary functions on some base object. Iterated function
systems are a common method which is used to generate
fractals. This method was conceived in its present form by

3
^85 Introduction

John Hutchison in 19811181 and popularized by Michael


Barnsley's book "Fractals Everywhere^".

IFS fractals can be defined on any number of


dimensions. An IFS fractal is a solution to a recursive set of
equations, and is made up of the union of several copies of
itself, each copy being transformed by a function. The
functions are normally contractive - they bring points closer
together and make shapes smaller. The shape of an IFS fractal
is made up of several possibly-overlapping smaller copies of
itself, each of which is also made up of copies of itself, ad
infmitum, which creates a self-similar structure.

Lindenmayer Systems (L-Systems) are string rewriting


techniques which were introduced by biologist Aristid
Lindenmayer in 1968 as a method to model plant growth1221.
The original emphasis of L-Systems was on plant topology
(i.e. the neighbourhood relations between plant cells).
L-Systems arose from an interest in string rewriting based on
Chomsky's work on formal grammars in the late 1950's[91. The
main difference between Chomsky grammars and L-Systems
is that in Chomsky grammars productions are applied
sequentially as opposed to L-Systems where productions are
applied in parallel.

L-Systems are characterized by an alphabet, an axiom


and a set of production rules, and can be used to generate
fractals. The alphabet is a set of symbols; the production rules

4
^ Introduction

define transformations of symbols into strings of symbols;


starting from an initial string (the axiom), an L-System
constructs iteratively sequences of symbols through
replacement of each symbol by the corresponding string
according to the production rules. The production rules can be
parametric, stochastic, or conditional.

Most L-systems use a Logo-style turtle(I21, f301) as a


geometric interpretation of strings. The concept is based on the
idea of an imaginary turtle that walks, turns and draws
according to given instructions. The state of the turtle is
defined as a set of attributes such as its position and orientation
in the Cartesian coordinate system, its color, its line width, etc.
The symbols from the L-systems alphabet can assign a
command to the turtle like moving forward or backward or
performing an arbitrary rotation in space. Various applications
of L-systems using the turtle interpretation have led to the
generation of fractals and to the realistic modeling of plants.

The vigorous development of the mathematical theory


of L-systems was followed by its applications to the modeling
of plants. These applications gained momentum after 1984,
when Smith introduced state-of-the art computer graphics
techniques to visualize the structures and processes being
modeled1461. Subsequently, Lindenmayer partnered with
Prusinkiewicz, where they conducted research and published
together. They focused on the generation of visually realistic
plant models1341 and published "The Algorithmic Beauty of

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).

Recently L-systems have been used in architecture. One


of the new researches in this field was made by Piotr
Furmanek1141. He presents a modification of L-systems to
generate 3D fractal plant which could be applied as the
supporting construction for polyhedral covers of architectural
objects. The history of applications of fractal geometry to the
analysis of architectural and urban forms is still evolving and
is displaying more promising results see(l?1, [481).

In this thesis, we try to use L-system to generate some


surfaces models for architectural objects with the aid of
computational geometry algorithms.

6
Chapter I
Introduction to
Computational Geometry
^ Introduction To Computational Geometry

CHAPTER 1
INTRODUCTION TO
COMPUTATIONAL GEOMETRY

In this chapter, we will give a brief introduction to the


computational geometry and discuss some of its important
problems.
1.1 Introduction
A large number of applications areas belong to the
domain new recognized as computational geometry. There are
many geometric problems for which efficient algorithms have
to be developed. These problems include the Euclidean
traveling salesman, minimum spanning tree, hidden line, and
linear programming problems, etc.[32].

Computational geometry is a branch of computer


science concerned with the design and analysis of algorithms
that solve geometric problems. The efficient solutions to these
problems are needed for many applications such as computer
graphics, computer vision, robotics, statistics, and database
searching.

It is appropriate to define the basic components of the


language in which computational geometry will be described.
We mean by components algorithms and data structures.

Powered by TCPDF (www.tcpdf.org)

S-ar putea să vă placă și