A p p lie d
S o lid
M o d e llin g
In M in e ra l R e s o u rc e s E n g in e e rin g
A thesis submitted to the University of London (Imperial College Of Science, Technology and Medicine)
by
P eter R o b ert G u sta a f B ak
In fulfilment of the requirements for the degree of Doctor of Philosophy
January 1991
A b s tra c t
The spatial information management systems developed for use in the Minerals industry, al though far in advance of traditional ‘pen and paper’ methods, offer little more than the automa tion of manual processes. There is a need for more sophisticated tools which can assist planners in characterising a subsurface environment and optimising engineering designs. This thesis investigates the application of Solid Modelling techniques in Mineral Resources Engi neering and presents a prototype A dvanced E n g in eerin g G rap h ics In fo rm a tio n S ystem (A E G IS ). The latter employs a hybrid representation scheme which integrates a boundary model with a form of adaptive spatial enumeration known as lin ear octree encoding. Such a scheme is able to model both geometric structure and spatial composition simultaneously and offers advanced functionality including 3D visualisation, integral property calculations and spatial search. The mathematical modelling concepts employed in A E G IS are discussed in detail and algorithms are presented for: • Solid model generation; • Boolean operations on solid objects; • Integral property calculations; • 3D visualisation; • Spatial search; • Model sectioning; • Component contouring. The functionality and validity of the hybrid scheme is verified through practical application. Both synthetic and genuine data sets are modelled and analysed: engineering structures are intersected with geological features, integral properties are calculated, 3D perspective images are generated and spatial queries are performed. The advantages and disadvantages of the modelling techniques are discussed and A E G IS is shown to offer design functions which are new to the Minerals Industry. In conclusion, the application of boundary and octree modelling in alternative disciplines of geoscience is considered and further research is proposed.
1
T h is is a b la n k page.
A c k n o w le d g e m e n ts
The author wishes to thank Dr. Andrew J.B . Mill for initiating this research, offering both advice and support and stimulating intellectual thought. Thanks also go to Dr. Robin Smith whose administrative contribution was invaluable during the former stages of the project. Numerous people have contributed to the reported work and their interest and efforts axe sincerely appreciated. Certain contributions deserve special recognition: • Dr. Irene Gargantini and Harvey Atkinson at the University of Western Ontario. • Professor Tosiyasu L. Kunii at the University of Tokyo. • Dave Steffe and Harry Wilson at B P Minerals Ltd. • Jonathan Raper at Birkbeck College. • Colleagues of the C A D Research Group, Imperial College. The research was funded by the Science and Engineering Research Council, B P Minerals Ltd. and James Capel Co. This funding is appreciated. Finally, sincere thanks are given to the authors parents for their financial and emotional support, the authors wife for the frustration she has had to endure and to Simon GroseHodge for his loyal friendship.
in
T h is is a b la n k page.
C o n te n ts
Glossary
xix
1 Introduction
1
1 .1
Spatial Information Management: A Review .................................................................
3
1.2
Research O b je c tiv e s ............................................................................................................
8
1.3
P la t e s ......................................................................................................................................
11
2 Review and Analysis of Solid Modelling Techniques
15
2.1
Mathematical PointSet M o d e ls........................................................................................
15
2.2
Mathematical SurfaceBased M o d e ls ..............................................................................
17
2.3
Computer Representations..................................................................................................
18
2.4
Decomposition M o d e ls........................................................................................................
21
2.4.1
Primitive Instancing Schem es...............................................................................
21
2.4.2
Space Subdivision S ch e m e s..................................................................................
22
2.4.3
Cell Decom positions..............................................................................................
26
Constructive M o d e ls ...........................................................................................................
27
2.5.1
Sweep Representations...........................................................................................
27
2.5.2
Constructive Solid G e o m e try ..............................................................................
29
Boundary M odels..................................................................................................................
34
2.6.1
Planar Polygon Boundary Models
.....................................................................
34
2.6.2
Curved Surface Boundary Models
.....................................................................
38
2.7
Hybrid M o d e ls .....................................................................................................................
40
2.8
Chosen Solid Modelling Approach
43
2.5
2.6
..................................................................................
3 Boundary Representation in AEGIS 3.1
3.2
45
Model Creation  Surface T rian g u latio n ........................................................................
46
3 .1.1
M apping.....................................................................................................................
50
3.1.2
B ranchin g ..................................................................................................................
51
3.1.3
C a p p in g .....................................................................................................................
53
Model Creation  Description L a n g u a g e ........................................................................
54
v
vi
CONTENTS
3.3
3.2.1
H exah ed ro n s............................................................................................................
54
3.2.2
E llip s o id s ...................................................................................................................
55
3.2.3
Volumes of Revolution............................................................................................
57
P la t e s .....................................................................................................................................
61
4 Adaptive Spatial Subdivision in A E G I S
73
4.1
Linear Octree Encoding  The Mathematical M o d e l .................................................
73
4.2
The Linear Octree Encoding S ch em e...............................................................................
75
4.3
The Linear Octree Data S tr u c tu r e ..................................................................................
77
4.3.1
Octree Attributes.....................................................................................................
78
Linear Octree G e n e ra tio n ..................................................................................................
81
4.4.1
Transformation of the Object S p a c e ..................................................................
84
4.4.2
The Encoding Algorithm
.....................................................................................
85
4.4.3
The Compression Algorithm ..................................................................................
85
4.4.4
Encoding a Block M o d el........................................................................................
86
4.4.5
Encoding of Line Models
.....................................................................................
88
4.4.6
Encoding of Surface M o d e ls..................................................................................
91
4.4.7
Encoding of Solid M o d e ls .....................................................................................
93
4.4.7.1
Octant Connectivity  Te rm in o lo g y..................................................
93
4.4.7.2
Octant Connectivity  Solid M o d e ls ..................................................
95
4.4.7.3
Octant Connectivity  Surface M odels...............................................
95
4.4.7.4
Implementation of the Solid Model Generation P r o c e s s ................... 100
4.4
4.5
4.6
4.7
4.8
Octree M anip ulation............................................................................................................
107
4.5.1
Set Operations on Linear Octree M odels...........................................................
107
4.5.2
Transformations of Linear Octree M o d e ls ........................................................
110
Octree A n a ly sis......................................................................................................................
115
4.6.1
Integral Properties of Linear OctreeM o d e ls......................................................
115
4.6.2
Connected Component Labelling ofLinear Octree M o d e ls ............................
117
4.6.3
Spatial Search
.........................................................................................................
117
4.6.3.1
The Neighbour Finding A lg o rithm .....................................................
119
4.6.3.2
Regular and Irregular Spatial Search.................................................
126
4.6.3.3
Connected Spatial S e a rch .....................................................................
128
Linear Octree D is p la y .........................................................................................................
133
4.7.1 Tracking.......................................................................................................................
138
P la t e s ......................................................................................................................................
139
CONTENTS
vii
5 Practical Application and Assessment of AEGIS
151
5.1
Data S e t s .................................................................................................................................
15 1
5.2
Practical Application..............................................................................................................
153
5.2.1
Model C reatio n ........................................................................................................
153
5.2.2
Model A n a ly s is ........................................................................................................
154
System Assessm ent...............................................................................................................
159
5.3.1
.....................................................................................................
161
5.3.1.1
Boundary M o d e ls ..................................................................................
161
5.3.1.2
Octree M o d e ls ........................................................................................
162
5.3.2
Surface T ria n g u la tio n ...........................................................................................
165
5.3.3
Description L a n g u a g e ...........................................................................................
166
5.3.4
Statistical Gridding
...............................................................................................
166
5.3.5
Geological Process Sim ulation..............................................................................
166
5.3.6
Octree Model Generation Algorithms
..............................................................
167
5.3.7
Boundary Model Modification Functions...........................................................
167
5.3.8
Octree Model Modification Functions
..............................................................
168
5.3.9
Boundary Model Display Capabilities
..............................................................
168
5.3.10 Octree Model Display C a p a b ilitie s.....................................................................
169
5.3 .11 Integral Property C a lc u la tio n s ...........................................................................
170
5.3.12 Spatial Search Functions........................................................................................
170
5.3.13 Tracking.....................................................................................................................
17 1
5.3.14 Spatial and Relational Q u e r y ..............................................................................
172
5.3.15 Geometric Data Conversion..................................................................................
172
5.3.16 Sectioning and Contouring
..................................................................................
173
P l a t e s ......................................................................................................................................
175
5.3
5.4
Model Accuracy
6 Discussion
187
7 Conclusion
191
References
193
A PointSet Topology: Basic Concepts
199
A. l
PointSet Topology............................................................................................................
B Algebraic Topology: Surfaces and Plane Models B. l
199
203
The EulerPoincare Form ula............................................................................................... 207
viii
CONTENTS
C A Basic Reflection Model
211
C .l
Diffuse Reflection.................................................................................................................
2 11
C.2
Specular Reflection..............................................................................................................
2 11
C.3
Ambient Illumination
.......................................................................................................
212
C.4
Depth C u e in g ........................................................................................................................
213
D Effects of Resolution on Octree Model Accuracy
215
E Effects of Scale Factor on Octree Model Accuracy
217
L is t o f F ig u r e s
1.1
U nderground M ine D evelopm ent P h a s e s ........................................................................
2
1.2
E x tran e ity o f Block M o d e ls ..................................................................................................
5
2.1
R eg u larisatio n of a Solid M o d e l ........................................................................................
16
2.2
A S elfIn tersectin g P o ly h e d ro n ...........................................................................................
18
2.3
A N onR ealisable 2  M a n i f o l d ...........................................................................................
18
2.4
A n A m biguous S olid M o d e l ...............................................................................................
20
2.5
P rim itiv e In stan c e o f a P r i s m ...........................................................................................
21
2.6
P rim itiv e In stan c es which are n o t U n i q u e .....................................................................
22
2.7
R egular S p atial Subdivision M o d e l .....................................................................................
24
2.8
A daptive S p atial S ubdivision M o d e l ..................................................................................
24
2.9
C ell D ecom position M odel of a C y l i n d e r ........................................................................
26
2.10 T ra n sla tio n a l Sweep
............................................................................................................
28
2.11 R o ta tio n a l S w e e p ..................................................................................................................
28
2.12 Volume S w e e p .........................................................................................................................
28
2.13 D egeneracy of Sweep M o d e ls ...............................................................................................
29
2.14 C ylindrical H alfSpace M o d e l ...........................................................................................
30
2.15 A C SG T r e e ............................................................................................................................
32
2.16 P olyhedral M odel o f a C u b e ...............................................................................................
34
2.17 F u ll W ingedEdge D a ta S t r u c t u r e .....................................................................................
36
2.18 In co n sisten cy in C SG to B o u n d ary M odel C o n v ersio n
...............................................
38
2.19 C o o n s’ P a t c h .........................................................................................................................
39
2.20 R egular an d Irreg u lar Space C urve N e tw o r k s .................................................................
41
2.21 C oexisting In d e p en d en t H ybrid R ep re sen tatio n A r c h i t e c t u r e s .................................
42
2.22 The B lack Hole E f f e c t .........................................................................................................
43
3.1
G raph R ep re sen tatio n o f A d jacen t C o n to u r L o o p s .........................................................
47
3.2
In itia lisa tio n of T rian g u latio n P r o c e s s ...........................................................................
47
3.3
T rian g u lated S p an n in g S urface
3.4
G raph T heoretic R ep re sen tatio n o f T rian g u la tio n P r o c e s s ...........................................
49
3.5
A Topologically In v alid S p an n in g S u r f a c e ........................................................................
50
...............................................................................
IX
48
LIST O F FIGU R E S
X
3.6
M apping o f A djacent C o n to u r L o o p s ...............................................................................
51
3.7
G en eral B ran ch in g M e th o d ...................................................................................................
52
3.8
M ultiple B r a n c h in g ................................................................................................................
52
3.9
T rian g u latio n of Line S e g m e n t s .........................................................................................
52
3.10 A Surface B o u n d ary with ‘O pen’ E n d s ............................................................................
53
3 .11 A Capped Surface B o u n d a r y ................................................................................................
53
3.12 C oo rd in ate A rray G en eratio n fo r H e x a h e d r o n s ............................................................
55
3.13 C oordinate A rray G en eratio n fo r E l l ip s o i d s ..................................................................
56
3.14 C o o rd in ate A rray G en eratio n fo r Volumes of R e v o lu tio n ...........................................
58
3.15 T ran sfo rm atio n of a Volume of R e v o lu tio n .....................................................................
60
4.1
A P h y sical Object an d the corresponding M ath em a tica l O ctree M o d e l ....................
74
4.2
A n A bstract Octree R e p r e s e n t a t i o n ...................................................................................
76
4.3
A ‘P ru n e d ’ Octree R e p re s e n ta tio n ......................................................................................
76
4.4
O ctal N o t a t i o n ......................................................................................................................
78
4.5
The Octree M ath em atical M odel fo r a Sim ple O b j e c t ..................................................
79
4.6
The A bstract Octree R ep resen tatio n o f a Sim ple O b j e c t ..............................................
79
4.7
M apping of an Object D o m ain to an O ctree U n iv e r s e ..................................................
82
4.8
The B it In terla cin g T e c h n iq u e ............................................................................................
86
4.9
O c ta n t C o m p r e s s io n ............................................................................................................
87
4.10 P ro jectio n of a Line onto an O rthogonal P l a n e ...........................................................
90
4 .11 R asteriz atio n of a L ine using a D ifferen tial A l g o r i t h m ..............................................
90
4.12 R asteriz atio n of a Polygon using a S can C o nversion T e c h n i q u e ..............................
92
4.13 C onnectivity o f O c t a n t s ......................................................................................................
94
4.14 C onnectivity o f L in ear Octree ‘S o lid ’ M o d e ls ..................................................................
96
4.15 C onnectivity o f L in ear Octree ‘S o lid ’ M odels  0 ( 2 )  a d ja c e n c y .................................
97
4.16 C onnectivity o f L in ear Octree ‘S o lid ’ M odels  0 ( 8 )  a d ja c e n c y .................................
98
4.17 C onnectivity o f L in ear Octree ‘S u rfa c e ’ M o d e l s ...........................................................
99
4.18 Solid Model G en eratio n  S et D ifference O p e r a t i o n .....................................................
101
4.19 Solid M odel G en eratio n  C onnected C o m p o n en t L a b e llin g ........................................
102
4.20 Solid M odel G en eratio n  S et Union O p e r a t i o n ...........................................................
103
4.21 C onnectivity o f B ackprojected V oxels ...............................................................................
106
4.22 C onnectivity fo r B ackprojection I n c r e m e n t s ..................................................................
108
4.23 N o n regularity o f C lassical Set O p e r a t i o n s .....................................................................
109
4.24 Venn D iag ram s fo r Octree S et O p e r a t i o n s .....................................................................
Ill
4.25 O ctree Decoding  The B it Unfolding T e c h n iq u e ...........................................................
113
LIST O F FIGURES
xi
4.26 The M o st S ig n ifican t V o x e l ...............................................................................................
113
4.27 Id e n tific atio n o f a C onnected C o m p o n e n t ........................................................................
118
4.28 M ost S ig n ifican t D ig its fo r R ight an d Left N e ig h b o u rs .................................................
120
4.29 M ost S ig n ifican t D ig its fo r D ow n an d Up N e ig h b o u r s .................................................
120
4.30 M o st S ig n ifican t D ig its fo r B ack an d F ro n t N e ig h b o u r s ..............................................
12 1
4.31 The N eighbour o f an O c t a n t ...............................................................................................
124
4.32 A D is ta n t N e ig h b o u r .........................................................................................................
125
4.33 The S licing P r o c e s s ................................................................................................................
13 1
4.34 Search D irectio n s fo r a M odified N eighbour F in d in g A lg o rith m .................................
132
4.35 D im en sio n o f the View V o l u m e .........................................................................................
133
4.36 T ran sfo rm atio n o f th e O ctree U niverse in to the View V o l u m e .................................
134
4.37 An O ctree U niverse Viewed with a known View P la n e N o r m a l .................................
136
5.1
S urface A rea of a T riangle in E uclidean FT S p a c e ........................................................
161
5.2
N o n R ig id R o tatio n o f an Octree M o d e l ........................................................................
169
A .l
A D isk a n d Topologically E q u ivalent F ig u r e s .................................................................
199
A.2
The N eighbourhood o f a P o i n t ............................................................................................
200
A . 3 The N ear P o in ts o f a set S
...............................................................................................
200
B . l C reating a C ylinder fro m a R e c ta n g le ...................................................................................203 B.2
The P la n e M odel o f a C y l i n d e r .........................................................................................
205
B.3
The P la n e M odel o f a S p h e r e ............................................................................................
206
B.4
The P la n e M odel o f a T o r u s ...............................................................................................
206
B.5
The P la n e M odel o f a P ro jectiv e P l a n e ............................................................................
206
B.6
The P la n e M odel o f the C onnected Sum o f two T o r i ......................................................207
B.7
Solids w ith N o n m an ifo ld S u r f a c e s ..................................................................................
208
B . 8 P la n e M odels o f a C u b e .....................................................................................................
209
C . l The E n erg y o f In c id e n t L i g h t ............................................................................................
212
C.2
S pecular R eflection f o r a M irro r S u r f a c e ............................................................................ 212
G.3
Specular R eflection fo r a S hiny S u r f a c e ................................................................................213
L IS T O F F IG U R E S
L is t o f T a b le s
2.1
B o u n d ary R ep re sen tatio n o f a C u b e ..................................................................................
36
4.1
N o ta tio n fo r the L in ea r O ctree E ncoding S c h e m e ........................................................
77
4.2
O c ta n t Labelling fo r F ig u re J ^ . 5 ........................................................................................
80
4.3
C om plete L in ea r O ctree fo r F igure
...........................................................................
83
4.4
L in ea r O ctree fo r a R esolution R = 9 U n i v e r s e ...........................................................
104
4.5
B o u n d ary M odel fo r a R ectan g u lar B o x ...........................................................................
104
4.6
T ransform ed B o u n d ary M odel fo r a R ectan g u lar B o x ...................................................
105
4.7
C ase A nalyses fo r O ctree Set O p e r a tio n s ........................................................................
110
4.8
C ase A nalysis F u n c tio n s to D eterm in e A d jacen t N e ig h b o u r s .......................................... 121
4.9
B it T rend in the M ost S ig n ifican t D i g i t s ........................................................................
122
4.10 P rio rity O rder fo r O c ta n t L a b e llin g ..................................................................................
135
4.11 Visibility o f an O c t a n t ........................................................................................................
137
5.1
C o n to u r D a ta fo r the M olson P r o j e c t ..............................................................................
155
5.2
B o u n d ary M odel D a ta fo r the M olson P r o j e c t ..............................................................
156
5.3
S haft D etails fo r the M olson P r o j e c t ...............................................................................
156
5.4
M olson P ro je c t Block M odel D a t a .....................................................................................
157
5.5
O ctree M odel G en eratio n T im es fo r the M olson P r o j e c t ................................................
158
5.6
O ctree M odel B oolean O p erations fo r the M olson P r o j e c t ............................................
158
5.7
M olson P ro je c t Ore R e s e r v e s ...........................................................................................
159
5.8
C onnected C o m ponents in the M olson P r o j e c t ..............................................................
160
5.9
E rro r E s tim a te s in S urface A rea
.....................................................................................
162
4. 5
D.l
Volume an d S urface
A rea C alcu latio n s fo r an O ctree Encoded T o r u s .................215
D.2
Volume an d S urface
A rea C alcu latio n s fo r an O ctree Encoded S p h e r e ................ 215
D.3
Volume an d S urface
A rea C alcu latio n s fo r an O ctree E ncoded C y l i n d e r ............. 216
D. 4 Volume a n d Surface
A rea C alcu latio n s fo r an O ctree E ncoded P olyhedron
E. l E rro r E stim a te s fo r
an O ctree Encoded Sphere a t R eso lu tio n R = 4 ................... 217
E.2
an O ctree Encoded Sphere a t R esolution R = 5 .........217
E rro r E stim a te s fo r
xiii
. . . . 216
xiv
LIST O F T A B L E S E.3
E rro r E stim a te s fo r an Octree E ncoded Sphere a t R eso lu tio n R = 6 ........................
218
E.4
E rro r E stim a te s fo r an Octree E ncoded Sphere a t R esolution R = 7 ........................
218
E.5
E rro r E stim a te s fo r an O ctree Encoded Sphere a t R eso lu tio n R = 8 ........................
219
L is t o f P r o g r a m s
4.1
A L in e a r O ctree D a ta S tru ctu re Im plem en ted as an A r r a y ........................................
84
4.2
A L in e a r Octree D a ta S tru ctu re Im p lem en ted as a L inked L i s t .................................
84
4.3
The E ncoding A lgorithm using B it I n t e r la c i n g ..............................................................
88
4.4
The O ctree B it U nfolding A l g o r i t h m ..............................................................................
112
4.5
L ist S can A lgorithm to C alculate In teg ral P ro p e rtie s
.................................................
116
4.6
E x tra c t o f A lgorithm to D eterm in e A d jacen t N e i g h b o u r s ...........................................
123
4.7
N eighbour F in d in g A l g o r i t h m ...........................................................................................
127
4.8
A ‘H exahedron’ Search (E n c o d in g )
..................................................................................
129
4.9
A ‘H exahedron’ S earch (N eighbour F i n d i n g ) .................................................................
129
4.10 A ‘L in e ’ S e a r c h .....................................................................................................................
130
4.11 The S licing A l g o r i t h m ........................................................................................................
132
xv
L IS T O F P R O G R A M S
L is t o f P la t e s
1.1
W ire F ram e M odel o f an U nderground M ine L a y o u t ....................................................
11
1.2
S urface M odel of Geological F e a t u r e s ..............................................................................
11
1.3
A n A liased Block M o d e l .....................................................................................................
13
1.4
A n In v alid Solid M o d e l ........................................................................................................
13
3.1
A W arped S urface
...............................................................................................................
61
3.2
A P ris m a tic H e x a h e d ro n .....................................................................................................
61
3.3
A N o n p rism atic H e x a h e d r o n ...........................................................................................
63
3.4
A W arped N o n p rism atic H e x a h e d ro n ..............................................................................
63
3.5
E llip so id P r im itiv e s ...............................................................................................................
65
3.6 S urface o f R e v o lu tio n ............................................................................................................
65
3.7
Volume o f R evolution  The T o r u s ..................................................................................
67
3.8
S p iral o f T r a n s l a t i o n ............................................................................................................
67
3.9
R a d ia l S p i r a l .........................................................................................................................
69
3.10 R a d ia l S p iral of T r a n s l a t i o n ...............................................................................................
69
3.11 A T ransform ed T o r u s ............................................................................................................
71
4.1
A n O ctree M odel o f A P o in t D a ta S e t .............................................................................
139
4.2
A n O ctree M odel o f A P o in t D a ta S et (I n te r io r )
........................................................
139
4.3
A n O ctree M odel o f A C o n to u r D a ta S e t ........................................................................
141
4.4
A n O ctree M odel o f A Topographic S u rfa c e .....................................................................
141
4.5
C om position o f an O ctree M o d e l .....................................................................................
143
4.6
A n O ctree M odel a t R esolution R = 1 ( T ra n sfo rm atio n E x a m p l e ) ............................
143
4.7
A n O ctree M odel a t R esolution R = 7 (S p a tia l S earch E x a m p l e ) ..................................145
4.8
E xam ples o f R egular an d Irreg u lar S p atial S e a r c h e s ....................................................
145
4.9
E xam ples of C onnected S p atial S e a r c h e s ........................................................................
147
4.10 C o n to u rin g a S l i c e ...............................................................................................................
147
4.11 D ep th S hading of a L in ear O ctree M o d e l ........................................................................
149
4.12 F la t S hading o f a L in ea r O ctree M o d e l ...........................................................................
149
5.1
175
B o u n d ary M odel o f the M olson P ro ject M in eralised Z o n e .......................................... XVII
xviii
LIST O F P L A T E S
5.2
B o u n d ary M odel of the M olson P ro je c t U nderground O p e n in g s ..................................
175
5.3
B o u n d ary M odel o f the M olson P ro je c t U nderground U t i l i t i e s ..................................
177
5.4
W irefram e Im ag e o f the M olson P r o j e c t ........................................................................
177
5.5
S haded Im age o f the M olson P ro ject B o u n d ary M odel (V iew 1 ) .............................
179
5.6
S haded Im age o f the M olson P ro ject B o u n d ary M odel ( View 2 ) .............
179
5.7
S haded Im ag e o f the M olson P ro je c t Octree M o d e l ........................................................
181
5.8
S haded Im ag e o f the M olson P ro je c t O ctree M odel ( I n t e r i o r ) ....................................
181
5.9
Im ag e of a G rade C o n to u r O ctree M o d e l ........................................................................
183
5.10 B o u n d ary M odel o f the S leem an P ro je c t T opography ......................................................
183
5.11 B o u n d ary M odel o f the L abatt P ro je c t O p e n  p i t ............................................................
185
5.12 B o u n d ary M odel o f the S leem an P ro je c t Access R a m p ...................................................
185
G lo s s a ry
A E G IS BRep CAD CSG EEC FEM GDM G ID B S G IS GW B Kbytes M IC L M IPS M RE M SB M SD M SV Mbytes RD BM S VPN VRC
Advanced Engineering Graphics Information System Boundary Representation Computer Aided Design Constructive Solid Geometry European Economic Community Finite Element Modelling/ Mesh Graph Data Model GOctree/GQuadtree Image Data Base System Geographic Information System Geometric Workbench Kilo Bytes Mineral Industries Computing Limited Million Instructions Per Second Mineral Resources Engineering Most Significant Bit Most Significant Digit Most Significant Voxel Million Bytes Relational Data Base Management System View Plane Normal View Reference Coordinate
xix
XX
This is a blank page.
Chapter 1
In tro d u c tio n
A quantitative model, including rock property characterisation, for a three dimensional (3D) subsurface environment is a common requirement in many geoscientific disciplines: petroleum reservoir representation to support enhanced oil recovery, ground water contamination modelling at hazardous waste sites and geotechnical site investigation for complex construction projects (Turner, 1989) are some examples. In Mineral Resources Engineering (M RE) such character isation, along with knowledge of the geometric dimensions and spatial relations of subsurface features, is essential for effective resource evaluation, mine design and production planning. In examining the data associated with subsurface features and the development of an under ground mine, it is convenient to distinguish between the preproduction and production phases of an operation. During preproduction geostatistical, geological and economic information, in conjunction with mine planning i.e. surface and underground layouts, process plant design, shaft design and a host of other engineering designs, is appraised to determine project feasibility. Dur ing production phases extraction methods and associated design considerations are modified, in detail, as more accurate information becomes available (Figure 1.1). Such data can be categorised as: G eo lo g ical D a t a  Geological data includes the geometric dimensions, spatial distribution, physical properties and composition of geological features. U t ilit y D a t a  Utility data includes the geometric dimensions and location of mine layouts and engineering facilities. H is to r ic a l D a ta  Historical data includes all time related information such as production and maintenance schedules, costs, economic variables etc. The efficient collection, storage, manipulation and retrieval i.e. in fo rm atio n m an ag em en t, of such data is an essential part of any mining operation. Traditionally, spatial data relating to a mining project are stored and manipulated as manual records e.g. maps, plans, sections, lithological and stratigraphic logs, seismic logs, and engineering drawings. Such nondigital graphical m odels are cumbersome, error prone, inefficient and, by virtue of their two dimensional nature, do not allow effective representation of the true 3D environment. The latter is essential in modelling behavioural phenomenon such as stress in the rock mass and air flow in ventilation circuits. With increased expectations in the evaluation, design and planning processes, there is an obvious need for more advanced methods of spatial information management. 1
C H A P T E R 1. I N T R O D U C T I O N
2
Exploration Geological Survey Geotechnical Survey Remote Sensing Borehole Drilling Sampling Programme
Resource Evaluation Geological Interpretation
Preliminary Mine Design Surface Layouts
Geotechnical Interpretation
Underground Layouts
Geostatistical Analysis
Process Plant Design
Geological Modelling
Shaft Design
Grade Modelling
Architectural Design
Ore Reserve Estimation
Electrical Design
Economic Analysis
Civil Engineering Design
Mining Method Decisions
Mechanical Engineering Design
Production Control Underground Surveying
Production Planning Geostatistical Analysis
Sampling
Dynamic Ore Reserves
Geological Mapping
Economic Modelling
Borehole Logging
Development Scheduling
Advance Measurement
Stoping Scheduling
Environmental Control
Selective Mining Alternatives
Equipment Scheduling
Resource Planning
Production Reporting Maintenance of Equipment
,
Mechanical Engineering Design
Detailed Mine Design Primary Development
Panel and Stope Design
Ventilation
Underground Services
Rock Mechanics
Geological Interpretation
Materials Handling
Equipment Selection
Budgets and Production Costs
Figure 1.1: U nderground M ine D evelopm ent P h a se s
1.1. SPATIAL I N F O R M A T I O N M A N A G E M E N T : A R E V I E W 1.1
Spatial I n f o r m a t i o n M a n a g e m e n t : A
3
Review
With the advent of automated mapping systems, data management tools and advanced com puter graphics, effective spatial information management can be achieved best using computer technology. Over the past 10 years (Rhind, 1989) a host of products have been developed which are referred to generically as G eographic In fo rm a tio n S ystem s (GIS). These systems allow sophisticated resource management of surface features: • automatic map generation; • interactive map modification; • the association of attribute data with spatial entities; • arbitrary scaling; • spatial query; • spatial searches; • the calculation of distances and surface areas. Such functionality offers an immediate improvement upon the traditional management techniques discussed. However, G IS are limited to modelling 2D and 2^D entities and are unsuitable for the representation of a true 3D environment (Turner, 1989; Rhind, 1989). Although there does not exist a system which can apply the functionality of a G IS to a 3D subsurface environment (Raper, 1989; Rhind, 1989; Kelk, 1989), there are a number of systems which offer cogent visualisation and limited analytical capability. Pertinent examples of such systems are discussed: In 1975, Notley and Wilson (Notley et a l ., 1975) developed a system which modelled underground mine layouts as 3D wire fra m e s (see Plate 1.1). A variety of perspective views could be generated using an ordered set of 3D coordinates digitised from plans and sections. Although this system was unable to model geological structures and lacked analytical functionality, it was a precursor to a variety of 3D geological modelling systems. Klein and models to treated as surfaces is
Pflug, at the Geological Institute in Freiburg, have investigated the use of surface represent the subsurface environment (Klein et al., 1989). Geological structures are homogeneous bodies and defined by a surface boundary. The representation of these a ‘mesh’ of polygonal elements which are generated from serial sections using surface tria n g u la tio n methods (Klein et al., 1989). With advanced computer graphics techniques, such polygonal meshes can be visualised as shaded perspective images. By utilising a number of light ing models, transparency techniques and depth cueing the ability to perceive shape is enhanced, as shown in Plate 1.2. A similar system to that of Klein and Pflug, called G Q C A D ™ , has been developed at the Ecole Nationale Superieure de Geologie. Instead of using polygonal elements, this system represents geological structures as a mesh of curved surface patches. The latter are generated by discrete sm ooth in te rp o la tio n of physical geological properties such as porosity (Mallet, 1989). This
C H A P T E R 1. I N T R O D U C T I O N
4
approach has the joint advantage of defining surface boundaries from ‘continuous’ data, rather than discrete serial sections, and allowing interactive model modification. Although the Klein/Pflug and G O ^ A D ™ systems exemplify current visualisation and model creation functionality, surface models are limited in their ability to represent geological prop erty variation within heterogeneous bodies. Such bodies are an integral part of any subsurface environment and can be represented using volume models. A common method of modelling volume is to decompose an environment of interest into a set of discrete disjoint blocks. Each block, which has a known size and location, is assigned a set of attribute values. The latter may include any of the previously mentioned data types i.e. geological, utility, or historical. Such a model is referred to as a block model. Unlike surface models, block models define explicitly the composition of space and can represent heterogeneous bodies. By utilising variable block sizes, such models can also represent structural boundaries, although only approximately. Furthermore, integral properties are computationally simple to calculate and, if attribute data are manipulated using a re la tio n a l d atabase m a n a g e m e n t sy stem (RDBM S) (Henley et al., 1988), it is possible to perform sp atial query , such as: • “What rock type is at a given point?”. • “What is the distance between two points?”. • “Identify all regions with a grade value greater than ‘x’ grammes per tonne?” . • “Where is electrical substation No. A ?”. • “When was Diamond Drill Hole No. E65 drilled and by whom?”. Such query is an essential requirement in the evaluation, design and planning of a mining project. Although block models have numerous advantages over surface models, the use of discrete 3D units to represent 2D surfaces has certain limitations: G e o sta tistica l In te g rity  Optimum block dimensions determined using geostatistical con siderations may be too coarse to accurately represent structural boundaries. Conversely, block dimensions suitable for modelling structural detail may result in a false impression of geostatistical integrity (Houlding, 1987). M in e L a y o u t A p p ro x im atio n  The dimensions of existing mine layouts are measured to an accuracy of 0.1 metre while the locations of survey control points are measured to an accuracy of 0.006 metre (Bak, 1987). Maintaining such accuracy in a block model is impractical as large computer memory requirements reduce computational efficiency; mine layout representations are approximate. For example, consider a project which has 10 kilometres of tunnels with a 5 metre X 6 m e tre crosssection. The number of blocks required to model the surface of these tunnels, to an accuracy of 0.1 metre, is « 5.3 million, as illustrated in Figure 1.2. Such a model requires « 5.3 M bytes of computer memory, assuming only one byte of data per block, and « 2 1.2 M bytes of computer memory, assuming one 32 bit integer per block.
1.1. SPATIAL I N F O R M A T I O N M A N A G E M E N T : A R E V I E W
5
In d ire c t M o d el C reatio n  Surface boundaries of geological structures are, presently, defined using either process simulation techniques (Thiessen et a l ., 1986) or semiautomated con struction methods (Lynx, 1988; Klein et a l ., 1989). Both approaches generate surface models which are converted to block models through ra s te riz a tio n 1 (Kaufman, 1987). As yet, no algorithms have been reported which can directly generate the block model of a geological surface boundary from ‘raw’ data e.g. drill logs. P o o r V isu a lis a tio n  The discretisation of space into a finite number of ‘blocks’ generates an aliased , or undersampled, image. Such visualisation is less cogent than for a surface model, as is illustrated by the example block model in Plate 1.3.
6m @ 0.1 m accuracy = 30 units 5 m @ 0.1 m accuracy = 25 units 10 km @ 0.1 m accuracy = 50,000 units Total = (((30 + 25) x 2)  4) x 50,000 = 5.3 million
Figure 1.2: E x tran e ity of Block M odels These limitations can be overcome by integrating a block model with a surface model. Such an approach has been taken by a number of groups. Notable examples are Mineral Industries Computing Ltd. (M ICL) and Lynx Geosystems Inc. The M IC L D a ta m in e system, which uses triangular meshes, or w irefram e models12, to represent mine openings and geological structures, achieves integration by converting surface models into block models (Henley et al ., 1988). Although this approach improves model creation and visu alisation, analytical functions, which are performed on block models only, suffer approximation error.
1A general discussion on rasterization techniques is given in Procedural Elements for Computer Graphics (Rogers, 1985). A specific example of such a technique is presented in Section 4.4.5. 2M ICL use the term ‘wireframe’ to describe their implementation of surface models. This is incorrect termi nology as the Datamine system treats each triangle in a surface mesh as a planar polygon. Such a mesh contains surface information which, by common definition, is contradictory to a wireframe model: the correct term is boundary representation, as will be discussed in Chapter 2.
C H A P T E R 1. I N T R O D U C T I O N
6
The L ynx system avoids approximation error by treating surface and block models as independent entities. Mine openings and geological structures are represented by three parallel planes spaced at finite thickness intervals: solid m odel com ponents (Houlding, 1987). The intersection of such components with blocks does not require surface to block model conversion and, thus, the benefits of both modelling approaches is ensured without loss of accuracy. Although both the D a ta m in e and Lynx systems offer true 3D spatial data management ca pabilities, the surface modelling techniques employed neither support Boolean operations nor consider the concept of so lid ity 3; invalid solid models are easily generated. The latter may be selfintersecting, unbounded i.e. the surface boundary is not continuous, or suffer interference, as shown in Plate 1.4. Such characteristics result in design errors which include: • incorrect volume and mass calculations; • misleading visualisation i.e. incorrect plans and sections; • contradictory results from spatial queries. To overcome these problems, a number of researchers have investigated the use of solid m odelling techniques. The most notable of these include Karonen (1985) at the Helsinki University of Technology, Kavouras (1987) at the University of New Brunswick and Curran (1989) at the University of Toronto. Curran has applied A u to S o lid ™ to numerous mining projects. This system is based on a solid modelling technique known as C o n stru ctiv e S olid G eo m etry4 . Although the latter ensures model validity and allows both effective visualisation and integral property calculations, model creation and modification becomes prohibitively complex as the geometric complexity of the subsurface environment increases (Curran, 1989). The D aedalus system, developed by Kavouras (1987), uses a technique known as O ctree E ncoding which is a form of block modelling. By utilising variable sized blocks and recursive decomposition of space, a maximum model dimension of 225 x 225 X 225 units can be achieved. This enables the system to represent any complex geometric structure to an accuracy56of 0.006 metre at a scale of 1 in 200,000 (Kavouras, 1987). Unlike the Constructive Solid Geometry technique, the computational complexity of model creation, which is achieved using a d escrip tio n lan g u ag e6 and through conversion from a surface model (Smart, 1986), is independent of geometric complexity. Furthermore, because space is recursively decomposed, homogeneous and heterogeneous entities can be represented in the same ‘octree’ model at different resolutions; the encoding technique offers all the benefits of block modelling yet, ensures both model validity and geostatistical integrity and reduces approximation errors associated with modelling mine layouts.
3The definition of ‘solidity’ is presented in Chapter 2 . ^Constructive Solid Geometry is discussed in Chapter 2 . 5Practical experience, as discussed in Section 5.3.1.2, indicates that this claim is dubious. 6A description language allows the automatic creation of regular geometric shapes using mathematical con structs and parametric variables.
1.1. SPATIAL I N F O R M A T I O N M A N A G E M E N T : A R E V I E W
7
One characteristic of the octree encoding technique is that blocks are spatially indexed using a hierarchical encoding scheme. Such indexing allows any block in the model to be accessed efficiently and, therefore, facilitates a number of spatial searches (Kavouras, 1987): • interactive data retrieval using a graphical interface; • range retrieval i.e. identify all defined entities within a specified region of space; • closest neighbour analysis i.e. given a point in space, identify the closest entity of interest. Kavouras has claimed that these searches improve significantly the design process and, with fur ther development and application, can assist in the determination of optimal solutions (Kavouras, 1987). Examples of such applications include identifying surface boundaries, simulating particle or fluid flow and connected com ponent labelling. The latter is an image processing technique used to identify discrete homogeneous components and their spatial distribution. Although the D aed alu s system offers certain advanced functionality, the visualisation of octree models is computationally expensive and time consuming. Dedicated hardware is required to achieve display times comparable with those for surface models (Kaufman et a l., 1988). Karonen overcomes the problems of both A utoS olid ™ and D aedalus by integrating a variant of the octree encoding technique with a surfacebased solid modeller known as the G eom etric W orkbench (G W B ). The latter models the surface boundary of homogeneous entities using ver tices, edges, faces and construction functions called E u ler operators (Karonen, 1985). These operators ensure that models are valid and that model creation and modification tasks, although computationally complex, are interactive and ‘transparent’ i.e. easy for the user to perform. As with the Klein/Pflug system, the G W B allows cogent visualisation but is unable to model heterogeneous bodies. Furthermore, integral property calculations within the G W B are compu tationally expensive requiring the solution of the integral:
1=
f f JS
(?) dp
where S is a solid and / (p ) is a function defining the set of points p within S . These limitations are overcome by converting the surface models to bintree models using a p o in tin p o ly h ed ro n test (Karonen, 1985). Bintree encoding is similar to octree encoding and offers equivalent functionality. The difference between the two techniques lies in the method of subdivision which is binary for the bintree and 8ary for the octree. Karonen’s method of integration does not utilise the full potential of the bintree encoding tech nique as most modelling functions are performed on the surfacedbased solid models; bintree encoding is only used to represent heterogeneous entities and to perform integral property cal culations. This approach excludes such functionality as spatial search and increases overall computational complexity (Karonen, 1985). In summary, the spatial information management systems developed for use in the Minerals industry, although far in advance of the traditional ‘pen and paper’ methods, offer little more than the automation of manual processes. One exception is the D aedalus system which allows spatial searching. The latter cannot, realistically, be performed without computer technology and, as discussed, assists in the determination of optimal design solutions. There is an obvious need to
C H A P T E R 1. I N T R O D U C T I O N
8
further investigate the application of solid modelling techniques in mineral resources engineering and to determine new functionality which will improve both subsurface characterisation and mineral extraction. 1.2
Research Objectives
The objective of this research is to investigate current solid modelling theory and to identify a technique, suitable for the representation of 3D geoscientific environments, which is mathe matically robust and offers sufficiently wide functionality to be of use in all aspects of mineral resources engineering. Such a mandate requires the development of generic algorithms which can be tailored to the needs of each contributing discipline; problem specific functions are too numerous to achieve generality. With reference to the systems discussed in the previous section and given current computer technology, the generic algorithms of interest can be categorised as: M o d e l creation  There are three distinct methods of model creation: • S urface trian g u latio n : Surface triangulation of 2D contours and structural outlines is an effective method of generating 3D surface boundaries of geometrically complex homogeneous entities. • D e sc rip tio n language: A description language, which includes both functional and procedural modelling methods, allows the automatic creation of regular geometric shapes using mathematical constructs and parametric variables, is an effective method of generating the 3D surface boundaries of objects which cannot be defined as a series of 2D contours or sections e.g. a spiral access ramp. • S ta tistic a l gridding: The variation of mineral content or rock property within the subsurface environment is commonly determined using extension methods such as inverse distance weighting and geostatistical interpolation. Other methods, which are not considered in this thesis, include geological structure defini tion through process simulation and interactive boundary definition using a m a n m a c h in e in terface.
M o d e l m o d ificatio n  Modification functions are essential for updating and changing existing models. Such functions include Boolean set operations , rigid tran sfo rm a tio n s, thresholding and blending fu n c tio n s. The latter allow the moulding of new parts onto existing 3D geometries while thresholding is a method of compositing variables into ranges. V is u a lis a tio n  An effective method of validating the geometry of an object or verifying a design is through cogent visualisation. Such visualisation includes: • 3D orthographic and perspective display; • hidden line and surface removal; • light source simulation; • shading; • transparency control;
1.2. R E S E A R C H OBJECTIVES
9
• view transformation. A n a ly sis  A number of generic functions should be implemented to assist in analytical opera tions. Such functions include: • In teg ral property calculation: Integral property calculations determine volume, mass and surface area of both homogeneous and heterogeneous entities. • S p atial search: Spatial search functions are valuable in determining object interfer ence, the distribution of homogeneous parts within a heterogeneous environment i.e. connected com ponent labelling, connected paths through the model and the spatial relation between entities i.e. adjacency. • S p atial query.
• R e latio n al query. • G eom etric D a ta C onversion: Conversion between model formats allows the integra tion of various design functions. For example, stress analysis in rock mechanics and ground water flow and transport study require spatial information in the form of fin ite /b o u n d a ry elem en t m eshes. Similarly, production scheduling and ventilation cir cuit design utilise directed graphs and crosssectional areas: numerous design functions require geometric information. • S ectio n in g an d contouring: Working plans, maps, sections and engineering drawings are used to assist in the design process. It is essential, therefore, to be able to sec tion a model in any orientation and to contour any entities within the subsurface environment. To maintain generality, the modelling approach must take into consideration certain spatial characteristics associated with a subsurface environment: G eom etric C o m p le x ity  Geological structures and surface boundaries defined by threshold ing techniques, have irregular shapes which are difficult to represent using mathematical primitives; they are geom etrically complex. R e so lu tio n C o m p le x ity  The dimensions of structural features and the volume of rock asso ciated with a known geological property, determined by sample density and interpolation methods, vary greatly within a subsurface environment. Such variation is referred to as reso lu tio n complexity.
C o m p o sitio n a l C o m p le x ity  Geological property variation within a subsurface environment is extremely complex. Most features are heterogeneous and can only be discretised through thresholding; they are com positionally complex. In a c ce ssib ility  A subsurface environment is inaccessible without extensive excavation. In formation characterising such an environment is, therefore, incomplete and, sometimes, conflicting. In fulfilling these objectives, the contribution of this research to the applied earth sciences will be a greater understanding of the spatial complexities of a 3D subsurface environment and an A d v a n c e d Engineering Graphics Information S y s t e m (A E G IS) which offers generic functionality. The latter has application in a variety of geoscientific disciplines including Mining, Petroleum, Geotechnical and Environmental engineering, among others.
C H A P T E R 1. I N T R O D U C T I O N
10
This is a blank page.
1.3.
PLA TES
1.3
Plates
11
Plate 1.1: Wire F ram e Model of an U nderground M ine L ayout
Plate 1.2: Surface Model of Geological F eatu res (K lein , 1 9 8 9 )
CHAPTERL
12
This is a blank page.
INTRODUCTION
1.3. PLATES
13
Plate 1.3:
Plate 1.4:
A n A lia s e d B lo ck M o d el
A n In v a lid S o lid M o d e l  T h e ‘re d ’ c o m p o n e n t in te rfe re s w ith th e ‘g re e n ’ c o m p o n e n t
C H A P T E R 1. I N T R O D U C T I O N
14
This is a blank page.
Chapter 2
R e v ie w a n d A n a ly s is o f S o lid M o d e llin g T e c h n iq u e s
Solid m odelling is a body of theory and techniques which attempts to represent the geometric dimensions and spatial relations of physical ‘solid’ objects in such a way as to allow arbitrary geometric interrogation. The latter separates solid modelling from other forms of 3D modelling which tend to focus on specific points of interest (Mantyla, 1988). For example, visualisation is best achieved using shape m odels while surface properties are best represented using su rface m odels. Both these forms of modelling represent objects by their bounding surface and do not consider the internal volume.
To be able to analyse the functionality of the various solid modelling techniques it is important to understand the underlying theory. Many papers have been written on specific aspects of this theory, however, only a few have attempted to embrace it in its entirety. One such text, A n In tro d u c tio n to Solid M odelling by Martti Mantyla (1988), offers a succinct presentation and is the basis for the following discussion. Solid modelling can be perceived at three different levels (Requicha, 1980; Mantyla, 1988): 1. P h y sic al Objects: A physical object is a real world entity which exists in Euclidean 3D space ( E 3) and has infinite complexity. 2. M ath em a tica l Models: A mathematical model is one which idealises the so lidity of a physical object. Such a model should offer an intuitively clear understanding of the physical object and allow an ‘algorithmic’ study of its physical properties. 3. R ep resentations: A representation is an abstract concept which describes a mathematical model by means of notation and sem an tics. The latter define rules which associate the notation with geometry. Intuitively, a physical solid object is a portion of E 3 which has a known composition, a bounding surface and Euclidean properties, specifically volume. Such an intuitive characterisation is not mathematically robust and, thus, solid modelling theory utilises pointset and algebraic topology1 to qualify the concept of solidity (Mantyla, 1988; Requicha, 1980).
2 .1
M a th e m a tic a l P o in tS e t M odels
The most general mathematical model of a solid object is a subset of E 3 : a set of points. Intuitively, such a set should be a single entity of finite dimension and have a continuous surface. 1Basic topological terms and concepts are presented in Appendices A and B. A more detailed explanation of the theory of topology is given in A Combinatorial Introduction to Topology (Henle, 1979).
15
16
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
A : Object with ‘dangling’ surface and line
B : Regularised solid object —‘dangling’ surface and line are removed
Figure 2.1: R eg u larisatio n o f a S olid M odel Using pointset topology, this intuitive concept of a solid can be formally stated as (Mantyla, 1988): D e fin itio n 2 .1 A so lid is a bounded, closed an d connected subset o f E z. The class of point sets permitted by this definition includes all ‘solid’ sets. However, it also includes subsets of E 3 which do not have the Euclidean property of volume, such as points, lines and surfaces. To exclude such subsets from the notion of solidity, the latter can be further characterised using the concept of regularity (Requicha, 1980; Mantyla, 1988): D e fin itio n 2.2 The reg u larisatio n o f a p o in t set P , r ( P ) , is defined by
r ( P ) = c (> (P ) ) where c (P ) is the closure o f P a n d i (P ) is the in te rio r o f P . Such a se t is term e d a regular set.
The effect of regularisation is that all ‘dangling’ and ‘isolated’ parts of a point set are cut away to leave a set with a continuous surface or skin (Mantyla, 1988; Requicha, 1980). This is illustrated in Figure 2.1. Requicha (Requicha, 1977) summarises a bounded, closed, connected and regular subset of E 3 as an rset. In the natural world a solid physical object has Euclidean properties which are independent of location and orientation; the object remains invariant under rig id tra n sfo rm a tio n s i.e. translations and rotations. Obviously, rsets which model physical objects should have a similar characteristic. Mantyla formely defines rig id ity as (Mantyla, 1988): D e fin itio n 2.3 A rigid m odel is an equivalence class o f p o in t sets o f E 3 sp an n ed by the equiva lence relatio n o ; L et A a n d B be subsets o f E 3. T hen A a rig id tran sfo rm atio n .
o
B holds iff A can be m apped to B with
2.2. M A T H E M A T I C A L S U R FACE  B A S ED M O D E L S
17
One characteristic of an rset is that, although it is a finite portion of space, it has infinite complexity. Such complexity can not be represented in a computer using direct methods and al ternative indirect methods must be employed. This requirement is referred to as re p re s e n ta tio n a l fin ite n e ss and can be achieved by further qualifying the concept of solidity using su rfacebased m odels (Mantyla, 1988; Requicha, 1980; Baer et al ., 1979).
2.2
Mathematical SurfaceBased Models
Surfacebased mathematical models describe the surface boundary of a physical object by “a collection of faces which are glued together so that they form a complete, closing polyhedron or ‘skin’ around the object” (Mantyla, 1988). Using algebraic topology, this informal concept of a surface boundary can be formally stated as (Mantyla, 1988): D efin itio n 2.4 The surface boundary o f a so lid is a com pact, connected a n d o rien tab le 2m anifold.
The topological properties of 2manifolds are well understood and are succinctly expressed by the EulerPoincare formula:
F + V E
=
2(S  H )
(2.1)
where F , V and E are the number of faces, vertices and edges in a polyhedron, S is the number of connected surfaces and H denotes the genus of the surface or the number of holes through the body. A detailed discussion on the EulerPoincare formula is given in Appendix B. Intuitively, the surface boundary of a physical solid object should not intersect itself. Although Definition B.5 (Appendix B) enforces this characteristic topologically, certain surface boundaries, by virtue of Mobius’ rule, can be made to intersect themselves by the physical dimensions of the geometry used to embed them in E 3. This is illustrated in Figure 2.2. No purely topological condition can prevent selfintersection (Baer et al ., 1979); a surface boundary must be further characterised: D efin itio n 2 .5 T he su rface boundary o f a solid can n o t be selfin tersectin g . If the surface boundary of an rset P, 6 (P ), is a compact, connected, orientable and nonselfintersecting 2manifold M, P is a re alisa tio n of M in E 3: P is a m an ifo ld solid. Assuming this terminology and the above definitions, all surface boundaries have a realisation in E 3. However, not all rsets are realisations of some surface boundary i.e. they do not obey the EulerPoincare formula, as illustrated in Figure 2.3 (Mantyla, 1988). Such rsets are referred to as n o n m an ifo ld solids.
The bounding surface of a nonmanifold solid is not a 2manifold and, as such, cannot be di rectly modelled using topological properties. To overcome this problem, present practice treats such solids as the rigid combination of manifold solids. One method of determining these man ifold components is presented in G eom etric a n d Solid M odeling: A n In tro d u c tio n by Hoffman (Hoffman, 1989). Having characterised the concept of solidity and defined a suitable mathematical modelling space it is now possible to consider appropriate computer representations.
18
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Figure 2.2: A S elfIntersecting P olyhedron
2.3
C o m p u t e r Representations
There are a number of approaches to representing solid models in a computer. These approaches differ in the modelling spaces, representation spaces and re p resen ta tio n schem es they support. To be able to discuss these differences and to determine the functionality of each approach it is important to define some desirable properties and associated terminology: Representation Space  Syntactically correct representations are finite structures constructed with symbols from an alphabet of syntactical rules. The collection of all syntactically cor rect representations is called a rep resen ta tio n space R . An element of R is a re p resen ta tio n r (Requicha, 1980). M o d ellin g Space  A m ath em atical m odelling space M is one whose elements are the mathe matical models of solids. An element of M is a solid m odel m (Requicha, 1980; Mantyla, 1988).
Representation Scheme  A representation scheme s is a relation between the elements of M and R (Requicha, 1980): s : M y R
2.3. C O M P U T E R R E P R E S E N T A T I O N S The notation {m ,r } 1988).
19
Es denotes that r ER
is the image of m
EM
under s (Mantyla,
D o m a in  The d o m ain D of s is the set of physical objects which can be modelled in the space M.
R an g e  The range V of s is the set of solids m which can be represented in R. V a lid R e p resen tatio n  A representation r in the range V belongs to R and has corresponding elements in D . Such a representation is said to be valid (Requicha, 1980). U n am b ig u o u s R epresen tation  A representation r in V is said to be unam b ig u o u s if it corresponds to a single model in D (Mantyla, 1988): (m , r} £ s A (m ,) r }
Es
=>
m = m1
U n iq u e R ep resen tatio n  A representation r in V is said to be unique if the corresponding model in D has only one representation in V (Mantyla, 1988): {m, r}
Es A
{ m ,r '}
Es
=>■
r = r'
Using the above terminology some desirable properties can now be presented: 1. E xpressive Power: The expressive power of a representation scheme is determined by the extent of the domain D and the accuracy to which the elements of the domain can be modelled mathematically. 2. Validity: The validity of a representation scheme is determined by the extent of the range V . It ensures the integrity of representations and prevents the creation and manipulation of meaningless solid models. 3. Unambiguity: A representation scheme is unambiguous if all its valid representations are, themselves, unambiguous. Unambiguity ensures that a representation contains sufficient information to uniquely compute any mathematical property of the corresponding solid model. For example, an ambiguous representation may have multiple values of volume while its unambiguous counterpart will only have one such value. This is illustrated in Figure 2.4. 4. Uniqueness: A representation scheme is unique if all its valid representations are, them selves, unique. This property determines the equality of solid models. For example, a unique representation will be independent of orientation whereas a nonunique representa tion will change with orientation (Mantyla, 1988). 5. C onciseness: The conciseness of a representation scheme is determined by the amount of information required to represent a particular solid model. Generally, concise schemes are preferable as validity is easier to ensure and computer storage is minimal. However, in many practiced situations selective extraneity improves computational efficiency as relevant information need not be derived (Requicha, 1980).
6.
C losure o f O perations: If model creation, modification and manipulation operations pre serve the validity of representations they are said to close. If such operations do not close the validity of a representation scheme is not ensured.
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
20
7. E ase o f Solid M odel C reatio n : The ease with which valid representations can be created is of obvious importance. Generally, schemes utilise d escrip tio n languages to reduce human interaction. The effectiveness of such languages is determined by how concise a solid model can be described and the robustness of validity checking mechanisms.
8.
C o m p u ta tio n a l E ase a n d A pplicability : The application of a representation scheme to a
given problem is determined by many of the properties presented above and the complexity of computing a solution. For example, it may be computationally simple to generate an image of an ambiguous representation yet, extremely difficult to calculate its volume.
Having presented some desirable properties of representation schemes it is possible to analyse the functionality of the various solid modelling techniques commonly used. According to Requicha (Requicha, 1980) there are six such techniques. Mantyla (Mantyla, 1988) categorises these into three generic classes:
1.
Decomposition Models.
2. Constructive Models. 3. Boundary Models. Multirepresentational or hybrid models are a fourth class which employ several of the generic models simultaneously.
2.4. D E C O M P O S I T I O N M O D E L S
21
(‘prism’, n, r,
Figure 2.5: P rim itiv e In stan c e o f a P ris m 2.4
Decomposition Models
Decomposition models describe solids as a collection of primitive point sets which are ‘glued’ together. The type of primitive point sets used distinguishes between variations of the method. 2.4.1
Primitive Instancing S c h e m e s
The primitive are positioned represented by be represented
instancing technique models a physical object by families of point sets which in E 3 without intersection. Each member of a family, a p rim itiv e in s ta n c e , is a fixedlength tuple of values. For example, instances of the family of prisms can by tuples of the form: (p r is m , n, r, h )
where p r is m is a character string signifying the family, n is the number of sides and r and h are the radius and height of the circumscribing cylinder (Figure 2.5). Positioning of an instance is achieved by a rigid transformation which can be represented by a fivevalue tuple: (9 ,< j> ,8 x ,8 y ,8 z )
where 6 and
are the angles of azimuth and elevation and 8x ,8 y and 8z are the translations along the x ,y and z axes. A distinguishing feature of primitive instancing schemes is the lack of means for combining instances to form more complex models. Generally, the latter are created by positioning each instance appropriately i.e. without intersection. This feature, along with a number of other characteristics, limits the value of such schemes. E xpressive power: The domain D is determined, primarily, by the families of instances. The latter are restricted to shapes which are mathematically understood; natural parameterisation of complex objects is difficult. Combinatorial operations also influence the domain but, as already discussed, they are limited. Validity: If each family is a valid solid then the validity of each instance can be ensured by simple enforcement algorithms. For example, the parameters of the tuple (p r is m , n , r, h ) must satisfy
22
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
the fo llo w in g in e q u a litie s to ensure v a lid ity :
n r h
U n a m b ig u ity :
> > >
3 0 0
In s ta n c e s are u n a m b ig u o u s as each tu p le re p re se n ts a u n iq u e s o lid m o d e l: p r im itiv e
in s t a n c in g sch e m e s are u n a m b ig u o u s.
U n iq u en ess:
In sta n c e s are n o t u n iq u e as c a n be d e m o n s tra te d b y an e x a m p le . C o n s id e r th e tw o
in sta n c e s ( T —
b r i c k , l , h l , h 2,w 1,w 2 )
and
(b lo c k ,? , h ' , w ’)
a s illu s tr a te d in F ig u r e 2.6 ( M a n t y la ,
1988). G iv e n th e fo llo w in g c o n d itio n s, the tu p le s rep re se nt the sa m e s o lid m o d e l:
1=
1'
hi h2 — h1 vol — w 2 — w 1 Conciseness : P a r a m e tric re p re se n tatio n is concise. Closure of operations: O p e r a t io n s are clo se d if p r im itiv e s are p o s it io n e d w it h o u t in te rse c tio n . C om putational ease and applicability: T h e m a th e m a tic s fo r c a lc u la t in g th e p r o p e r tie s o f a n in sta n c e are w e ll u n d e rsto o d .
U n fo rtu n a te ly , each fa m ily o f in s ta n c e s re q u ire s a d iffe re n t c a l
c u la tio n fo r s im ila r p ro p e rtie s and, therefore, fa m ily s p e c ific k n o w le d g e m u s t be b u ilt in to the a p p ro p ria te a lg o r ith m s . T h is n o n u n ifo rm m e th o d o f c o m p u t a t io n re q u ire s ne w a lg o r it h m s for every a p p lic a tio n a n d for each p rim itiv e .
2.4 .2
S p ace S ubdivision Schem es
In S e c tio n 2.1 a so lid m o d e l w a s defined in te rm s o f a m a t h e m a t ic a l p o in t set. B e c a u s e o f the in fin ite c o m p le x ity o f su ch a m o d e l it is n o t p o ssib le to lis t each p o in t in th e set. I t is p o ssib le , how ever, to lis t the set o f cu b e s or
units of space w h ic h are c o n ta in e d c o m p le te ly, or p a r tia lly , in
the m o d e l. I f these cu b e s are a ssu m e d to be n o n o v e rla p p in g a n d o f u n ifo r m size a n d o rie n ta tio n the re su ltin g m o d e l is a
regular subdivision o f sp ace a n d is c a lle d an exhaustive enum eration.
F ig u r e 2.7 sh o w s the re g u la r s u b d iv is io n m o d e l o f a c y lin d e r.
A: Tbrickprimitive
F ig u r e 2.6:
B :Block primitive
Prim itive Instances which are no t Unique
23
2.4. D E C O M P O S I T I O N M O D E L S
A cube can be represented by its eight corner points. In an exhaustive enumeration cubes have regularity and need only be defined by a single corner or centroid and a dimension. By imposing a specific spatial scanning order the {x, y, z } coordinates of each representative point can be mapped to an {t,y, k} element of a binary array such that the value of an element identifies the occupancy state of the corresponding cube. For example, one convention may associate the decimal value 1 with a ‘solid’ cube and a decimal value of 0 with an ‘empty’ cube. Such binary arrays are often referred to as sp atial arrays. Exhaustive enumerations are simple in concept and have a general domain. The latter is, however, approximate as surfaces of the object boundary that are not coplanar with the coordinate planes of the modelling space cannot be modelled precisely. Although this is limiting for certain applications, spatial arrays utilise integer arithmetic allowing a wide variety of algorithms to be performed with computational ease. The most restrictive characteristic of exhaustive enumerations is the massive memory required to model objects with any degree of accuracy. For example, assume the cylinder in Figure 2.7 to have a radius of 10m, a height of 30m and a central axis which is parallel to one axis of the modelling space. The memory requirements and associated extraneity2 for different modelling spaces would be: Modelling Space (unit3)
Dimension of Cube mxm Xm
Extraneity
Volume Error
Memory Required Kbits
300 60 30
0.1 x 0.1 x 0.1
35.8 % 36.0% 3 7 .3 %
2.57% 3 .13 % 6.95%
27,000 216 27
0.5 x 0.5 x 0.5 1.0x 1.0 x 1.0
Both the problems of memory and extraneity can be overcome by utilising the spatial coherency of solid objects. A daptive subdivision schemes achieve this by changing the size of each unit of space to fit the object of interest; a coherent region can be modelled by a few large cubes rather than many small cubes. Meagher (Meagher, 1982) has shown that for adaptive subdivision the number of cubes (or elements) required to model an object is proportional to the surface area of the object while for regular subdivision the number of elements required is proportional to the volume. A prime example of an adaptive subdivision scheme is the Octree rep resen tatio n which recursively subdivides the modelling space into eight equal sized cubes or octants. This recursive process is applied to those octants which lie on the surface boundary of the object i.e. those that are neither wholly inside nor wholly outside the boundary. Figure 2.8 is an adaptive subdivision model of the cylinder in Figure 2.7. The representation of an octree model is a hierarchical 8ary tree. Each octant in the model is symbolised by a node in the tree where a node consists of an integer value and eight pointers. As with spatial arrays, the integer value identifies the occupancy of the associated octant. For example, if the octant is fully occupied by the object the integer value is set to ‘1 ’ and if it is not occupied by the object the integer value is set to ‘O’. Such octants, being homogeneous, are not further subdivided and their pointers are set to ‘nil’. If the octant lies on the surface boundary of the object it is subdivided in eight smaller octants and the pointers of the node will point to 2Extraneity is a measure of conciseness. For a block model this is the ratio: number of occupied cubes / total number of cubes in spatial array.
24
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Figure 2.7: R egular S p atial Subdivision M odel
Figure 2.8: A daptive S p atial S ubdivision M odel
2.4. D E C O M P O S I T I O N M O D E L S
25
these eight sons. The integer value is set appropriately. Figure 4.2 (in Chapter 4) illustrates a tree structure representing an octree model. An alternative to the pointer based method of octree representation is a lin e a r octree representa tion. This technique uses a p ath address which identifies the position of a node in the tree without the need for pointers3. The main advantage of this approach is that memory requirements are reduced by up to 8 0 % of a pointer based octree model (Gargantini, 1982). There are a number of variations to the octree concept of adaptive subdivision. One example is the bintree (Samet et a/., 1985) which recursively subdivides space into two equally sized units rather than eight cubes. These variations have similar properties to the octree scheme and are, therefore, not discussed. A good review is given in The D esign an d A n aly sis o f S p a tia l D a ta S tru c tu re s (Samet, 1990). One characteristic of spatial subdivision schemes is that the composition of a point in E 3 is known. This allows effective spatial search including p o in t/so lid , cu rv e/so lid and s u r f a c e /so lid classification4 (Hoffmann, 1989), border determination and identification of connected compo nents. In general, spatial subdivision schemes have properties favourable to a wide variety of applica tions. Certain characteristics have, however, limited their popularity. E xpressive power: As discussed, physical objects are modelled with a degree of approximation. Given this restriction, spatial subdivision schemes have an extremely general domain. Validity: Each unit of space in a subdivision scheme is a valid solid model and, therefore, all such schemes are valid. Due to the complexity of connectivity, however, a physical object may not be a single valid model but a combination of several valid models. This is discussed in Section 4.4.7. U nam biguity a n d Uniqueness: All spatial subdivision schemes are unambiguous and, for a fixed
resolution, are also unique. C onciseness: As discussed, exhaustive enumeration is not concise. Even though adaptive subdi vision schemes reduce memory requirements they are not considered to be concise. C losure o f operations: With both regular and adaptive subdivision schemes most operations are closed when applied to models which map onto the same region of E 3. One operation which is not closed is arbitrary rotation; units of space which are rotated by an angle that is not a multiple of 90° will not be coplanar with the coordinate planes of the initial modelling space. E ase o f so lid m odel creation: Model creation is based on conversion from other representation schemes. An alternative approach, which identifies the occupancy of space using interactive graphics techniques, has been developed by Yamaguchi (Yamaguchi et a l ., 1984). Intuitively, this method is restrictive and time consuming. C o m p u ta tio n a l ease a n d applicability: Spatial subdivision schemes have computationally simple algorithms involving list scans, tree traversals and case analyses. However, due to the size of model representations, many algorithms are slow. This reduces the applicability of such schemes as interactive functionality is a primary requirement in working environments.
3A d e ta ile d d iscu ssio n on lin e a r octree rep resen tation is given in C h a p t e r 4. 4
E n t it y c la s s ific a tio n d e te rm in e s w heth er the e n tity o f in terest exists w ith in a so lid o r k n o w n re g io n o f E 3 .
S u c h sea rch fu n c tio n s are d iscu ssed , w ith respect to lin e a r octree e n c o d in g , in S e ctio n 4.6.3.
26
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
2.4 .3
C ell D eco m p o sitio n s
Cell decomposition schemes are similar to space subdivision schemes in that they model an object by discrete units of space, or cells, which are nonoverlapping. The latter, instead of being a cube or a rectangle, can be any solid model which is topologically equivalent to a sphere. Figure 2.9 is a cell decomposition model of the cylinder in Figure 2.7.
Figure 2.9:
C e ll D e c o m p o sitio n M o d e l o f a C y lin d e r
Cell decomposition schemes have the advantage of offering a general domain without approx imation. However, if cells have surface boundaries which are not planar it is computation ally difficult to ensure validity and to calculate geometric properties. Such schemes have a limited application.
E x p re s siv e p o w er: As stated, the domain of cell decomposition schemes is general. If curved surfaces define the boundary of each cell the domain is exact up to the degree of the cells, typically quadratic (Mantyla, 1988). V alidity: A valid cell decomposition model has cells which are nonoverlapping i.e. they must be either disjoint or connected by a corner point, an edge or a face. To ensure validity every pair of cells must be tested for intersection. For cells with nonplanar faces, such as biquadratic surface patches, this can be a computationally expensive process.
U n a m b ig u ity a n d U n iq u en ess: A valid cell decomposition model is unambiguous but not unique (Mantyla, 1988; Requicha, 1980).
C o n c ise n e ss: Cell decompositions are relatively concise. A common representation consists of a list of 3D coordinates, defining c o n tro l p o in ts , and a list of cell e le m e n ts. Each cell element has a type code, which defines a parametric equation describing the element, and a set of pointers which identify the associated control points5 stored in the coordinate list. A typical example is a quadratic cell which might have 20 control points and two type codes defining a quadratic curve and a biquadratic surface patch (Mantyla, 1988).
5C o n t r o l p o in ts , also referred to as k n o t s , d eterm ine the shap e of a lg e b ra ic curves a n d su rfa ces. T h e la tte r are fu r th e r d iscu ssed in S e c tio n 2.6.2.
2.5.
C O N ST R U C TIV E M O D ELS
27
C losure o f operations. In general, the mathematics for modifying cells with curved elements are either unknown or computationally expensive (Mantyla, 1988); closure of operations cannot be considered. E ase o f solid model creatio n : Intuitively, interactive generation of models with ‘curved’ cells is
complex as the validity of such cells is difficult to ensure. As with space subdivision schemes, cell decompositions are created by conversion from other representations. C o m p u ta tio n a l ease an d applicability: The difficulty of ensuring validity and the computational
complexity of model modification limits the general application of cell decomposition schemes. The use of algebraic curves and surfaces is, however, of value in determining the numerical solution of differential equations. One such application is Finite Element Modelling (FEM ). 2.5
Constructive M o d e l s
As with decomposition schemes, constructive models describe solid objects as a collection of primitive point sets. The construction operations used to combine these primitives are, however, more general including Boolean operations and rigid transformations. Variations of the method are distinguished by the type of primitive point sets used. 2.5.1
S w e e p Representations
The basic concept of sweep representation schemes is to create a solid model by sweeping a contour along a space curve. The primitive point set defined in this way can be represented by a set of parameters describing the contour and the space curve. There are three basic models which can be created by sweeping: 1. T ran slatio n al an d R o ta tio n a l Sweep Models: Consider, as an example, a closed curve which delimits a disk. If it is translated along a straight line segment the resultant model is a solid cylinder which can be represented by a radius r and a length l: a translational sweep as illustrated in Figure 2.10. A disk swept along an arbitrary spline: a g en eralised cy lin d er , is another example of a translational sweep model. If the curve is rotated about a local coordinate axis the resultant model is a solid torus which can be represented by a radius r and an angle of rotation 6: a rotational sweep as illustrated in Figure 2 .11. 2. Volume Sweep Models: A volume sweep model is one in which a parameterised volume is swept along a space curve. To illustrate such a model consider the torus in Figure 2 .11. It could be created by sweeping a sphere of radius r along a closed space curve of radius r f as illustrated in Figure 2.12. 3. G en eral Sweep Models: A general sweep model is one in which a space curve is swept along another space curve. Intuitively, sweep representations have a general domain which is exact. Unfortunately, it is difficult to ensure the validity of this domain as degeneracy is easily created. To illustrate degeneracy consider two examples: If a planar area A ,with a fixed orientation, is translated along a path P that has a tangent parallel to the plane containing A, then the interior of the resulting volume m a y have selfintersections.
28
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Figure 2.10: T ra n sla tio n a l Sweep
Figure 2 .11: R o ta tio n a l Sweep
angle 0
Figure 2.12: Volume Sweep
2.5. C O N S T R U C T I V E M O D E L S
2 9
A : Degeneracy of a rotational sweep through selfintersection
B : Degeneracy of a translational sweep resulting in a 2D object
Figure 2.13: D egeneracy o f Sweep M odels If the path P is, itself, parallel to the plane containing A, then the resulting sweep model will be two dimensional. Figure 2.13 depicts these two examples. In general, there is no closedform mathematical description of the surface bounding a swept volume (Requicha, 1980; Hoffmann, 1989). For example, the cylinder in Figure 2.10 is bounded by finite areas on two linear surfaces and on one quadratic surface. Although rigid transformations can be readily performed on such models, Boolean operations are computationally complex and the mathematics of integral property calculations are unknown (Requicha, 1980); sweep representation schemes have limited application. 2.5.2
Constructive Solid G e o m e t r y
The C on stru ctiv e Solid G eom etry (CSG) representation schemes model physical solid objects as either Boolean constructions on primitive point sets or as combinations of solid components via regularised se t o p erations 6. In both approaches the model primitives are defined by irreducible polynomial functions which are analytic and realvalued (Requicha, 1980; Mantyla, 1988): (z,t/>*)  f { x , y , z ) > 0 Such primitive point sets are referred to as halfspaces as all the points which satisfy the function / (x, y, z ) > 0 are in the set of interest while those that satisfy the function / (x, y, z ) < 0 define its compliment; space is divided into two distinct regions. If a function defines a finite pointset, such as a sphere, it is both bounded and an rset: it is a solid component. If, however, a function defines an infinite point set, such as a planar halfspace, the primitive is unbounded and, therefore, is not an rset. Solid components can be created by combining such halfspaces using classical Boolean operators. For example, consider a cylindrical solid component C . The latter can be constructed by combining two planar half6Regularised set operations, denoted by U*, fl* and \ * , are regularitypreserving variants of the classical Boolean operations. They are further discussed, with respect to linear octree encoding, in Section 4.5.1.
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
30
F ig u r e 2.14:
Cylindrical HalfSpace Model
sp a c e s a n d o n e c y lin d r ic a l h a lfsp a c e u s in g a series o f in te rse c t o p e ra to rs ( M a n t y la , 1988) a s d e p ic te d in F ig u r e 2.14:
H S 1 : x 2 + y2  r 2 < 0 HS2 : z > 0 H S 3 : z —h < 0 C = HS, n H S2 n H S3 w h e re r a n d
h are th e r a d iu s a n d h e ig h t o f th e c y lin d e r, re spe ctive ly.
H a v in g d e fin e d a n u m b e r o f s o lid c o m p o n e n ts, a so lid m o d e l c a n be c o n stru c te d b y c o m b in in g the c o m p o n e n ts u s in g re g u la rise d set o p e ra to rs a n d r ig id tr a n s fo rm a tio n s .
S u c h m o d e ls are,
gen erally, re p re se n te d in tw o p a rts:
1.
Com ponent representation: A s w it h p r im itiv e in sta n c e s, a c o m m o n m e th o d o f re p re se n tin g a h a lfsp a c e is b y a ty p e cod e a n d a lis t o f size p a ra m e te rs. A n a lte rn a tiv e m e t h o d is to define a p o ly n o m ia l fu n c tio n in m a t r ix fo r m ( M a n t y la , 1988):
A12 A22 •^31 A32 A 4l A42 A ll
/(x,y,z) =
[x y z 1]
A 21
■^•13 A ia A23 A24 A33 A34 A43 A44
x y
z
1
and store the 16 coefficients, Ayy, or the 10 coefficients derived by evaluating the matrix products, in an array or list structure. This method is not concise.
2.5. C O N S T R U C T I V E M O D E L S
31
2. C o n stru c tio n o p erato rs representation: Construction operations are represented by a binary tree structure called a CSG tree. The nonterminal nodes of this tree represent either
rigid transformations or regularised set operations while leaf nodes represent the primitive components (Requicha, 1980; Mantyla, 1988): ( C SG tree)
::=
{p rim itiv e ) ( C SG tree){set o p eratio n ){ C S G tree ) {CSG tree){rig id m o tio n )
where {p rim itive) is a component representation, {rigid m o tio n ) is either a translation or a rotation and {set op eratio n ) is one of the regularised set operations U"',n* and \*. A CSG tree is illustrated in Figure 2.15. If a primitive in the C S G tree is the combination of a series of unbounded halfspaces, it can, itself, be represented by a C S G tree where (p rim itiv e ) is an unbounded halfspace and {set o p eratio n ) is one of the classical Boolean operations U ,n and \ . Such a C S G tree may be used many times in the tree representing a complete solid model. The hierarchical nature of C S G representations lends itself to algorithms which utilise a d iv id ean d co n q u er strategy. The latter divides a problem into a number of parts, recursively solves each part and combines the partial solutions to obtain the total solution. The computational efficiency and functionality of this approach has made C S G schemes one of the most widely used solid modelling techniques (Requicha, 1980; Mantyla, 1988). Some properties of C S G schemes do, however, restrict their use in certain ‘volume investigation’ applications such as medical angiography (Greenberg et al., 1989) and petroleum reservoir modelling (Jones, 1988). E xpressive power: The domain of a C S G scheme is dependent on the halfspaces which define the primitive solid components and the available combinatorial and transformational operators. Given the variety of possible halfspaces and the rigorous mathematics of these operators, such a domain is both extensive and exact. Validity: If a C S G tree has primitives which are all bounded (rsets) it will be a valid repre sentation as neither regularised set operations nor rigid transformations destroy boundedness (Mantyla, 1988). This is only true, however, if the operators are general and can be applied to all the primitives in the domain.
If the primitives of the tree are unbounded validity is difficult to ensure requiring algorithms78 which are both memory and time intensive (Hoffmann, 1989). U nam biguity a n d Uniqueness: All valid C S G trees are unambiguous but not necessarily unique (Requicha, 1980; Mantyla, 1988). C onciseness: The conciseness of a C S G scheme varies according to the available primitives and the geometric complexity of the physical solid object. In general, mechanical parts can be represented concisely while natural objects, such as subsurface geological features and human organs, which axe geometrically complex, cannot.
Another factor which affects conciseness is the amount of attribute information required for graphical display. Edges and faces are not explicitly defined in a C S G model. As their de termination is computationally complex, requiring either ray casting or boundary ev a lu a tio n *, 7O n e m e th o d o f lo c a tin g th e in te rse ctio n s o f fam ilies o f surfaces is to use G r o b n e r b a se s te c h n iq u e s . T h e s e are d iscu ssed in G e o m e t r ic a n d S o lid M o d e lin g : A n I n t r o d u c t i o n ( H o ffm a n n , 1989). 8R a y c a s tin g a n d b o u n d a r y e v a lu a tio n te ch n iq u e s are w ell d o c u m e n te d a n d are n o t d iscu ssed in th is thesis.
32
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Figure 2.15: A C SG Tree
2.5. C O N S T R U C T I V E M O D E L S m o s t C S G sc h e m e s m a in t a in a S e c tio n 2.6) o f th e object.
33
b o u n d a ry file
w h ic h is a
b o u n d a ry r e p re s e n ta tio n
(d isc u sse d in
S u c h a file in c re a se s th e a m o u n t o f d a t a s to re d a n d d e cre ases the
degree o f c on cise n e ss.
C lo su re o f o p e ra tio n s:
A s th e c o n s tr u c tio n o p e ra to r s in a C S G m o d e l m u s t be c lo se d to ensure
v a lid ity , C S G re p re se n ta tio n s are closed .
E a s e o f s o lid m o d e l c rea tio n :
S o lid m o d e l c re a tio n is fu n d a m e n t a lly
an
in te ra c tiv e p ro c e ss u t ilis in g
e ith er a t e x t u a l la n g u a g e , m a t h e m a t ic a l c o n s tr u c ts o r g r a p h ic a l interfaces.
F o r e x a m p le , the
m o d e l in F ig u r e 2.15 c o u ld b e c re a te d u s in g th e fo llo w in g te x t u a l la n g u a g e : B lo c k
:
H e ig h t  1
L e n gth  4
W id t h  4
P y r a m id
:
H e ig h t  1
L e n gth  4
W id t h  2
C y lin d e r
:
A x is  Z
R a d iu s  1
H e ig h t  1
T r a n s la t e P y r a m i d in X : 1 T r a n s la t e C y lin d e r in Y : 2 T r a n s la t e C y lin d e r in X : 5 B lo c k u n io n P y r a m id m in u s C y lin d e r o r th e m a t h e m a t ic a l c o n s tr u c t (H o ffm a n n , 1989): (b lo c k ( 1 , 4 , 4 )
U* x tra n s la te
( p y r a m id ( 1 , 2 ) , 1)) \ *
x t r a n s la te ( y tr a n s la te (z c y lin d e r ( 1 , 1 ) , 2 ), 5) A m o re a lg o r it h m ic c re a tio n p ro c e ss e x tru d e s 2 D se c tio n s o f o bje cts in d e p th to fo r m a 3 D so lid w h ic h is p a r s e d a u t o m a t ic a lly in to c o m b in a t io n s o f p r im itiv e c o m p o n e n ts (B r o w n , 1982). W it h m o d e rn g r a p h ic s te c h n o lo gy , m a n y r e g u la r sh a p e s, su c h a s m e c h a n ic a l p a r ts , c a n b e cre ate d w ith re la tiv e ease. F o r g e o m e tric a lly c o m p le x s h a p e s these m e t h o d s are c u m b e rso m e .
C o m p u ta tio n a l e ase a n d a p p lica b ility :
C S G sch e m e s are b a s e d o n a rig o ro u s m a t h e m a t ic a l b a c k
g r o u n d a n d , th u s, th e ir fu n c tio n a lit y is extensive. C o m m o n to m a n y o f th e se fu n c tio n s are the
s e t m e m b e rs h ip c la s s ific a tio n 9
a lg o r it h m s w h ic h u tilise th e d iv id e a n d c o n q u e r stra te g y .
T h e se
a lg o r it h m s are c o m p u t a t io n a lly efficient for C S G trees th a t are w e ll b a la n c e d i.e. th e p r o b le m can be s p lit in to p a r t s o f e q u a l size ( M a n t y la , 1988). I f the tree is n o t b a la n c e d th e c o m p le x ity o f the c o m p u t a t io n c a n in cre a se ra p id ly . O n e e x a m p le w h e re t h is h a s a d is tin c t effect is in c a lc u la t in g in te g ra l p ro p e rtie s:
f
J A u*B
fd V = { fd V + [ fd V JA
f
J a \b
JB
fd V =
f
Ja
w h e re / is a s im p le readvalued s c a la r fu n c tio n ,
dV
dV  [ fd V J A n*B A
and
B
are p o in t se ts re p re se n tin g a s o lid a n d
is th e v o lu m e diffe re n tial. T h e m a in p r o b le m is s o lv in g a n in te g ra l ove r th e in te rse c tio n o f
a n a r b it r a r y n u m b e r o f p r im itiv e s (L e e
et
a/., 1982); th e m o re im b a la n c e d th e tree, th e gre ate r
th e in t e r a c tio n be tw e e n p r im itiv e s a n d th e gre a te r th e c o m p u t a t io n a l lo a d (Le e
e t a l .,
1982).
®The set membership classification algorithms classify a candidate point set C against a reference point set R by determining which parts of C are inside, on the boundary and outside of R\ three sets CinR^ C on R and C ou tR (Mantyla, 1988). The mathematics of these algorithms have been widely reported and are not discussed in this thesis. A detailed explanation is presented by Tilove in Set membership classification: a united approach to geometric intersection problems (Tilove, 1980).
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
34
Figure 2.16: P olyhedral M odel o f a Cube
2.6
Boundary Models
Both decomposition and C S G schemes model physical solid objects as point sets. An alternative approach is to model the solidity of an object by describing its surface boundary: a boundary model. Such a surface can be regarded as a ‘mosaic’ of faces which satisfy certain topological criteria and have a compact mathematical representation: a boundary re p re se n ta tio n or Brep. (Mantyla, 1988). In general, faces are either p la n a r polygons or p aram eterise d bicubic surface patches.
2.6.1
Planar Po ly go n B o u n d a r y M o d e l s
In a planar polygon boundary model, also referred to sis a polyhedral model, faces are planar polygons described by a set of straight lines, or edges. The latter are, themselves, described by two 3D coordinates, or vertices as illustrated in Figure 2.16. The simplest representation of a polyhedral model, the explicit polygon Brep. (Foley et al., 1982), is a list of vertex coordinates where the sequential order of the coordinates indicates the connectivity of vertices and edges. Consider the cube in Figure 2.16. The explicit polygon representation would be:
2.6. B O U N D A R Y M O D E L S
35
F ace
V e rte x c o o rd in a te s
A
( ( * i, y i, * i) ( ( z 2, y 2, z 2)
A
( ( * 6 , y 6 , z 6)
(x 2yy2 jz2) (x 3 iy6 iz6) ( s 5,y s ,z 5)
A
( ( * * , y 5, z 5)
(* i,y i,* i)
A
((so y *,**)
A
( ( * 2 , y 2, z 2)
A
( s 3, y 3,23)
(X4,!/4,Z4)) ( Z 3,!/3,Z3))
(z 3,y 3,z 3)
(x 7,y 7,z 7) (x 3y y 8, z3) (*4 ,y 4 ,z 4) ( x7,y 7>z7)
(* i,y i,* i)
( x 5, y s , z s)
(* e , y « ,* « ) )
( z 7, y 7, z 7))
(x 3,y 3, z 3) ) (x 8 ,y s ,z 3))
S u c h a re p re se n ta tio n is n o t c o n c ise a s the c o o rd in a te s fo r each v e rte x are s to re d th re e tim es. T h is e x tra n e ity c a n be e lim in a te d b y u s in g a
vertexbased B re p . in w h ic h th e c o o r d in a t e s o f
each ve rte x are o n ly s to re d once a n d are referenced b y a se t o f p o in te rs:
V e rte x
V e rte x
num ber
c o o rd in a te s
t>i
(* i,y n * i) ( x 7 iy2 iz2)
v2 t>3 ^4 v6
v7 t>8
{x3,y 3>z3) (x 4 ,y 4 ,z 4) (x 3 ly3 )z3) {x6,y 6,z 6) {x7>y7, z7) {x3yy3,z 8)
Face
V e rtic e s
A
(vi» V2, v 3, u 4)
A
(v 2, v 6, v 7, v 3)
A
(t>6, v 5, v 8, v 7)
A
(v s,v x ,t;4,t;8)
A
(V4,V3,V 7, V 8)
A
{v2, v1, v3, v 6)
T o p o lo g ic a l p ro p e rtie s are re p re se n te d im p lic itly in b o t h th e e x p lic it a n d v e r te x b a s e d m o d e ls. T h e se p ro p e rtie s c a n b e c o m p u t a t io n a lly e x p e n sive to d e te rm in e a n d a s th e y are r e g u la r ly u se d in m a n y o p e ra tio n s, su c h a s v a lid it y c h e c k in g , h id d e n su rfa c e re m o v a l a n d se t m e m b e r s h ip c la s s i fic a tio n s, th e ir e x p lic it re p re se n ta tio n is d e sirable . T h e
wingededge d a t a s tru c tu re , d e v e lo p e d b y
B a u m g a r t ( B a u m g a r t , 1974), ac h ie ve s th is b y re p re se n tin g faceface n e ig h b o u r h o o d s a n d p o ly g o n o rie n ta tio n : a n
edgebased B re p .
A c c o r d in g to D e fin itio n B . 4 ( A p p e n d ix B ) e very edge e in a re a lisa b le p la n e m o d e l is id e n tifie d e x a c tly tw ice a n d , th u s, a p p e a r s in e x a c tly tw o faces; tw o o th e r e d ge s
e1 a n d e" m u s t a p p e a r e o c c u rs
after e in th ese faces ( M a n t y la , 1988). F u rth e rm o re , a s e ach face is c o n s iste n tly o rie n te d ,
e x a c tly once in a p o s itiv e o rie n ta tio n a n d e x a c tly once in a n e g a tiv e o r ie n ta tio n ( M a n t y la , 1988). T h e w in g e d e d g e d a t a s tr u c tu re re p re se n ts these p ro p e rtie s by:
• o rie n tin g a n e d ge b y d e fin in g a s ta r t a n d end vertex; • la b e llin g th e tw o faces, in w h ic h a n ed ge ap p e a rs, as e ith e r
clockwise o r counterclockwise
a c c o rd in g to the o rie n ta tio n o f th e edge; • id e n tify in g th e tw o e d ge s w h ic h a p p e a r before a n d afte r a n e d ge fo r e ach a s s o c ia t e d face: ‘n e x t ’ a n d ‘p r e v io u s ’ e d ge s in b o t h th e c lo ck w ise a n d c o u n te rc lo c k w ise faces; • re c o rd in g a n ed ge or
handle fo r each face.
T h e fu ll w in g e d e d g e d a t a s tr u c t u r e is d e p ic te d in F ig u r e 2.17 a n d illu s t r a t e d b y th e re p re se n ta tio n o f th e e x a m p le c u b e in T a b le 2.1.
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Figure 2.17: F u ll W ingedEdge D a ta S tru c tu re edge
vstart v e n d
few feew
pew new
ei
vi
V2
fl
f«
e
e2
V2
V3
fl
f2
e
fs
e
e3
V3
V4
e4
V1
V4
fl f4
f4
f x
e5
V2
V5
f6
e6
V2
V6
f2
f6
V8
f4
f5
e7
V4
\
2
eS e
peew neew
e2
e6
es
e3
e8
e6
e4 e7
e7
e8
e3
ei
e9
e4
e2 e4
e io
e l2 e9
e l2
en
e3
en
e io
e2
ei
e8
V3
V7
fs
f2
e9
V5
V6
f6
f3
e3 e5
e6
e io
V7
f2
f3
e6
e8
en
e i2 e9
f3
e7
e 12
e io
f4
e8 e9
e il
e7
es
e io
V6
e ll
V7
V8
f5
e i2
V5
V8
f3
vertex
handle
coordinates
V1
ei
( xi y izi)
face
handle
V2
e2
( x2 y2 z 2)
fl
ei
V3
e3
( x 3 y3 z s)
f2
e2
V4
e4
( x4 y 4 z 4)
f3
e9
V5
e9
( x5 y5 z 5)
U
e5
V6
e io
( x6 y 6 z 6)
fs
e il
V7
en
( x 7 y? z 7 )
f6
e6
V8
e i2
00X 00 00N
36
Table 2.1: B o u n d ary R ep re sen tatio n of a Cube using the W ingedEdge D a ta S tru ctu re
2.6. B O U N D A R Y M O D E L S
37
The edgebased representation described ensures that a polyhedral model is topologically valid; every edge can be appropriately identified by ‘tracing’ every face in the model. To illustrate this procedure consider face / 5 in Table 2.1. The handle edge (en ) has a clockwise orientation for the face and, thus, the next edge (new) is e7. Similarly, the edge next (neew) to e7 is e3. The latter has a counterclockwise orientation for face / 5; it is next to e8 (neew). The next edge in the polygon is en which is the handle: every edge in the face has been identified once. Although topological validity is ensured, the representation does not ensure g eo m etric in teg rity (Mantyla, 1988) i.e. by assigning inappropriate geometric information to a topologically valid surface boundary selfintersection can occur. This characteristic demands alternative validity checking algorithms which are computationally expensive. As polyhedral models describe surface boundaries using planar polygonal elements, cogent visu alisation is easily achieved. This has strongly influenced the popularity of such models in many computer graphics applications. Certain properties, however, have restricted their use in more analytical applications. E xpressive p o w er : The domain of a polyhedral Brep. scheme is extensive as the polygons can be nsided and positioned in any orientation. However, such a domain is not necessarily exact as a polyhedral model consists of planar faces. Validity: Topological validity of polyhedral models can be attained simply by ensuring that the
EulerPoincare formula is satisfied. This can be achieved by using an appropriate representation such as the wingededge data structure. As indicated, validity is also determined by geometric integrity which requires that (Requicha, 1980): • vertex coordinates must represent a single point in E s; • edges must be disjoint or intersect at a common vertex; • faces must be disjoint or intersect at a common edge or vertex. These conditions require set membership classifications which are computationally expensive (Requicha, 1980; Tilove, 1980; Mantyla, 1988) U nam biguity a n d Uniqueness: All valid polyhedral Brep. schemes are unambiguous but not necessarily unique (Requicha, 1980; Mantyla, 1988). C onciseness: To ensure validity a polyhedral Brep. records face, edge and vertex neighbour hoods. Such a representation is extraneous and is, in general, not considered to be concise (Requicha, 1980; Mantyla, 1988). C losure o f operations: If a polyhedral model is a valid solid model, rigid transformations will
close. Set operations, however, may not close; both classical and regularised Boolean operations are based on topological theory and do not consider geometric integrity. E ase o f solid m odel creation: The construction of any reasonably complex polyhedral model is beyond the capabilities of most users (Mantyla, 1988). Model creation is achieved by means of:
D e scrip tio n Lan gu ag es  A description language uses textual and mathematical constructs to generate a polyhedral model of a known mathematical shape. Such languages, which are similar to those used in C S G schemes, are difficult to implement as rigorous controls are required to ensure model validity. An example of a description language is discussed in Section 3.2.
38
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
Surface T ria n g u la tio n s  The surface boundary of many solid objects can be represented by a set of co n to u r strin g s. If the points on these strings are connected in a controlled fashion it is possible to generate a polyhedral model: su rface trian g u latio n . Such models are approximate as the initial data is incomplete (except for rectilinear shapes such as cubes). A surface triangulation algorithm is discussed in Section 3.1. C o n ve rsio n from C S G  Conversion from C S G models, also referred to as boundary ev alu a tio n , is a common method of model creation. Unfortunately, the available domain offered by this approach is limited as many C S G models are difficult to realise in a Brep. scheme (Mantyla, 1988). For example, the object in Figure 2.18 can be represented in a C S G scheme as the difference of two cylinders. As a polyhedral model, however, this object is difficult to represent; the edge where the two cylinders touch appears in four faces and is not topologically valid.
Figure 2.18: In co n sisten cy in C SG to B o u n d ary M odel C onversion C o m p u ta tio n a l ease a n d applicability: As stated, the validity of polyhedral models is difficult to ensure, requiring set membership classifications. The latter, also used in Boolean operations, axe not difficult conceptually, but their implementation is complex; primitive geometric and topological operations must be designed for all the possible positions of incidence (Hoffmann, 1989). Furthermore, as classification algorithms require numerical techniques, the precision and stability of calculations are not guaranteed (Hoffmann, 1989). These characteristics have limited the use of polyhedral Brep. schemes in analytical applications.
2.6.2
C u r v e d Surface B o u n d a r y M o d e l s
In a curved surface boundary model faces are parametric bicubic surface patches which are described by known points, vectors and curves. Intuitively, such patches are unit squares of elastic material which twist and distort in space to fit a part of the surface of the physical solid object. By using blending and in terp o latio n equations these patches can be joined to make a ‘mathematical quilt’: the surface boundary of the solid object (Krouse, 1981). A surface patch is a finite region of space. The x, y and z coordinates of each point in this space can be expressed by a thirdorder or cubic polynomial of two (b i ) parameters s and t: a parametric bicubic surface patch. The form of the parametric equation x (s,£) is:
2.6. B O U N D A R Y M O D E L S
3 9
an s3£3 + a 21s 2t 3 + a 31s t 3 + a 4lt 3 +
a l2s 3t 2 a 22s 2t 2 a 32st a 42t 2
+ + + +
a l3s st CL2 3 s t a 33s t a 43t
+
+ + +
a 14s 3 a 24s 2 a 34s
+ + +
a 4A
The equations y (s, t ) and z (s , t) have similar forms. Varying both parameters from 0 to 1 defines all the points on the patch (Foley et al ., 1982). The sixteen bicubic coefficients can be expressed in terms of four control points and their asso ciated tan g en t vectors. The latter indicate the slope of the surface in the x, y and z directions at the known points. This is illustrated by the C oons’ patch (named after the late Steven Coons) in Figure 2.19 (Foley et al ., 1982).
s
Figure 2.19: C oons’ P atch The mathematics of calculating bicubic coefficients is discussed in many texts and, therefore, there is no need for further explanation. One such text is C om putational Geometry for Design and M anufacture (Faux et al ., 1979). The simplest representation of curved surface boundary models is an array of control points and associated tangent vectors. The number of control points required for each patch is determined by the form of the bicubic polynomial. For example, the H erm ite form requires only four points while both the B ezier and Bspline forms require twelve points (Foley et al., 1982). In general, such a representation is more concise than a polyhedral representation. Another advantage of curved surface Brep. schemes over polyhedral Brep. schemes is that the domain is both extensive and exact: control points and tangent vectors can be manipulated to fit precisely the surface of the physical solid object of interest. Unfortunately, these advantages are severely compromised by the increased computational complexity of analytical functions:
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
40
B o o lean O p erations  Common to all Boolean operations is the problem of identifying the intersection of two or more surfaces. One approach to solving this problem is curve tracin g (Hoffmann, 1989): Construct a local approximation, such as a curve tangent, at a point p on the curve of intersection of two or more surfaces. Estimate the next point on the curve by stepping along the approximation. Refine the estimate using an iterative method. The approximant used at a curve point p is a truncated Taylor expansion of the intersec tion and the estimated next point is refined using the NewtonRaphson method (Hoffmann, 1989). Both the latter and the Taylor expansion are numerical methods which are compu tationally time consuming and sensitive to hardware precision. In te g ral P ro p e rtie s  Integral properties can be calculated by either applying the divergence theorem 10 to a polyhedral approximation of the curved surface (Lee, 1982) or performing an approximate integration over the curved patches (Timmer et a/., 1980). Both approaches introduce errors which have not been analysed fully. The construction of a curved surface model is, generally, a complex process involving the gener ation of surface patches from a space curve netw ork (Kimura, 1984). The latter is a ‘mesh’ of parametric cubic curved line segments. These curves, which are the edges of parametric bicubic surface patches, are generated by interpolating between control points10 11 The latter are either user defined or generated by other systems. For example, the G O C A D ™ system generates a space curve network by converting a contour data set into a triangulated network and interpolating between vertices (Mallet, 1989). Generating surface patches from a space curve network is computationally complex and requires a regular mesh. If the mesh is irregular, as illustrated in Figure 2.20, the generation process is extremely difficult. There is, as yet, no adequate mathematical theory for handling such cases (Kimura, 1984; Mallet, 1989). The difficulty of model creation, along with the computational complexity of analytical functions, limits the use of curved surface Brep. schemes in many applications. In general, such schemes are used for surface modelling rather than solid modelling.
2.T
H y b rid M odels
The modelling schemes discussed so far all have certain disadvantages. Intuitively, a combination of these schemes would overcome these disadvantages and offer a superior modelling technique. This concept has led to the development of hybrid re p resen ta tio n schem es. The most common approach to hybrid representation is to combine two or more independent schemes by converting one model to another. For example, the visualisation of C S G models is improved by conversion to a boundary model. The types of hybrid representations which are based on this approach can be characterised by their p rim a ry and secondary representations. At present, two major architectures are used. These are illustrated in Figure 2.21 (Mantyla, 1988). 10T h e m e th o d o f d ire ct in te g ra tio n is an a lte rn a tiv e to th e use o f th e d iverg en ce th e o re m . B o th these m e th o d s are discussed in A n I n t r o d u c t i o n to S o lid M o d e lin g ( M a n ty la , 1988). 11 T h e m a th e m a tic s o f p a ra m e tric c u b ic curves is s im ila r to th a t o f p a ra m e tric b ic u b ic surface p a tch es a n d is discu ssed fu lly in num erou s tex ts.
2.7. H Y B R I D M O D E L S
A : Regular Space Network
41
B : Irregular Space Network
Figure 2.20: R egular an d Irreg u lar Space C urve N etw orks Schemes which have C S G trees as a primary representation convert to a boundary model using the boundary evaluation technique and to a decomposition model using set membership classi fications. Such schemes have improved display capabilities and more efficient integral property calculations over pure C S G representation (Mantyla, 1988). Unfortunately, as already discussed, both boundary evaluation and set membership classifications can be computationally complex and, in certain cases, are unable to realise a correct conversion. The second group of schemes have as their primary representation a boundary model. The advantages of such schemes are specific to particular applications: • Conversion from C SG trees improves model creation by incorporating more sophisticated description languages. This is only of value if elements of the domain are regular mathe matical objects. • Conversion to decomposition models12 allows more efficient validity and interference check ing. Unfortunately, this process does not assist in correcting invalid models as converting back from decomposition to boundary models is neither robust nor computationally easy. An alternative approach to hybrid representation in teg ra te s two schemes, typically a decompo sition model with either a C S G tree or a boundary model (Mantyla, 1988). The most effective example of such a scheme is the E x ten d ed Octree developed by Brunet, Navazo and Ayala (Navazo et a l ., 1986). Unlike standard octrees, as discussed, the extended octree model uses octants to index the geometric entities of a boundary model. Recursive subdivision is applied until an octant contains either a vertex, an edge, a face, or is homogeneous. Each complex octant is a pointer to its associated geometric entity which is stored in an edgebased data structure. 12A n a lg o rith m to con vert a p o ly h e d r a l b o u n d a ry m o d e l to a lin e a r o ctre e is presented in S e c tio n 4 .4 . A lte r n a tiv e m e th o d s are d iscu ssed in p ap ers p resen ted b y M e a g h e r (M e a g h e r, 1982), C h a n ( C h a n e t a l., 1986) a n d T a m m in e n ( T a m m in e n e t a l., 1984) am o ng o th e rs.
42
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
A : Primary Representation — CSG Tree
B : Primary Representation — Boundary Model Figure 2.21: C oexisting In dependent H ybrid R ep re sen tatio n A rch itectu res The extended octree, and similar schemes such as the polytree (Carlbom, 1987) and the enhanced octree (Fujimura et al., 1985), overcome most of the disadvantages of both boundary and regular spatial subdivision representations: • The representation is more concise than a pure octree model. • Boolean operations axe simpler to perform than for those in pure Brep. schemes (although more complex than for those in pure octree schemes). • A boundary model can be reconstructed from the complex octants without loss of infor mation (Navazo et a l ., 1986). • Integral properties are simple to calculate. One characteristic of octree based integrated hybrid representations, termed the black hole ef fect (Durst et a l ., 1989), limits the use of such schemes in applications where solid objects are geometrically complex (Brunet, 1990). If a face in a polyhedral model has a high aspect ratio i.e. it is long and thin, the number of subdivisions required to ensure that an octant contains only one geometric entity can be extensive. This is illustrated in Figure 2.22 (Durst et al ., 1989). Such subdivision is ‘heavy’ i.e. requires a large amount of memory, difficult to predict or ‘see’ and theoretically infinite or ‘bottomless’: a black hole (Durst et al., 1989).
2.8. C H O S E N SOLID M O D E L L I N G A P P R O A C H
43
Figure 2.22: The Black Hole Effect
2.8
C hosen Solid M odelling A p p ro ach
Based on the theory of solid modelling, system evaluation, present and foreseeable technology and the experiences of researchers such as Kavouras, Karonen, Mantyla, Samet, Gargantini, Brunet and others, it is proposed that a hybrid scheme combining two independent techniques: boundary representation and adaptive spatial subdivision, is an effective method of modelling a 3D subsurface environment which has high resolution, compositional and geometric complexity. Adaptive spatial enumeration, which is uniquely suited to representing universes with composi tional complexity, has numerous favourable characteristics: •
General dom ain : Although objects are modelled with a degree of approximation, the ex pressive power of adaptive spatial subdivision is extremely general. For a subsurface envi ronment, this approximation error is inconsequential (Mill et al ., 1989) as the initial model creation process is itself approximate; both surface triangulation and statistical gridding use interpretive techniques based on incomplete information.
•
Recursive decomposition: The recursive nature of spatial subdivision facilitates the mod elling of universes with a high resolution complexity.
•
Spatial composition: Every unit of space within the model has a known composition. This allows the representation of a universe with a high compositional complexity i.e. both heterogeneous and homogeneous entities simultaneously.
•
Inherent validity.
• Closure of operations. • Model modification: Boolean operations and rigid transformations are computationally
simple. •
Spatial indexing: The hierarchical spatial indexing technique allows spatial search and de creases overall computational complexity; most algorithms involve list scans, tree traversals and case analyses.
Other advantages of adaptive spatial subdivision, which have not been discussed, include:
C H A P T E R 2. R E V I E W A N D ANALYSIS O F SOLID M O D E L L I N G T E C H N I Q U E S
44
• R D B M S in teg ra tio n : The hierarchical indexing method used in adaptive spatial subdivision labels each known unit of space with a unique key or index. By using such keys as either fields within a relational table or as table id en tifiers it is possible to integrate the spatial model with a RDBM S. Mao, at the Kunii Laboratory, has shown that such integration allows effective relational query of attribute information associated with a spatial model (Mao et al., 1989). • F in ite E lem en t M eshing : Shephard, at the Rensselaer Polytechnic Institute, has developed an automated finite element mesh generator based on octree encoding and adaptive anal ysis. The input to this generator is a geometric octree model; adaptive spatial subdivision can be integrated with F E M (Shephard et al ., 1988). Although adaptive spatial subdivision has numerous favourable characteristics and certain unique advantages over other solid modelling techniques (in a 3D subsurface modelling application), the scheme has two distinct disadvantages:
1.
V isualisation: The visualisation of an adaptive spatial subdivision model is a computa tionally intensive process requiring advanced and powerful hardware to achieve acceptable display times. Furthermore, because surface boundaries are approximated by orthogo nal faces, it is difficult to apply advanced graphics techniques such as shading and depth cueing13.
2. M odel creatio n : The creation of an adaptive spatial subdivision model is best achieved by conversion from a surface model. Certain direct creation methods have been developed (Yamaguchi et al ., 1984; Yau et al., 1981), however, Smart has shown these to be of little use in a geoscientific applications (Smart, 1986). Boundary representation overcomes these disadvantages as it offers cogent visualisation and allows model creation through both surface triangulation and a description language.
13R ecen t te ch n o lo g ica l develop m ents have show n th a t the cogent v isu a lisa tio n o f vo x el m o d e ls i.e. b lo ck m o d els, c a n be a chieved w ith a p p ro p ria te h a rd w a re . A t the tim e o f p re lim in a ry in v e stig a tio n , how ever, such c a p a b ility was n o t a v a ila b le .
C h a p te r 3
B o u n d a r y R e p r e s e n t a t i o n in A E G I S
Numerous surfacebased modelling systems have been developed which use boundary represen tation. Many of these offer extensive model creation and visualisation functionality while only a few offer comprehensive solid modelling capabilities i.e. closure of operations, topological validity checking mechanisms, boolean operations etc. Given that the function of boundary representation in A E G IS is to assist in the creation and visualisation of geometric shapes and with the relative abundance of surfacebased modelling systems, it was felt that the implementation of a surface triangulation algorithm, a description language and a 3D display system would neither be a contribution to science nor a practical proposition given the available time and manpower: boundary model creation and visualisation in A E G IS is fulfilled by a commercial system known as M o v ie.B Y U 1. It should be noted that the choice of M ovie.BYU was strongly influenced by budget constraints. The M ovie.BYU system, which for the rest of this thesis will be referred to as ‘Movie’, is a “general purpose computer graphics software system which displays and manipulates data repre senting mathematical models whose geometry may be described in terms of polygonal elements, polyhedral solid elements, or contour line definitions” (Christiansen et al., 1986). It comprises a series of five F O R T R A N programs which operate on a vertexbased boundary model. O f these programs only D isplay, U tility and M osaic are utilised in A E G IS . ‘Display’ is an interactive display program which has extensive functionality including model and view transformations, hidden line and surface removal, a variety of shading models, colour control, transparency, shadow generation, fog simulation and image enhancement capabilities. This program operates on 3D polygonal surface mesh models stored in a hierarchical database. The latter allows individual objects in the modelling domain to be displayed and manipulated independently. Furthermore, copies of an object can be grouped together and treated as a single entity giving great flexibility in scene composition. ‘U tility’ is an interactive model creation program which uses a description language to generate the polygonal surface mesh of irregular and warped hexahedrons, thick partial ellipsoids and bodies of revolution and/or translation. The program also facilitates data editing such as polygon generalisation and orientation, file merges and vertex manipulation. ‘Mosaic’ is an interactive program which generates a polygonal surface mesh from a set of planar parallel contours. This generation process utilises a sh o rte st d iagonal heuristic surface triangu lation algorithm developed by Christiansen and Sedeberg (Christiansen et a l ., 1978). As many of the contributors to Movie are pioneers of 3D computer graphics e.g. David Evans and Gary Watkins, the system is regarded as an industry standard. As such, the rendering concepts 1M o v i e . B Y U w as d e v e lo p e d a t th e U n iv e rs ity o f U t a h a n d B r ig h a m Y o u n g U n iv e r s it y ( B Y U ) a n d is c u r r e n tly b e in g d is t rib u te d b y th e E n g in e e r in g C o m p u te r G r a p h ic s L a b o r a to r y at B Y U .
45
46
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
and algorithms used in Movie are documented in both technical papers and monographs. A regurgitation of these monographs is unwarranted. Suggested references include F u n d a m e n ta ls o f In te ra c tiv e C o m p u ter G rap h ics (Foley et al., 1982), P rocedural E lem en ts fo r C o m p u ter G raphics (Rogers, 1985) and F u n d a m e n ta ls o f T h reeD im ensional C om p u ter G raphics (Watt, 1989). Although rendering techniques have been adequately documented, methods of model creation are not as widely reported and, therefore, this chapter will concentrate on the surface triangulation algorithm used in Mosaic and the description language used in Utility. 3.1
M o d e l Creation  Surface Triangulation
Surface triangulation is a process which generates a 3D polygonal surface mesh by connecting points on 2D planar parallel contour or border lines. More formally, this can be stated as (Ganapathy et al., 1982): Given two borders represented by point sequences p , , i = 0, l,...,m — 1 and q j , j = — 1 produce a set of triangular faces forming the best spanning surface.
0,1 ,..., n
Although the qualification of a ‘best’ spanning surface is subjective, it is possible to define an ‘acceptable’ surface as one which satisfies two topological constraints: 1. Each contour seg m en t , the line connecting two consecutive points on a contour, appears in exactly one surface tile where a surface tile is a triangular face enclosed by a contour segment and two diagonals, or spans. The latter must be connected to the endpoints of the contour segment as illustrated in Figure 3.1a. 2. Every span is identified with exactly one other span. These constraints can be enforced by representing two adjacent contour or border lines as a directed graph G (V, A ) where the set of vertices V corresponds to all possible spans and the set of arcs A corresponds to all possible tiles. This is illustrated in Figure 3.16 where vertex v,j is the span { p , —* q j } and the arc {vty, vt+ 1J} represents the triangle { p i,q j,P i+ i} In the context of graph theory, the above constraints can be stated as (Smart, 1986):
1.
Each arc should be the result of a positive unit increment in either i or j .
2. The path from the first to the last vertex in the graph should be connected. If the initial span in the triangulation process is {px «> q i}, the spanning surface can be any path from vxl to vmn; the number of possible paths and, thus, spanning surfaces, is (Ganapathy et a l ., 1982): A (m,n)
(m + n)! m! x n!
Intuitively, some criterion must be defined to determine a single path through the graph. In Mosaic this criterion is the least su m to tal length of all connecting spans (Christiansen et al ., 1986).
3.1. M O D E L C R EA T IO N  SU RFA CE TR IA N G U LA TIO N
47
A : Polygonal Element
G<1,1)
, vi.i
a
vi.j s Pi " vi+l,.i s qj
vi+l, j
a
qj
Pi
G(m,n)
G[V, A]
B : A Directed Graph G[V, A] Representing two Contour Loops Figure 3.1: G raph R ep resen tatio n o f A d jacen t C o n to u r Loops Consider two contour loops A and B . The triangulation algorithm commences by connecting two points, one on each adjacent loop, which are proximate: and bx as illustrated in Figure 3.2. This span is the base of the first tile. The two edges of this tile are created by connecting the sh o rte st diagonal between the adjacent loops i.e. a t —► b2 . The latter is the base of the next tile whose edges are also created by connecting the shortest diagonal between the adjacent loops: a x —> b3 or b2 —► a 2. This local decision making, or heuristic, process continues until all the points have been connected as illustrated in Figure 3.3.
b2
* a2
<
a2
b3
Figure 3.2: Initialisation of Triangulation Process
48
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
Figure 3.3: T riangulated S p anning Surface With respect to graph G (V , A ), the least sum total length of all connecting spans is determined by associating two matrices with the graph: the p ath m em ory matrix, M (i , j ), and the to ta l distan ce matrix, D ( i , j ) . The latter records the sum of the length of the spans included in the shortest path from G ( 1,1 ) to G (i , j ) while the path memory matrix indicates the path used to attain this least total length. To appreciate the mechanics of this process, consider the example illustrated in Figure 3.4. The first span is defined as being a x <► 6X. The length of this span, 5 metres, is stored in element D {1 ,1 ) of the total distance matrix (M (1,1 ) is ignored). Adhering to the constraints previously stated, t and j are incremented 1 unit and the total distance values for G (1,2 ) and G (2 ,1) are stored in elements D (1,2) and D { 2 ,1) respectively. As there is only one possible path to these vertices in the graph, the values stored in the toted distance matrix are: D (1,2 ) = D ( 1 ,1 ) + G ( 1 , 2) = 10.39 m e tre s D (2 ,1) = D ( 1,1 ) + G (2 ,1) = 10.10 m e tre s
The path from G ( 1 ,1 ) to G (1,2 ), which is a positive increment in y, isindicated in the path memory matrix as a‘O’ in element M (1,2). Similarly, the path from G ( 1 ,1 ) toG (2 ,1), which is a positive increment in t, is indicated as a ‘1 ’ in element M (2 ,1). On inspection, it is possible to generalise for all vertices G (t, 1) and G (1, jT): £>(*\1) M ( i , 1)
= £ > ( «  1 , 1 ) + C (.\1)1 = 1
D (l,j)
=
Z > ( 1 , ;  1 ) + G ( 1 J )  1
=
0
Consider now the vertex G (2,2). The criterion for determining a single path through the graph is the least sum total distance of spans and, thus, the value stored in element D (2, 2) of the total distance matrix is the least of: D (1,2) + G (2, 2)  D (2,1) + jG (2, 2)
: increment in t => M (2,2) = 1 : increment in j => M (2,2) = 0
which, for the example, is 15.20 m etres: an increment in j .
3.1. M O D E L C R E A T I O N  S U R F A C E T R I A N G U L A T I O N
49

n r
w
ii ii ii ii
II II II II
11 II II II II
ii ii ii
IT II II II JL
  II II il
ii
ii
I  I I I
s IhHI ll IT
n r ■ • it
ia» H ll If ! □ □ □ □ [ U t z o n n n n n f
ii ii

ii ii
B : Processing o f G ( l, 2 ) and G (2 ,l)
U
Hi IT H I  1 II II 1 II II  __ L J L
1039
H T 1 II J T  • II • ii II II II ii II II II  II II II _ I L J L J ] __
II II II  II
C : Processing o f G(2,2) a,
—
6
1039 t & i 2030 25j69 3209
bj
1622 2059
3040 3623
2329 2d99 30:69 3550 40i«J
6 __ __ __ __ metres
6
31.10 34j06 3652 4088 m a
GG.j>
i — a{ — 1 1 .j.; 0 J01 1 v;or rrr;0 01 0 •VO.': 01 0 0 0 o
—
O
i
J:s;i tOlG 15.43 2233 30.14
DG,j)
6 1 1 1 VJV: J'OV:
MG.j)
D : Processing o f G (i, j)
F ig u r e 3.4:
Graph Theoretic Representation of Triangulation Process
In th e ge n e ra l case, the t o t a l d ista n c e m a t r ix v a lu e for ve rte x
G (*, j ) , w h e re «,t = 2 , 3 , m a n d
L 3 = 2 ,3 ,...,n , is: D (i  1 J ) + G ( i , j ) \ D (i , j  1) + \G (t,i)
th e le a st o f th e se
O n c e a ll th e to ta l d is ta n c e a n d p a t h m e m o ry m a t r ix va lu e s h a v e b e e n d e te rm in e d th e u n iq u e p a t h t h r o u g h th e g r a p h c a n be b a c k tra c k e d b y s ta r tin g a t G ( m , n ) a n d d e c re m e n tin g a c c o r d in g to th e v a lu e s to re d in
M (m ,n ).
i and j
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
50
Figure 3.5: A Topologically In v alid S p an n in g S urface Although the shortest diagonal heuristic method is fast, it is not topologically robust. For example, if two adjacent loops are excessively offset the resultant spanning surface may be a cone, as illustrated in Figure 3.5. Similar problems arise if an elevation or section has more than one loop or adjacent loops are dissimilar in shape and size (Christiansen et al., 1986).
3 .1 .1
M a p p in g
To overcome the problems associated with loops which are offset and dissimilar in size, adjacent loops are mapped onto a unit square prior to triangulation. This is achieved in a three step process (Christiansen et al ., 1978):
1.
Define a rectangular window which encloses each contour or border loop.
2. Determine the dimensions (&c,5y) and the centre (a;,t/) of each window (Figure 3.6). 3. Map each loop onto a unit square, centered at (0,0), by applying the equations: xi y
t
jgz.*l
6x (v9) Sy
Once the loops are mutually centered they will have a similar size and, in many cases, a similar shape. Furthermore, tiles will tend to align themselves with spans that are biased in the direction of the offset. This creates a longitudinal texture which is desirable (Christiansen et a l ., 1978).
3.1. M O D E L C R E A T I O N  S U R F A C E T R I A N G U L A T I O N
A : Window Parameters
51
B : Mapped Contour Loop
Figure 3.6: M apping o f A d jacen t C o n to u r Loops 3 .1.2
B r a n c h in g
B ran ch in g is a method of triangulating adjacent sections which have more than one loop. Con
sider, first of all, a simple case where one contour loop branches into two on the adjacent elevation, as illustrated in Figure 3.7a. A general approach to this problem is to consider all branches as one continuous closed loop (Christiansen et al., 1978). This can be achieved by: 1. Introducing a new vertex between the branches (Figure 3.76).
2.
Renumbering the vertices of the branches such that they are considered as a single loop. This will require the new vertex and its immediate neighbours to be numbered twice (Fig ure 3.7 c).
Unfortunately, this general method does not apply when there are branches on both elevations or sections, as illustrated in Figure 3.8. In such cases user intervention is required to identify associated loops. Another situation in which the general method does not apply is when there is extreme concavity in the neighbouring line segments of adjacent branches; a new vertex between the branches will result in a topologically incorrect spanning surface, as illustrated in Figure 3.9. To successfully triangulate such branches, the loops can be processed as discrete line segments. For the example in Figure 3.9, this is achieved by connecting loop B with line segments a4 —► ax —► a2 and a5 —> a6 —» a7 and spanning a flat surface between segments a2 —► a3 —> a4 and a 7 —> a B —+ a s . Triangulating loops as discrete line segments offers extensive flexibility and can be used to control the conditions of the spanning surface. This is of value when adjacent loops are dissimilar in shape or become increasingly divergent.
52
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
A : Branched Contour Loops
B : Insertion of New Vertex
Figure 3.7: G en eral B ranching M ethod
Figure 3.8: M ultiple B ranching
Figure 3.9: Triangulation of Line Segm ents
3.1. M O D E L C R E A T I O N  S U R F A C E T R I A N G U L A T I O N
53
Figure 3.10: A S urface B o u n d ary w ith ‘Open’ E n d s
3 .1 .3
C a p p in g
Intuitively, the triangulation of planar, parallel and adjacent contour or border loops generates a surface boundary with ‘open’ ends, as illustrated in Figure 3.10. Such a surface does not define a valid solid; the ends must be closed or capped. Capping a contour or border loop is achieved by triangulating it with a point. The position of this point can be either user defined or at the centre of the loop. The latter position is determined by the median of the x and y values:
_
_ Xmax
xcap ~
2
Xmxn
_ _ Vmax Vmin Vcap ~ 2
Figure 3 .11 illustrates a capped surface boundary.
B : Raised Cap
Figure 3.11: A Capped Surface B oundary
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
54
3 .2
M o d e l C r e a tio n  D e sc r ip tio n L a n g u a g e
A description language is a program which generates the 3D polygonal surface mesh of mathe matical shapes from a series of user defined constructs and parametric values. The latter, which include control points, angles of rotation and translation vectors, are utilised by shapespecific algorithms to determine the coordinates and the connectivity of each vertex in the surface mesh. In Utility such algorithms can generate three general classes of shape or primitive: hexahedrons, ellipsoids and volumes of revolution.
3 .2 .1
H exahedrons
Hexahedrons are a class of shape which can be described by eight corner points and any four cornered quadrilateral surface. Some examples include p rism a tic hexahedrons, n o n p rism a tic hex ahedrons and q u ad rilaterals. The latter are any planar or warped surface which can be described by four corner points (Plate 3.1). Prismatic hexahedrons are those with constant prismatic crosssections, such as beams and parallelograms (Plate 3.2) while nonprismatic hexahedrons are those with either regular nonprismatic crosssections, such as a wedge or pyramid (Plate 3.3), or with warped nonprismatic crosssections (Plate 3.4) (Christiansen et al., 1986). The vertex coordinates of each polygon in the surface mesh of a hexahedron can be determined by defining eight corner points and linearly subdividing the six quadrilateral faces into a prede termined number of elements. This is achieved by conceptually partitioning the hexahedron into ‘slices’ and calculating the vertices on the boundary of each slice: 1. Calculate the corner points of a slice:
=
) K ( 1 ) + ( ^ l ) v(n)
(31)
where V (*) is the corner vertex of a slice, V (1) is the adjacent vertex on the fro n t face, V (n) is the adjacent vertex on the back face, t is the slice number and n is the total number of slices, as illustrated in Figure 3.12a (Christiansen et al., 1986). 2. Calculate the vertices on the top and bottom edges of the slice. This is achieved using Equation 3.1 but where V (t) is an edge vertex, V (1) is the adjacent vertex on the fro n t face, V ( n ) is the adjacent vertex on the back face, t is the subdivision along the edge and n is the total number of subdivisions along the edge, as illustrated in Figure 3.126 (Christiansen et al., 1986). 3. Calculate the vertices on the left and right edges of the slice using a similar approach to that in step 2 (Christiansen et al., 1986); 4. Calculate the vertices on the interior of the front and back faces, again using Equation 3.1 (Christiansen et al., 1986). The terms ‘front’, ‘back’, ‘top’, ‘bottom, ‘left’ and ‘right’ are relative and are only used for convenience; they do not represent absolutes (Christiansen et al., 1986).
3.2. M O D E L C R E A T I O N  DESCRIPTION L A N G U A G E
55
A : Determining the Corner Vertex of a Slice
B : Determining the Vertices on the Top and Bottom Edges of a Slice Figure 3.12: C oo rd in ate A rray G e n eratio n fo r H exahedrons
3.2 .2 E llip soid s This class of primitive includes ellipsoid surfaces and thickshelled volumes whose boundaries are ellipsoids. Such primitives can be described by the radii of an outer and inner ellipsoid, the centre of an ellipsoid, a vector which sweeps through a latitude and a longitude and a number of elemental divisions in latitude, longitude and radius (Christiansen et a l.y 1986), as illustrated in Figure 3.13. The vertex coordinates of each element in the surface mesh of an ellipsoid can be determined by sweeping incrementally a known vector through a given range of latitude and longitude. The intersection of this vector with the ellipsoid surface defines a point on that surface. Assuming the base of the known vector to be at the origin, 9 to be an angle of latitude and an angle of longitude, the coordinates at the tip of the vector are: xv
=
fJL cos 9 cos (f>
yv
=
n
zv
=
sin0 n cos 9 sin
where n is the length of the vector. Solving for yv and zv in terms of xv\ .. _ Xu ~ zv =
z« tan6 cos x v tan (f)
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
56
Given the equation for an ellipsoid to be: (3.2) where r x , r y and r z are the radii in the x ,y and z coordinate directions respectively, and substi tuting for y and z , the value of x v can be determined as follows: x2V
x2 tan2 9 rjj cos2 tj>

v
r\

x2Vtan2 9 r\
r' i r' y r2
X.i —
r2 r2 ' 2 + LI/ tl
'
'
r \ r \ tan2 6 cos2
(3.3)
(3.4)
+ r2 r2 tan2
yv and zv can be determined in a similar fashion (Christiansen et a l 1986).
If the primitive is a thickshelled volume the surface mesh is determined by calculating the vertex coordinates for the inner and outer surfaces, using Equation 3.4, and interpolating between these vertices. This is illustrated in Figure 3.13 and some examples of the ellipsoid class of primitives are shown in Plate 3.5.
y  axis
Figure 3.13: Coordinate Array Generation for Ellipsoids
3.2. M O D E L C R E A T I O N  DESCRIPTION L A N G U A G E
57
3.2 .3 V olu m es o f R ev o lu tio n This class of primitive consists of shapes which can be generated by revolving a curve or loop around an axis (Christiansen et al ., 1986). Such shapes include: •
Surfaces of revolution’. Surfaces of revolution are created by revolving a curve around an axis. Cones, cylinders and axisymmetric shells are typical examples.
•
Volumes of revolution: Volumes of revolution are created by revolving a closed loop around an axis. The most notable of such volumes is the torus which is the revolution of a circle.
•
Spirals of translation: If a curve or loop is incrementally translated along the axis of rotation as it is being revolved, the resultant shape is a spiral of translation. A typical example is the thread of a bolt (Christiansen et al., 1986).
•
Radial spirals: Radial spirals are created when the radius of revolution is incrementally
changed as a curve or loop is being rotated. •
Radial spirals of translation: Radial spirals of translation are the combination of both radial
spirals and spirals of translation. Examples of these primitives are shown in Plates 3.6 to 3.10. To maintain a degree of generality the algorithm used to determine the vertex coordinates of elements, defining the surface mesh of a volume of revolution, assumes that rotation is performed about the x axis. This imposes limitations and a general rigid transformation capability is required to position the primitive in arbitrary space. With reference to Figure 3.14, consider a curve which will define a surface of revolution. The parameters required for such a primitive are: 1. The sequential coordinates of the vertices on the curve to be revolved. 2. The angle of revolution. 3. The number of circumferential elements. The position of a vertex on the curve in the yO z plane can be defined by a vector Vyz. The length of this vector is: R
= [y? + z?]’
and the angle from the xO z plane is: o: = tan 1 where yt and z\ are the y and z coordinates of the i th vertex in the curve.
58
C H A P T E R 3. BO UN DA RY R E P R E S E N T A T IO N IN A E G IS
Given the total degree of revolution (A) and the number of circumferential elements (n), the incremental angle of rotation is:
6
A n
Hence, rotating a vertex an angle 6 about the x axis defines a new vertex with coordinates:
Xt_!
(3.5)
tfi =
R sin (o: f 6)
(3.6)
=
R cos (a + 5)
(3.7)
Xi
Zi
=
For spirals of translation the value of X{ changes as the curve or loop is rotated about the x axis. Equation 3.5 can be modified accordingly: Xi =
. G
in
where t x is the total translation along the x axis. Similarly, for radial spirals the value of R changes as the curve or loop is rotated about the x axis. Equations 3.6 and 3.7 can be modified accordingly: Vi
R i i +
sin ( a + S)
Zi
R i x + ^f
cos (a + 6)
where tR is the total change is radius R .
yaxis
Figure 3.14: C oordinate Array G eneration fo r Volumes of Revolution
59
3.2. M O D E L C R E A T I O N  DESCRIPTION L A N G U A G E
To position a primitive in arbitrary space the local coordinate axes, used to define the primitive, can be rotated and translated using a general transformation. The latter is specified by three points: 1
. A new origin.
2. Any point on the new x axis. 3. Any point in the new xO y plane. With reference to Figure 3.15, the transformed coordinates for each vertex in the primitive are: xi
M l
= T
yj
y«
z1 t
zi
+
•^(new o rig in ) l/(n ew o rig in ) ^(n e w o rig in )
where T is the general transformation matrix:
T =
cos a x cos acy cos a z cos /3X cos /3y cos (3Z cos 7 a; cos 7 y cos 7 Z
where: cos a x
=
___ 52___
COSCty = ___ m ___ (*!+v!+z2)2 ____*2 cos olz = (z+v+z)2 cos flx
=
COSfly
=
COSp z
—
COS7a; = cos 7 „
=
cos 7 z
=
(co8*7vZ3— cos7^y3) ((co s 'yyZ3 c o s 7z {/3) 2+ (c o s 7iV 3 c o s 7y z 3 ) 2 + (c o s 7*2:3003 Tfx«3)2)^ ____________________________ (cos 'jx V 3COS 7 y g 3 )_________________ ((co s 7yZ3 —cos 7zy 3)2+ ( c o s 7z j/3—cos 7y * 3) 2 + (c o s 7*2:3 c o s r,«)2)4 ____________________________ (c o s 7* z 3 —cos 'I 1 Z 3)_________________ ((co s 7y z 3 —cos 7, 1/3) 2+ (cos 7* y3  c o s 7y * 3)2+ (cos 7* 2:3 cos _____________________ {\)2Z3 —Z 2Vz) ___________________ ((t/223—*2!/3)2 + ( z 2Z3 —Z223)2+ (l2 t/3 —1/2^3 ____________________ (^2 I 3 ~ ^ 2 Z3)____________________ (({/2Z322V3)2+(*22:3Z2*3)2+(2:2V3y2:E3)2)^
____________________ (^2V3 t/2^ 3)____________________ ((y 2 « 3 « 2 y 3 )2+ (z 2 a :3 a :2 ^ 3 )2+ (2:2y3V 22:3)2 ) ^
Plate 3 .11 shows a torus which has been both rotated and translated. An alternative and more intuitive method of specifying the general transformation T is to define two angles of rotation, namely azimuth () and elevation (0 ):
T =
cos cos 9 sin# sin cos 9
cos sin 9 cos 9 sin sin 9
—sin 9
0 cos
60
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
yaxis
Figure 3.15: T ran sfo rm atio n of a Volume o f R evolution
3.3. PLATES 3.3
61
Plates
Plate 3.1: A W arped S urface
Plate 3.2: A P rism a tic H exahedron
62
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
This is a blank page.
3.3. PLA TES
63
Plate 3.3: A N o n p rism atic H exahedron
Plate 3.4: A W arped N o n p rism atic H exahedron
64
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
This is a blank page.
Plate 3.5: Ellipsoid Prim itives
Plate 3.6: Surface o f R evolution
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
This is a blank page.
Plate 3.7: Volume of Revolution  The Torus
Plate 3.8: S p iral of T ranslation
68
C H A P T E R 3.
B O U N D A R Y R E P R E S E N T A T IO N IN A E G IS
This is a blank page.
3.3. PLA TES
69
Plate 3.9: R ad ial S piral
Plate 3.10: R ad ial S piral of T ran slatio n
70
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
This is a blank page.
3.3. PLA T E S
71
Plate 3 .11: A Transform ed Torus
C H A P T E R 3. B O U N D A R Y R E P R E S E N T A T I O N IN AEGIS
This is a blank page.
Chapter 4
A d a p tiv e S p a tia l S u b d iv is io n in A E G IS
Adaptive spatial subdivision in A E G IS is achieved using L in ear O ctree E ncoding. The latter mathematically models a physical object by a set of blocks or cubes of varying dimension. The representation of these cubes is a lin ear list of unique numbers or k ey s, where the value of each key determines the size and location of the corresponding cube. To appreciate the algorithmic simplicity of this technique it is important to understand both the mathematical modelling scheme and the computer representation.
4 .1
L in ear O ctree E n c o d in g  T h e M a th e m a tic a l M o d e l
The basic concept of linear octree encoding is to model an object by a set of discrete blocks which are indexed such that the spatial relation of each block is known. Assume an object to exist in a cubic space, referred to as the octree un iv erse. This cuboid is subdivided into eight subcubes, of equal size, called o ctan ts , which are indexed by an encoding scheme. Each octant is investigated (Meagher, 1982) to determine whether: • the octant is wholly insid e the object boundary: a fu ll octant; • the octant is wholly outside the object boundary: an em pty octant; • the octant lies on the boundary of the object and is partially filled by the object: a p a rtia l octant. If an octant is ‘full’ or ‘empty’ it is homogeneous and further subdivision of such octants will generate suboctants of similar composition; nothing is gained by this action and the process of decomposition therefore ceases. If an octant is ‘particil’ it is subdivided into eight more octants which are, again, labelled either full, empty or partial. The process is applied recursively until all octants are homogeneous or a limit of recursion has been attained. In the latter case an octant is referred to as a volume 'pixel or voxel (Mark et al., 1986). The resulting mathematical model can be visualised as a 3D ‘raster’ of octants and voxels or a block model with blocks of varying size. An example is given in Figure 4.1 which shows a physical object and its ‘octree’ mathematical model. The abstract representation of an octree model is a hierarchical tree structure whose root cor responds to the whole of the octree universe. This root is a p aren t node to eight octants which, themselves, may be a parent node or a le a f n ode1. The latter is either homogeneous or a voxel ’ A p a ren t n od e has ‘e ig h t’ bra n ch es and , th u s, the h ie ra rc h ic a l tree stru ctu re is re fe rre d to as an O c t a l tree or
O c t r e e (M e a g h e r, 1982).
73
74
C H A PT E R 4 . A D A P T IV E SPATIAL SU B D IV ISIO N IN A E G IS
A Physical Object
A Mathematical Octree Model
Figure 4.1: A Physical Object and the corresponding M athem atical Octree Model
4.2. T H E LINEAR O C T R E E E N C O D I N G S C H E M E
c h ild
a n d , therefore, h a s n o
75
no d e s. F ig u r e 4.2 is th e a b s t r a c t octree re p re s e n ta tio n o f th e o b je ct
in F ig u r e 4.1. T h e e m p ty le a f n o d e s in the o ctree are in e sse n tia l a s th e y d o n o t c o n tr ib u te to th e c o m p o s it io n o f th e object; a ll th e b ra n c h e s e n d in g in an e m p ty le a f n o d e c a n be c u t away. T h e ‘p r u n e d ’ o ctre e is a m o re s u c c in c t m a th e m a tic a l m o d e l o f the in it ia l o b je ct ( G a r g a n t in i, 1982) a n d is m o re e fficient w it h r e g a rd c o m p u te r m e m o ry a n d p ro c e ssin g tim e . T h e p r u n e d re p re se n ta tio n o f th e o b je c t in F ig u r e 4.1 is s h o w n in F ig u r e 4.3. T h e tree str u c tu re is an a b s tra c t c o n ce p t a n d its m a n ife s ta tio n in a c o m p u te r is a se t o f n u m b e r s s to re d in a s tr ic t order. d e te r m in e d b y th e
T h is o rd e r is referred to a s th e
e n co d in g sc h e m e
d a ta s tr u c tu r e
w h ile th e n u m b e r s,
are s p a t ia l in d ic e s id e n tify in g the lo c a tio n , size a n d s p a t ia l
re la tio n o f each o c t a n t in the m od e l.
4.2
T he L inear O ctree E n cod in g S ch em e
T h e e n c o d in g sch e m e e m p lo y s a d ire ct a d d r e s s in g te c h n iq u e w h ic h is b a s e d o n a lo c a t io n a l k e y first d e sc rib e d b y M o r t o n ( M o r t o n , 1966).
T h e b a s is fo r th is lo c a t io n a l key is a re c u rsive
n u m b e r in g sch e m e in base 8 n o ta tio n . A s s ta te d in th e p re v io u s se ction , th e octree u n ive rse is re c u rsiv e ly s u b d iv id e d in t o o c t a n t s o f e q u a l d im e n sio n .
2r
x
2r
x
in te g e r d im e n s io n o f re s o lu tio n o f th e u n ive rse .
T o achieve su c h s u b d iv is io n th e u n iv e rse m u s t h ave a n
2 r , w h e re R
is th e m a x im u m n u m b e r o f s u b d iv is io n s o r the
A s s u m i n g one ve rte x to be a t the o r ig in o f a r ig h t h a n d e d in te ge r C a r t e s ia n c o o r d in a t e s y s t e m a n d a d ia m e t r ic a lly o p p o site ve rte x to be in th e p o s it iv e q u a d ra n t, the e ig h t ve rtic e s d e fin in g an o ctre e u n ive rse w ill be:
V e rte x
i
3
k
Num ber
C o o r d in a t e
C o o r d in a t e
C o  o r d in a t e
1
0
0
0 0
3
*maz 0
0
0
4
hmax hmax kmax k max
2
w h e re ve rte x 1 is the
3max
=
kmax
= 2 r ,R
*max
3max 3max
5
0
0
6
•max
0
7
0
8
*max
3max 3max
B ase
o f th e u nive rse , v e rte x 8 is th e
0
A p ex
o f th e u n iv e rse a n d * max —
= p o sitiv e in te ge r value.
W h e n th is c u b ic u n ive rse is s u b d iv id e d the re s u lta n t e ig h t o c t a n ts are la b e lle d w it h a n
d ig it
fr o m 0 to 7 a c c o rd in g to the n o ta tio n g iv e n in T a b le 4.1.
o c ta l
T h is n o t a t io n is illu s t r a t e d in
F ig u r e 4.4. I f a n o c ta n t is p a r t ia l a n d fu rth e r s u b d iv id e d e ach o f th e e ig h t s u b  o c t a n t s is a s s ig n e d a n o c t a l d ig it id e n tify in g its p o s it io n re lative to th e b ase o f th e p a re n t o c t a n t a n d th e o c t a l d ig it o f t h a t p are n t. T h e s e d ig it s are c o n c a te n a te d su c h t h a t th e re s u lta n t la b e l is a n
o c ta l s trin g .
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
76

Full Leaf Node
I  Empty Leaf Node
■ Full Voxel
fU Partial Node
□ Empty Voxel
Figure 4.2: The A b stract O ctree R ep re sen tatio n o f the O bject in F ig u re J^.l
Full Leaf Node
Full Voxel
ill Partial Node
Figure 4.3: The lP ru n e d } Octree Representation of the Object in Figure J . l
4.3. T H E LINEAR O C T R E E D A T A S T R U C T U R E
O ctal
77
O ctan t
D ig it
B a s e V e rte x i
j
A p e x V e rte x k
i
j
0
0
0
0
tmax
1
1m.ax. 2
0
0
*m ai
Jmax 2 Jmax 2
0
2
Jmax
2
0
Jmax
3
imax
Jmax
2
2
0
*max
tmax 2
k
kmax 2 kmax 2 kmax 2
kmax 2
4
0
0
5
imai 2
0
kmax 2 kmax 2
*max
Jmax Jmax 2 Jmax 2
6
0
Jmax
kmax 2
tmax 2
Jmax
k Kmax
7
*mai 2
2
*max
Jmax
k ’'max
T a b le 4.1:
2
2
2
Jmax 2
kmax ftmax
N otation for the L inear Octree Encoding Scheme
R s u b d iv is io n s , e ach voxel w ill h ave R o c t a l d ig its : a u n iq u e ke y o r spatial index. T h is c a n b e fo r m a lly s ta te d a s
T h e e n c o d in g sch em e is a p p lie d re c u rsiv e ly su c h th a t, a fte r a la b e l m a d e u p o f ( G a r g a n t in i, 1982):
I
= d.R1 d R 2  ... do
I is th e spatial index o f a n o c ta n t, d $ is one o f th e d ig it s { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } a n d S \S = 0 ,1 ,..., R — 1, id e n tifie s th e degree o f s u b d iv is io n or th e level of resolution o f th e o c t a l d ig it.
w h e re
T o illu s tr a te th is e n c o d in g sch e m e c o n sid e r th e p h y s ic a l o b je c t in F ig u r e 4.5. I f th e re s o lu tio n o f th e octree u n ive rse is 3 th e b a se a n d a p e x w ill h ave c o o rd in a te s { 0 , 0 , 0 } a n d { 8 , 8 , 8 } re sp e ctively. R e c u r s iv e ly s u b d iv id in g t h is u n iv e rse , th e o c t a n t s axe la b e lle d a s in T a b le 4.2. T h e s p a t ia l s ig n ific a n c e o f th e o c t a l s t r in g s is e x e m p lifie d b y the a b s t r a c t tree s tr u c t u r e ( F i g u re 4.6); th e n u m b e r o f d ig it s d ic ta te s th e size o f th e o c t a n t a n d th e c o n c a te n a t io n o f d ig it s defines a p a t h fr o m th e r o o t o f th e tree to t h a t o c ta n t. G iv e n a lis t o f o c t a l s t r in g s , therefore, it is p o ssib le to c o n s tr u c t th e o ctree m a t h e m a t ic a l m o d e l o f a n object.
4 .3
T h e L in ear O c tr e e D a t a S tr u c tu r e
T h e d a t a s tr u c tu re fo r th e o ctre e m o d e l is a lis t o f o c t a l s t r in g s so rte d in a s c e n d in g ord er.
In
array linked list. T h e se s tr u c tu re s are ‘lin e a r ’ a n d , hence, th e te r m linear octree ( G a r g a n t in i, 1982).
p r im a r y s to ra g e (in te r n a l m e m o r y ) th is c a n be im p le m e n te d u s in g e ith e r a o n e d im e n s io n a l or a
A s p a t ia l in d e x is sto re d in a n in te ge r v a ria b le o f 32 b its. E a c h o c ta l d ig it , a n u m b e r fr o m 0 to 7, re q u ire s 3 b it s o f m e m o ry ; it is p o s s ib le to c o n c a te n a te 10 d ig it s in to o n e in te g e r v a ria b le . S t o r in g a s p a t ia l in d e x in a s in g le in te ge r v a ria b le lim it s th e re so lu tio n o f th e o ctre e u n iv e rse to
R = 10. T h is c a n be in c re a se d b y e ith e r u s in g a double integer (64 b it s ) v a ria b le o r a c o m b in a t io n o f v a riab le s; th e la tte r a p p ro a c h re q u ire s a m o re in tric a te c o n c a te n a tio n a lg o r it h m .
A s w ill be
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
78
k  axis
Figure 4.4: O ctal N o tatio n discussed in Section 5.3.1.2, the modelling an of object space using an octree universe of resolution R > 10 is impractical; the data structure is an array (or linked list) of 32 bit integer variables. The list of octal strings is the basic information required to represent a model. If attribute data are associated with these strings the domain can be increased and the efficiency of algorithms can be improved. 4.3.1
Octree Attributes
Geoscientific objects exist in a world space which rarely corresponds to an octree universe; a transformation is required to map the object space into the modelling space (Figure 4.7). This transformation determines the true dimensions and location of the modelling domain and, there fore, each linear octree requires a m apping record which contains: B a se V e rte x  The x , y and z coordinates of the base vertex of the object space. A p e x V e rte x  The x , y and z coordinates of the apex vertex of the object space. E x t e n t  The maxim um extent o f the object space.
4.3. T H E LINEAR O C T R E E D A T A S T R U C T U R E
Figure 4.5: The O ctree M ath em atical M odel fo r a Sim ple O bject
Figure 4.6: The Abstract Octree R epresentation of the Simple Object in Figure \ . 5
79
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
80
Base Vertex
Octal Key
Apex Vertex
i
j
k
i
j
k
002
0
003
i
004
2 2 1 1 2 2 2
031
3
2 2
033
3
3
040
0
0
211
3
4
300
4
4
301
5
4
310
6
4
351
7
4
0 0 1 1 1 1 0 0 0 0 0 0 0 2 0 0 0 0 2
1 2 1 2 1 2
030
0 1 0 1 2 0 1 0 2
1 1 0 0 1 1 1 2 2
355
7
4
3
400
455
3
456
2
457
3
474
2
475
3
0 0 0 0 1 1 2 2
4
454
0 0 2
476
2
477
1 2 1
4
3
3
4
3
4
4
1 1 2 2 2 2 1 1 1 1 1 1 1
2
2
4
4
5
5
5 5
6 5
3
5
4
6
6 8 8 8 2 2
1 1 1 2
7
3
7
4
7
3
7
4
2 2 1 1 2 2
7
3
3
7
4
3
3
7
3
4
3
3
7
4
4
655
3
4
7
4
5
700
4
4
4
8
8
6 8 8 8 8 8 8 8 8 8 8 8
005 006 007
012 020 021 022
440
3
3
Table 4.2: O c ta n t Labelling fo r F ig u re ^ .5
3 3
4.4. LINEAR O C T R E E G E N E R A T I O N
81
O ctree R e so lu tio n  The resolution R of the octree universe. Scale F a c to r  The scale factor used to map the object space to the octree universe. To improve the ‘functionality’ of the linear octree a number of attributes are associated with each spatial index. These are: G ro u p in g F a c to r  When a leaf node is not a voxel the octal string for the octant will have less than R digits. The first ( R — S ) digits of the string are significant while the remaining S digits are insignificant. To distinguish between significant and insignificant digits the octal string is padded out with a set of 0’s until there are R digits. The grouping fa c to r (,g f) defines the number of 0’s added to the string and is an integer 0, 1, . . . , R — 1. Thus, a voxel will have a grouping factor of g j = 0 and an octant, at a level of resolution of S', will have a grouping factor of g j = S . O b ject a n d R egion N u m b e r  Within the octree universe there may exist a number of dis crete objects. To identify leaf nodes which define a particular entity, each octal string is assigned a set of attributes. In A E G IS , this set includes an object n u m b e r , which defines a discrete feature, and a region num ber which defines a class of features. For example, a shaft may be considered as a discrete entity in the class of features ‘underground openings’. Implementation considerations have limited the number of ‘objects’ to 32 and the number of ‘regions’ to 8: a single byte with fields unsigned object:5 and u n sig n ed region:8. V is ib ilit y B it S trin g  Each node in the octree represents a cube. If a face of such a cube is on the surface of the object and adjacent to empty space, referred to as the background , it is visible. This property can be represented by a single ‘bit’: the bit is set to 1 ( blocked ) if the face is visible and to 0 ( unblocked ) if the face is not visible (Gargantini et al., 1986). As a cube has six faces only a single byte is required to store this information. C o n tact B it S trin g  If the face of an octant is adjacent to an octant with a different object or region number it is not visible, yet, is on the surface of the object. Such a face is termed a c o n ta c t face and, in the same manner as the visibility property, can be represented by a single bit set to either 1 ( c o n ta c t ) or 0 ( no c o n ta c t). Again, only a single byte is required to store this information. The complete data structure for a linear octree is an array or linked fist of octal strings, with associated attribute variables, and a mapping record. Program code fragments 4 .1 and 4.2 illustrate how such an octree can be implemented in the ‘C ’ programming language and Table 4.3 is the full linear octree for the physical object in Figure 4.5. The encoding of octants has been discussed as an intuitive process. This is, obviously, an impractical method of generating the linear octree representation of a physical object and an algorithmic approach is required for the general case. 4.4
Linear Octree Generation
The linear octree representation of an object is created by converting either a point data set, a block model or a boundary model into a set of octants. This is a three phase process: transforming the object space into the octree universe, encoding a set of voxels and com pressing them into octants.
4.4. LINEAR O C T R E E G E N E R A T I O N
Octal Key
Grouping
Object
Region
Factor
No.
No.
002
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2
2 2 2 2 2 2 2 2 2 2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
1 1 1 1 1 1 1 1 1 1
5
3
6
6
003 m
005 006 007
012 020 021 022 030 031 033 040
211 300 301 310 351 355 400 440 454 455 456 457 474 475 476 477 655 700
3
83
Visibility Bit String
0 0 0 1 0 1 1 0 0 1 0 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1
0 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 1 1
0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1
1 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1
Contact Bit String
1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1
1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
Table 4.3: C om plete L in ear Octree f o r F igure J^.5
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
84
struct octree_node { /* Octant */ in t code; unsigned char g_factor; object:5; unsigned region:3; unsigned unsigned char v is ib il i t y , contact; >; struct octree_node linear_octree[1000000]; /* Linear Octree * / Program 4.1: A L in ea r O ctree D a ta S tru ctu re Im p lem en ted as an A rray
struct octree_node { /* Octant */ int code; unsigned char g_factor; unsigned object:5; unsigned region:3; unsigned char v is ib il i t y , contact; struct octree_code *node; >; struct octree_code *linear_octree; /* Linear Octree */ Program 4.2: A L in ear Octree D a ta S tru ctu re Im p lem en ted as a L inked L ist
4.4.1
Transformation of the Object Space
The octree universe is a positive integer modelling space with dimensions 2 R X 2 r X 2 r . A physical object exists in E 3 and, therefore, a transformation is required to map the object space into the octree universe. Such mapping involves translating the object space to the origin, scaling the transformed coordinates and rounding the real values to their nearest integer equivalent:
xobject
where:
3
—
k

xmin Scale yobject ~ ymin Scale zobject ~ zmin Scale
(4.1) (4.2) (4.3)
4.4. LINEAR O C T R E E G E N E R A T I O N
Xmin/max Vmin/max Zmin/max
Scale Extent
8 5
minimum/maximum x value in object domain minimum/maximum y value in object domain minimum/maximum z value in object domain Extent Xmax  Z m m Vmax  ymin Zmax ~ Zmin
{
The greatest of these values
Once the object space has been transformed any 3D coordinate, within this space, will be a positive integer value ranging from 0 to 2 R —1. Such coordinates can be converted into a spatial index by means of an encoding algorithm.
4 .4 .2
T h e E n c o d in g A lg o r ith m
The encoding algorithm uses a bit in te rla c in g (Abel et a l. , 1983; Mark et al. , 1986; Peuquet, 1984) technique to convert a transformed 3D Cartesian coordinate into a spatial index. The latter represents a voxel with a base vertex located at the transformed coordinate (*,j, k ). This interlacing technique combines the bits of the binary values of the i , j and k coordinate into a bit strin g . The decimal value of this string is the M o rto n N um ber while the octal value is the linear octree spatial index. Assume the Cartesian coordinate system to be right handed. The first bit, or the m ost sig n ifican t bit (MSB), in the interlaced string is the first bit in the binary t value. The second bit in the string is the first bit in the j binary value and the third bit in the string is the first bit in the k binary value. The fourth, fifth and sixth bits in the interlaced string are the second bits in the binary values of *, j and k , respectively and so on. Figure 4.8 illustrates the interlacing process and Program code fragment 4.3 is an implementation of the algorithm.
4 .4 .3
T h e C o m p r e ssio n A lg o r ith m
The encoding algorithm converts discrete 3D coordinates into voxels at a predefined resolution. Such encoding does not consider the spatial coherence of the data and, therefore, a com pression process is required to condense the voxels into octants: a bottom up approach (Samet, 1990). If eight adjacent voxels are the suboctants of a parent octant they can be represented by that parent octant. Similarly, if eight adjacent octants, at a level of resolution S , are the suboctants of a parent octant they can also be represented by their parent octant. This is illustrated in Figure 4.9 and can be more formally stated as: Eight octants at a level of resolution S can be compressed into a single octant at a level of resolution S + 1 if the integer part of the subdivision Morton Number
85+1 is equal for all eight octants. The octal string of the parent octant is equivalent to that of the suboctant with a similar base vertex.
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
86
i = l (1Q) _ 01 (2)
Figure 4.8: The B it In terlacin g Technique The compression algorithm has little effect on 2D surfaces and one dimensional point data, such as mine utility locations and survey station coordinates. Its effect is most pronounced when encoding solid models. 4 .4 .4
E n c o d in g a B lo c k M o d e l
A typical representation of a block model is a list of coordinates, defining the centre of each block, and their associated property value. To encode such a model the object space must be mapped into an octree universe and the property values discretised into ranges. In A E G IS , there are only 256 possible ranges as the attribute variables in the data structure are stored in a one byte integer: unsig n ed object:5 and unsigned region:8. The values of these variables are determined by the threshold equation:
Object number Region number
(4.4)
P' 32
where: p i
___
^
P m i n
scale
Scale Pfnin Pmax P
Pfna255
= n = Minimum property value — Maximum property value = Property value
(4.5)
4.4. LINEAR O C T R E E G E N E R A T I O N
Figure 4.9: O c tan t C om pression
87
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
88
encode (i, j, k) int i,j,k ; int code, bit_shift, digit; code=0; bit_shift=0; while ((i>0) II (j>0) II (k>0)) { digit = (((i&l)  ((j&l) « 1)  ((k&l) « 2)) « bit_shift); i » = 1; j » = 1; k » = 1; code = digit; bit_shift += 3;
> return(code);
> Program 4.3: The Encoding A lgorithm using B it In te rla c in g
Having discretised the property values and encoded the transformed coordinates into spatial indices, the octree model can be compressed. To illustrate the encoding and compression processes consider a block model representing the grade distribution in a mineral deposit. The object space has dimensions 1200m X 1350m x 200m. Each block defines a volume of 15625m3 and has a property value ranging from < 2 % to > 10 % . After discretising these values and encoding the transformed coordinates, the octree model has 49,500 voxels which, when compressed, is reduced to 24,860 voxels and 2163 octants. Although the voxel and compressed models are, visually, little different, the latter is 4 5 % more compact with respect to computer memory. Plates 4.1 and 4.2 show the exterior and part of the interior of this model.
4 .4 .5
E ncoding o f Line M odels
A line is represented, in a boundary model, by two vertices and their connectivity: an edge. As the octree universe is an integer coordinate system an edge is made up of a discrete number of points. If these points are known, a voxel representation of the edge can be generated using the encoding algorithm (Chan et al., 1986). The discrete points on a line in 3D space can be identified by backprojecting the coordinates of points determined using B re s e n h a m ’s line algorithm (Bresenham, 1965) on a 2D projection of the line. In practice, this discretisation is achieved by a three phase process (Chan et al., 1986):
89
4.4. LINEAR O C T R E E G E N E R A T I O N
3 D to 2 D P ro je ctio n  The line is projected on to a plane which is orthogonal to the axes of the coordinate system. The choice of plane is determined by the value of the direction ratios of the line: Plane(tj) =>
i > 8k j8 8j > 8k
P l a n e =>
t > 8j j8 8k > 8j \
Plane(jJk) => j t where:
8i 8j 8k V VI
8j > 8i 8k > S i
— V? —Vi (direction ratio fort) = V j — Vj (direction ratio fory) = Vj^ — Vk (direction ratio for k ) = Start Vertex
=
End Vertex
Figure 4.10 illustrates this choice of projection. T race line  The projected line is traced using a differential line algorithm2 as illustrated in Figure 4 .11.
2D
to 3 D P ro je ctio n  The ‘traced’ 2D coordinates are projected back into 3D space by the application of direction ratios. The projection equations for the three orthogonal planes are:
Plane(,y) : kproj ected =
Plane^j.) : jprojected
Plane(jfc) : iprojected
where:
8i 8j 8k V
= =
= =
—
—
(4.6)
2 r , D + v » + 2 [(t ^ ) +
v
8Vi 8Vj
Start Vertex
V'
8Vk
( S jx S V k ' W ; >
*+ V
2
iV i j  Vj kV k
(S *xS V t \ ( s v { ; + v *]
=
V !V f
= = =
V jV ,
+
(4.7)
(4.8)
VJJV* End Vertex
Once the discrete points on the line have been determined they are converted to voxels, at a given resolution, by the encoding algorithm: a linear octree representation of a line in 3D space. Plate 4.3 shows a contour data set represented by an octree model at resolution R — 9. It should be noted that a modified differential line algorithm could be used to trace a line in 3D space. 2A detailed discussion on a differential line algorithm is presented in numerous texts. One such text is Funda mentals of Interactive Computer Graphics, Section 11.2.2 (pp. 433) (Foley et al., 1982).
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
90
jaxis
dLik> dLjk > dLij
Figure 4.10: P ro jectio n o f a L ine onto an O rth o g o n al P la n e
jaxis
Figure 4 .11: R a ste riz a tio n of a L ine using a D ifferen tial A lgorithm
4.4. LINEAR O C T R E E G E N E R A T I O N
91
4 .4 .6 E n co d in g o f Surface M od els A surface in a boundary model is represented by a connected set of edges. As the octree universe is an integer coordinate system the surface can be described by a set of discrete points. If these points are known, a voxel representation of the surface can be generated using the encoding algorithm (Chan et al., 1986). The discrete points on a surface in 3D space can be determined using a scan co n v e rsio n algorithm (Foley et al., 1982). The latter, which employs an ordered edge list technique (Rogers, 1985), operates on a 2D planar polygon; the 3D surface must be projected on to a plane which is orthogonal to the axes of the coordinate system. The choice of projection plane is determined by the value of the components of the plane equation defining the surface (Chan et al., 1986):
Plane^y) =>•
c > a c > b
Plane(.'<0 => ]
b
P lane^) =*
a > b a> c
>e
where a , b and c are the components3 of the plane equation a i + b j + ck = —d. The edges of the projected surface are traced using differential line algorithm. These traced edges are used to control the scan conversion which, with reference to Figure 4.12, is a threestep process: 1. Determine the intersections of the scan line with all the edges of the polygon. 2. Sort the intersections by increasing coordinate along one axis. 3. Fill in all the discrete points between pairs of intersections. Once the 2D surface has been scan converted the ‘rasterized’ polygon is projected back into 3D space. The third dimension of each discrete point is calculated using the general equation (Chan et al., 1986): k = — (at + b j + d ) / c
For each projection plane this equation can be expanded:
Plane^y) : kproj eci e^
Vk + k =
[v* 
Plane(ijfe) . jprojccted
V j+ j =
V i
Plane^j.) : I projected
Vf + i =
V
c
) ( a ( i  V i ) + c ( k  V k) \
V
b )\ f H i  V i ) + c ( k  V k) \ 1
^
a
)\
(4.9) (4.10) (4.11)
3The components of a plane equation can be calculated by evaluating a determinant containing the three independent variables i , j , k (Bowyer et al., 1983).
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
92
j  axis
Intersection o f scan lines with the edges o f the polygon. Scan lines are parallel to the i  axis
O
P ixel defining edge o f polygon
•
P ixel at intersection o f scan line and polygon edge
i  axis axis
16
ftl^ilM1w
14
12 10
ir
“ti II
f
PEiS1 4
8
F illin g in o f all the discrete points
w
between pairs o f intersection points
t
6
ft 4
4
2 0
—4
i—
f v— 10
12
14
16
iaxis
Rasterised polygon
Figure 4.12: Rasterization of a Polygon using a Scan Conversion Technique
93
4.4. LINEAR O C T R E E G E N E R A T I O N
where *, j and k are the coordinates of a discrete point on the surface, V i,V j and Vjt are the coordinates of a vertex of the polygon and a , b and c are the components of the plane equation a t + b j + ck = d. The discrete points defining the surface in 3D space are converted to voxels using the encoding algorithm: a linear octree representation of a surface. Such a surface is illustrated in Plate 4.4 which is an octree model of a hypothetical topography at resolution R = 9.
4 .4 .7
E n c o d in g o f S o lid M o d e ls
In Section 2.2, the surface of a solid object was defined as a realisable p lan e model: a plane model that can be drawn on the boundary of an rset (Mantyla, 1988). As such a surface model bounds a connected subset of E 3 and is both continuous and closed, it cannot have any ‘holes’. This characteristic is fundamental to the generation of a linear octree model of a solid object. The surface of a solid object is represented in a boundary model by a set of planar polygons. If the surface is a realisable plane model the voxel representation of the surface will divide an octree universe into two regions: the in n e r co m ponent and the ou ter com ponent. The linear octree model of the solid object can be generated by either combining the inner component with the surface voxels or subtracting the outer component from the octree universe. To appreciate the mechanics of this process an understanding of octant connectivity for solid and surface models is required. 4 .4 .7 .1
O c t a n t C o n n e c t iv it y  T e r m in o lo g y
Octants are connected to each other if they are a d ja c e n t, i.e. ‘touch’. In an octree universe there are only three forms of adjacency: 1. Face to face  Figure 4.13a. 2. Edge to edge  Figure 4.136. 3. Vertex to vertex  Figure 4.13c. Such adjacency can be formally stated (Chan et al., 1986) as: Two voxels, Q ( i , j , k ) and Q , {i, ) j t, k1), are 0 (p ) a d ja c e n t for p = 0 ,1 ,2 ,3 iff
0 0 0
< < <
11 13 ~
1
< f I < \k  k1 1 <
1 1 1
& & &;
and (I* “ *'l +  i  /  + I k  k ' \ ) = p If the two voxels are not 0(p)adjacent they may be connected by an 0 (p )  p a t h , for p = 0 ,1 ,2 ,3 , if there exists a sequence of voxels Q —> Q ' such that for 5 = 1, ...,m; m > 0, Q s i and Q s are 0(p)adjacent (Chan et al., 1986).
94
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
B : ‘ Edge  to  Edge’ Octant Connectivity
C : ‘Vertex  to  Vertex’ Octant Connectivity Figure 4.13: C onnectivity of O ctan ts
4.4. LINEAR O C T R E E G E N E R A T I O N
95
If the two voxels, Q and Q 1, exist in a set U they are said to be O (p )c o n n e c te d in U for p = 0 , 1 , 2 , 3 if there exists an 0 (p ) p a t h from Q to Q consisting entirely of voxels in U (Chan et al ., 1986).
1
If all the voxels in U are 0(p)connected, U is called O (p )co n n ected . If only a subset of U is 0(p)connected, that subset is called an 0 (p )c o m p o n e n t of U (Chan et al., 1986).
4.4.7.2
Octant Connectivity —Solid Models
An octant or voxel is a cube and is, therefore, a valid solid object. If a number of cubes are connected with ‘facetoface’ adjacency the resultant object will be a valid solid since the outer surface is a realisable plane model (Figure 4.14). Similarly, an 0(l)com ponent is a valid solid as each octant is 0(l)connected to its adjacent octant. This is not true, however, for 0 (2 )components and 0(3)components which contradict the topological definition of a solid model: With reference to Definition B.4 (Appendix B), consider two voxels which are 0 (2 )connected. The edge common to both voxels can be identified with fo u r other edges (Figure 4.15); the two voxels do not represent a single ‘solid’ object. With reference to Definition B.4 (Appendix B), consider two voxels which are 0 (3 )connected. The twelve polygons, defining the surface of the connected voxels, cannot be arranged into a single cycle (Figure 4.16); the two voxels do not represent a single ‘solid’ object. To represent a valid solid object, a linear octree model must be an 0(l)component.
4.4.7.3
Octant Connectivity —Surface Models
The voxels on the surface of an 0(l)component (valid solid object) are 0(l)adjacent to the in te rio r octants as all octants are 0(l)connected. If the interior octants are removed the voxel representation of the object surface is revealed: the ‘skin’ of the object. This skin will be closed and will contain voxels which are either 0(l)connected or 0 (2 )connected. W ith reference to Figure 4.17, this is reasoned as follows: Consider a voxel on the skin of an O(l)component. If the neighbour, or 0(l)adjacent voxel, is itself on the surface of the object, the two adjacent voxels are 0(l)connected. If the neighbour is not on the surface i.e. an interior octant, it must be 0(l)adjacent to six neighbours; all of these neighbours are 0(2)adjacent to each other. Interior octants of an 0(l)component have six neighbours which are, themselves, a part of the 0(l)component. Such octants are not adjacent to the background and are, therefore, encapsulated by the surface voxels: the skin is closed. For a linear octree m odel to represent the surface of a valid solid object (realisable plane m odel) it m ust be closed and the voxels m ust be at least 0 (l) c o n n e c te d or 0 (2 ) c o n n e c te d .
96
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
Cuboid Model with ‘Face  to  Face’ Connectivity of Component Cubes
Realisable Plane Model of Cuboid Model
Figure 4.14: Connectivity of Linear Octree ‘Solid’ Models
4.4. LINEAR O C T R E E G E N E R A T I O N
C o m m o n edge o f 0 (2 )  connected Octants
C om m on Ed ge ‘identified’ four times
Figure 4.15: Connectivity of Linear Octree ‘S olid’ Models  0 (2 )a d ja c e n c y
97
98
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
Figure 4.16: Connectivity of Linear Octree ‘Solid’ Models  0 ( 8 )  adjacency
4.4. LINEAR O C T R E E G E N E R A T I O N
An interior voxel and six neighbours
0(2)  adjacency of the six nieghbours of an interior voxel Figure 4.17: Connectivity of Linear Octree ‘S urface’ Models
99
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
100
4.4.7.4
Im plem entation of the Solid Model Generation Process
If a linear octree model represents the surface of a plane model it is a skin and as such will partition a ‘solid’ octree universe into an inner 0(l)component and an outer component4. This is reasoned as follows: As the skin is closed, interior octants cannot be 0(l)adjacent to the background. The latter cannot be a part of the inner 0(l)component and is, therefore, a second discrete component. The practical implementation of this process is achieved by combining a number of octree mod elling utilities5: 1. B oolean S et D ifference O p eratio n : The skin of the solid object is subtracted from a solid representation of the octree universe using the se t difference operator. Figure 4.18 illus trates this process using a 2D octree or quadtree ; a 3D model is difficult to depict. The ‘solid’ octree universe can be generated intuitively as it is defined by eight full octants at S = R —l . The linear octree model for a universe at resolution R = 9 is given in Table 4.4.
2.
C om ponent Identification: Once the surface voxels have been subtracted from the solid oc tree universe the inner and outer components can be identified and separated by a connected com ponent labelling algorithm (Figure 4.19).
3. B oolean S et U nion O p eratio n : The skin is combined with the inner component using the u n io n set operator (Figure 4.20). To illustrate the solid model generation process consider a trivial example. The boundary model for a rectangular box is defined by eight vertices, as in Table 4.5. Before these coordinates can be encoded into octal strings, they must be mapped into an octree universe. This is achieved by defining the extent of the object space: 1665 units, the resolution of the octree universe: R = 5 and a scale factor: Scale Factor =
E x te n t
1665
25
52.03
A translation is not desired in this example and, therefore, the mapping function is simply a scaling operation. The transformed coordinates are shown in Table 4.6. The solid linear octree model for the rectangle is derived as follows: 1. Generate a voxel model of the boundary defining the rectangle. 2. Generate a solid model of the octree universe at resolution R — 5. 3. Subtract the voxel model of the boundary from the solid model of the octree universe.
'‘ T h e ou te r c o m p o n e n t c a n be a sin g le 0 ( l)  c o m p o n e n t or any n u m b e r o f such co m p o n e n ts. s T h e B o o le a n S e t O p e r a t o r s a n d the C o n n e c te d C o m p o n e n t L a b e llin g a lg o rith m are discu ssed in la te r sectio ns.
4.4. LINEAR O C T R E E G E N E R A T I O N
Solid Quadtree (Octree) Universe
101
Quadtree (Octree) Surface Model
Bisected Quadtree (Octree) Universe
Figure 4.18: Solid Model Generation  Set Difference Operation
102
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
Figure 4.19: Solid Model G eneration  Connected Com ponent Labelling
4.4. LINEAR O C T R E E G E N E R A T I O N
Figure 4.20: Solid Model Generation — Set Union Operation
103
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
104
Base Vertex Apex Vertex Extent = 512 Octal String
Grouping Factor
x = 0.00
y = 0.00 * = 0.00 y = 512.00 * = 512.00 Scale Factor = 1 . 0 0 Resolution = 9 x = 512.00
Object Number
Region Number —x
000000000 100000000 200000000
8 8 8 8 8 8 8 8
300000000 400000000 500000000 600000000 700000000
1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2
1
0 1 0 1 0 1 0
Visibility Bit String — z y +y
0 0 i
l
0 0 1 1
0 0 0 0 1 1 1 1
0 1 0 1 0 1 0 1
l i
0 0 1 1 0 0
+Z
1 1 1 1
0 0 0 0
Table 4.4: L in ea r Octree fo r a R esolution R = 9 U niverse 4. Extract the inner component of the rectangle. 5. Combine the inner component of the rectangle with the voxel model of the boundary (the skin of the rectangle). The primary requirement for successful solid model generation is the availability of a linear octree skin. Such octree models can be generated from boundary representations using the surface model generation process. The latter ensures a closed 0(l)connected or 0(2)connected surface octree if the boundary model is, itself, a realisable plane model.
Vertex Number
1 2 3 4 5
6 7
8
X
y
z
Coordinate
Coordinate
Coordinate
10.00 1610.00 1610.00
10.00 10.00
1610.00 1610.00
10.00
10.00 10.00 1610.00 1610.00
10.00 10.00 10.00 10.00
1610.00 1610.00
1610.00 1610.00 1610.00 1610.00
10.00 10.00
Table 4.5: B oundary Model for a Rectangular Box
105
4.4. L I NEAR O C T R E E G E N E R A T I O N
Vertex Number
t Coordinate
1 2
0 0 0
6 8
Coordinate
Coordinate
31 31
0 0 0 0
31 31
31 31 31 31
0 0
31 31
7
k
0 0
31 31
3 4 5
j
0
Table 4.6: T ran sfo rm ed B o u n d ary M odel fo r a R ectangular Box
Consider a single polygon in the context of a realisable plane model. The surface generation process scan converts the 2D projection and generates a set of pixels 6. The latter are 0 (1)connected as, with reference to Definition B.2 (Appendix B), the topological neighbourhood of an identified group of vertices is a disk; every point in the realisable plane model has a topological neighbour. When the pixels are backprojected into 3D space the resultant voxels will either remain 0 (1)connected, become 0(2)connected or become disconnected, as illustrated in Figure 4.21. This connectivity is determined by the difference in backprojection in crem en t (8bp) between adjacent voxels. With reference to equations 4.9, 4.10 and 4 .11, the backprojection increments, for each orthogonal projection plane, are:
Plane ^
:8bpk =
Planer :8bpj
=
Plane^) :8bpi
=
a ( . '  V ; . ) + 6 ( j  V ).) (4.12)
C a { i  V i ) + c { k  V k)
(4.13)
b b tiV ^
+
cik V t)
(4.14)
a
where i , j and k are the base vertex coordinates of a voxel on the surface, Vi,Vy and Vk are the coordinates of a vertex of the polygon and a, b and c are the components of the plane equation at + b j + ck = d. The difference between increments, for adjacent voxels, can be evaluated in terms of the com ponents of the plane equation. Taking the i O j projection plane as an example, the difference in increments for adjacent octants in the two principle axes is: SbpA , = *  * ) + * ( *  * »
c S b p B .
,
, =>
=
A pixel, or picture element, is the 2D equivalent of a voxel.
SbpBt

SbpAi
= 
106
C H A PT E R 4.
A D A PTIV E SPATIAL SU B D IV ISIO N IN A E G IS
Example of 0 (1)  connected and 0(2)  connected surface voxels
Example of 0(3)  connected and disconnected surface voxels Figure 4.21: Connectivity of Backprojected, Voxels
4.5. O C T R E E M A N I P U L A T I O N
6bPA ,
107
= • E r .H K iM => SbpB j — SbpAj = —
SbpB j =
c
The rounded value of ^ determines the connectivity of adjacent voxels: flcJl > 1 “ Voxels will be disconnected (Figure 4.22a). rifJI < 1  Voxels will be 0(2)connected (Figure 4.226). [[^]] = 0  Voxels will be 0(l)connected (Figure 4.22c). To ensure that voxels remain connected, c must be greater than or equal to a which, as stated in Section 4.4.6, is the criterion for choosing the i j plane as the projection plane. By inspection, this reasoning holds true for the j k and ik projection planes; the surface generation process ensures a linear octree skin. Once a physical object has been converted to a linear octree model, the latter can be manipulated, analysed and visualised.
4 .5
O ctree M a n ip u la tio n
The linear octree manipulation functions include Boolean set operations and transformation operations. These functions involve tree traversals and case analyses.
4 .5 .1
Set O p e ratio n s on L in e ar O ctree M odels
Conventional Boolean operations: u n io n , in tersec t and difference , operate on pointset models which are not constrained by the concept of solidity. For example, the result of an intersection operation on two voxels, which axe 0(2)adjacent, is a pointset defining an edge, as shown in Figure 4.23. Such a set is not regular and, therefore, contradicts the definition of solidity. To overcome this problem solid modelling theory uses regularised set operations, denoted by n*,U* and \*, which are regularitypreserving variants of their classical counterparts (Mantyla, 1988; Tilove, 1980). In octree theory octants represent both the occupancy and the com position of space. The latter refers to the heterogeneity of objects. Regularised set operations do not consider object com position and cannot be used, without modification, on linear octree models. For example, with reference to Plate 4.5, consider the intersection of two linear octree models which have differing object and region numbers. Which attribute values does the resultant set inherit? There are three solutions to this problem: 1. The attributes of model A (red). 2. The attributes of model B (yellow). 3. Attributes differing from those of both A and B (green).
108
C H A P T E R 4. A D A P T IV E SPATIAL S U B D IV ISIO N IN A E G IS
Figure 4.22: Connectivity fo r Backprojection Increm ents
4.5. O C T R E E M A N I P U L A T I O N
109
E d ge o f intersection is not a S o lid object
j  axis
j axis
_________X
l a x is
jaxis
k  axis
k  axis Object 2
Object 1
k  axis Object 1 H Object 2 F ig u r e 4.23:
T h e se p r o b le m s are o ve rc o m e b y
Nonregularity of Classical Set Operations regularised octree se t o p e ra tio n s w h ic h are v a r ia n t s o f th e c la s
sic a l set o p e ra tio n s, in c o r p o r a t in g the c o n ce p t o f c o m p o s it io n . U s in g s y m b o lic s c rip t, t o p o lo g ic a l n o ta tio n a n d V e n n d ia g r a m s , th e se o p e ra tio n s c a n be d e fin e d as follow s.
R e g u l a r i s e d O c t r e e U n i o n  T h e re g u la rise d octre e u n io n set o p e ra tio n ( U * ) is d e fin e d as
A u : w here th e c o m p o s it io n o f
B = C = c(i(A oB ))
C is th a t o f A ( F ig u r e 4 .2 4 a).
R e g u l a r i s e d O c t r e e J o i n  T h e re g u la rise d octre e j o in se t o p e ra tio n ( M * ) is d e fin e d a s
A m : B = C = c(t(Au(B\A))) w h ere th e c o m p o s it io n o f
Ca Cq
= =
C is s p lit in to tw o se ts ( F ig u r e 4 .24 b): {x\x G A } c o m p o s it io n o f A {x\x E B a n d x\x £ A } c o m p o s it io n o f B
R e g u l a r i s e d O c t r e e C o m b i n e  T h e re g u la rise d octre e c o m b in e set o p e r a t io n ( w : ) is defined as A W* w here th e c o m p o s it io n o f
B = C = c (i ( A U B ))
C is n e ith e r t h a t o f A n o r B ( F ig u r e 4.24c).
R e g u l a r i s e d O c t r e e I n t e r s e c t i o n  T h e re g u la rise d octre e in te rse c tio n o p e r a t io n ( n : ) is de fined as A w here th e c o m p o s it io n o f
n*
B = C = c {i ( A
D B ))
C is th a t o f A ( F ig u r e 4 .2 4 d).
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
110
Operator Union •■ '"•'•'•Oase""' Octal Key Comp. n i~ %
..........
nl "1 increment nj
Combine Octal Key Comp.
loin Octal Key Comp.
Intersect Octal Key Comp.
Difference Octal Key Comp.
. nl 1*1 *>1 **1 iiit/iviiicui ii i/ ii 2 increment nj/n 2 increment nj/n 2 increment n^n 2
*>1
new
increment nj
increment n t
decompose n2
decompose n2
increment n t
n2 suboctant of **i
increment n 2
increment n 2
increment n 2
decompose n j
decompose n j
i»i
**i *»1 increment nj
new *>i increment nj
ni 1*1 increment nj
UlV^ll/11IWlll 11 
ni 1*1 increment n j
new n2 increment n 2
increment n 2
111U1vu1V11L11 2
1*2 1*2 increment n 2
suboctantof 1*2
ni> nz
n2
"1
increment n 2
“2
**2
Table 4.7: C ase A nalyses fo r Octree S et O peratio n s R e g u larise d Octree D ifference  The regularised octree difference operation ( \* ) is defined as A \ l B = C = c { i(A \B ))
where the composition of C is that of A (Figure 4.24e). The implementation of these set operations involves a synchronous traversal of two linear octrees and a case analysis of corresponding nodes. Four cases can occur during the processing of these octrees: 1. Nodes n x and n2 have similar octal strings and grouping factors. 2. Node n x is a suboctant of node n2. 3. Node n2 is a suboctant of node n l . 4. Nodes n 1 and n2 have dissimilar octal strings and grouping factors. The results of these cases are determined by the type of operation and are listed in Table 4.7.
4 .5 .2
T ran sfo rm atio n s o f L in ear O ctree M odels
The rigid tra n sfo rm a tio n s of translation and rotation can be achieved by decoding the octal strings of an octree model, applying a transformation matrix and encoding the transformed coordinates.
4.5. O C T R E E M A N I P U L A T I O N
111
C : Octree Combine
D: Octree Intersection
E: Octree Difference Figure 4.24: Venn Diagram s for Octree Set Operations
C H A P T E R 4. A D A P T IV E SPATIAL SU B D IV ISIO N IN A E G IS
112
The decoding algorithm reverses the bit interlacing technique, used in the encoding algorithm, to extract the base vertex coordinates of an octant from an octal string. This technique is called bit unfolding (Gargantini et a l.y 1986) and can be formally stated as:
R
i
=
^
3) —2)in
(4.15)
N * position ((n x 3)  1) 10
(4.16)
[bit p o s it io n
((n
X
n=l R
j
= n=l R
k
=
^
jbit p o s it io n ( n X
3)10
(4.17)
n=l
Figure 4.25 illustrates this process and Program code fragment 4.4 is an implementation of the algorithm.
decode (code) in t code; in t r , i , j , k; in t b it _ s h if t , temporary_code, mask; mask = 7; i = j = k = 0; /* ‘ r e s o lu t io n ’ i s the re s o lu tio n of the octree u n iv e rs e . * / b it _ s h if t = (re so lu tio n * 3)  3; mask « = b i t _ s h i f t ; fo r (r = 0; r < re s o lu tio n ; r++) { temporary_code = mask & code; temporary_code » = b it _ s h if t ; i « = 1 ; j « = 1 ; k « = 1; sw itch (temporary_code) { case 1: i = i ; break case 0: break case 3: i = i; j l = j ; break; case 2: j l = j ; break; case 5: i = i ; k = k ; break; case 4: k = k ; break; case 6: j l = j ; k = k ; break; case 7: i = i; j l = j ; k = k ; break; > mask » = 3; b it _ s h if t = 3; > r e t u r n ( i, j , k ) ;
Program 4.4: The Octree B it Unfolding A lgorithm
The bit unfolding technique does not consider the resolution of an octant and the decoded co ordinate therefore represents the base vertex of the m ost sig n ificant voxel (M SV). The latter is a voxel which has an equivalent base vertex to that of the octant with an equivalent octal string, as shown in Figure 4.26.
4.5. O C T R E E M A N I P U L A T I O N
113
O c t a l S t r i n g = 27 M o rto n N um ber = 2 3 ^ ^
=
1 ~ 01 (2)  1 (10)
010111^
i  11 (2)  3 (10)
k = 01 (2) = 1 (10)
Figure 4.25: O ctree Decoding  The B it Unfolding Technique
Figure 4.26: The Most Significant Voxel
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
114
W h e n a n M S V is tr a n s fo rm e d a n d e n c o d e d th e n e w o c t a l s t r in g w ill b e a t a level o f r e s o lu tio n 5 = 0 i.e. a voxel. I f th e in it ia l o c t a l s tr in g , p r io r to t r a n s fo r m a t io n , is a t a level o f re s o lu tio n o f 5 > 0, th e n
— l ) vo xe ls are lost. T h is p r o b le m is o ve rco m e b y
decomposing each o c t a n t
before d e c o d in g . The
8 s —1 vo x e ls c o m p r is in g a n o c ta n t (e x c lu d in g th e M S V ) m u s t h ave o c t a l s t r in g s w it h M o r t o n
n u m b e r s g re a te r th a n t h a t o f th e p a r e n t o c t a l s tr in g . T h e s e c o n s titu e n t v o x e ls c a n b e d e te rm in e d b y a d d in g a d e c im a l in c re m e n t, fr o m 1 to
8s — 1, to th e M o r t o n n u m b e r o f th e o c ta n t:
V o x e l Key, = (j O c t a n t K e y  10 f *)g
w h ere « is a n in c re m e n t 1 ,2,...,
( 8 s —l j .
O n c e th e o c t a l s t r in g s h ave been d e c o d e d th e y are tr a n s fo rm e d b y m a t r ix m u lt ip lic a tio n :
T h e tr a n s la t io n m a t r ix
( ' J > k )translate
=
('> 3 > k )rotaU
=
V
*
R \ ]
0 0 oA 0 1 0 0 0 0 1 0 tk 1 )
(4.18)
U , t j , t k are th e tr a n s la tio n v a lu e s in the i , j a n d k d ire c tio n s re spe ctive ly.
T h e r o ta tio n m a t r ix 7
R is:
R (
* T J1
T is:
( 1
w h ere
*0
—
(p c o s xp (sin 9 sin
—s in (p s in 9 cos (p c o s 9 cos
2
V
(4.19)
*origin Pori gin—*centre ' Ri ' R j ' Rk ‘ Pcentre—
(9, ,6 ,0 )
o A 0 0 i J
w h ere
=
/(M ,V 0
=
h { e ,(f> ,ip )
= =
xp (cos
T o illu s tr a te th e tr a n s fo r m a t io n a lg o r it h m s c o n sid e r a n e x a m p le o ctree m o d e l, a t re so lu tio n
R = 7, w h ic h h a s 48640 vo xe ls a n d 15054 o c t a n ts as sh o w n in P la t e 4.6. I f th is m o d e l is 2 , t j = 5 a n d t* = 7 the re s u lta n t m o d e l h a s 48006 v o x e ls a n d 14705 o c ta n ts. I f th e m o d e l is ro ta te d 9 = 3 0 ,^ = 20 a n d xp = 110 th e re s u lta n t m o d e l h a s 748644 vo xe ls a n d tr a n s la te d £,• =
13594 o c ta n ts.
7An alternative method of specifying a rotation matrix is to define angles of azimuth and elevation.
4.6. O C T R E E ANALYSIS
4 .6
115
O ctree A n aly sis
The linear octree analysis functions include the calculation of integral properties, connected component labelling and spatial searching. The fundamental operations used in these functions are tree traversal and neighbour fin d in g which, for an octree model, is computationally efficient, requiring only bit manipulations and binary search.
4 .6 .1 In tegral P ro p erties o f L inear O ctree M od els The integral properties, which are of interest in mineral resources engineering, are volume and surface area. If a linear octree represents discrete objects in a complex domain these properties, as well as mass, can be calculated by using the following equations:
R 1 Volume V
Surface Area A
Mass M
=
\
E / .(« )
.5=0
/
R 1
\
=
E /.( « )
.5=0
/
R 1
\
=
E
.s=o
M s )
x Kv
(4.20)
xK a
(4.21)
x Kv
(4.22)
/
where R
Resolution of the octree universe
S
Level of resolution of an octant
Us)
E (0 5 x
U s )
E ( F* x 2S)
s s
&s )
Us)
Y
Po
Density of an octant
Os
Octant with a level of resolution S and a given object or region number
Fs
Blocked faces of a surface octant with a level of resolution S
(° S
X /?o X 8 5 )
and a given object or region number Kv
(scale factor)3
Ka
(scale factor)2
The practical application of these relations is achieved by a traversal of the linear octree: a list scan operation. Program code fragment 4.5 illustrates this technique using the ‘C ’ programming language.
116
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
integral_properties() register i; struct component_type { int object, region; float volume, surface_area, mass;
>; struct
component.type
component[MAX.OBJECT];
for (i = 0; i < MAX.OBJECT; i++) { component[i].region = 1; component[i].volume = 0.0; component[i].surface.area = 0.0; component[i].mass = 0.0;
/* MAX.OBJECT defines the maximum */ /* number of objects in the model */
> /* ‘number.of.nodes’ is the total number of nodes in the octree stored as an array ‘octree[]’. The function 'number.of_faces()’ calculates the number of visible and contact faces, for an octant, using the visibility and contact bit strings. */ for (i=0; i /* volume.factor = scale.factor**3 surface.area = scale.factor**2 object.density[]  predefined by user */ for (i = 0; i < MAX.OBJECT; i++) { component[i].volume = component[i].volume * volume.factor; component[i].surface.area = component[i].surface.area * surface.factor; component[i].mass = component[i].volume * object.density[i];
> P r o g r a m 4.5:
List Scan Algorithm to Calculate Integral P roperties
4.6. O C T R E E ANALYSIS 4 .6 .2
117
C o n n e c te d C o m p o n e n t L a b ellin g o f L in ea r O c tree M o d e ls
The connected component labelling algorithm used in A E G IS is based on the ‘separate into buckets’ algorithm, developed by Irene Gargantini (Gargantini et a l.y 1983), which identifies discrete 0(l)components in an octree universe. The algorithm consists of an in n e r and an ou ter phase. The latter is a list scan operation which identifies a ‘seed’ octant. This octant is placed in a queue7 which is processed by the inner phase (Gargantini et a l.y 1983). The inner phase labels the seed octant with a component number and investigates its six neigh bours using a node in clu sio n function and a node ad jac en cy function. The latter calculates the spatial indices of the 0(l)adjacent octants (see Section 4.6.3.1) while the node inclusion function, using a b in ary search 8, determines whether these indices exist in the octree file. If the search is successful and the neighbour has a similar composition to that of the seed octant it is placed in the queue and labelled with the current component number. Once all six neighbours have been investigated the queue is advanced one position, discarding the first octant (seed octant), and the phase is repeated for the new octant at the head of the queue. This continues until the queue is empty i.e. all the octants comprising the component have been identified. Having processed a component, control is passed back to the outer phase which increments the component number and identifies a new seed octant. The latter is the next octant in the file which has not been labelled. When all the components in the octree have been identified they can be extracted from the octree into separate files. To illustrate the connected component labelling algorithm consider as an example the identifi cation of component {004, 005, 007, (040,1), (400,1), (440,1)} of the simple object in Figure 4.5. With reference to Figure 4.27, the outer phase identifies ‘004’ as the seed octant and places it in the queue (step 1). The inner phase, after having identified the adjacent neighbours of ‘004’, places octants ‘005’ and ‘040,1’ in the queue and discards the initial seed octant (step 2). Three neighbours are identified for octant ‘005’. However, only ‘007’ is placed in the queue as both ‘040,1’ and ‘004’ have already been identified as part of the component i.e. labelled with the component number (step 3). Similarly, ‘400,1’ is the only neighbour of ‘040,1’ which is placed in the queue (step 4). Having processed ‘400,1’ (step 5), the last octant in the queue is ‘440,1’. Although the latter has three neighbours, octants ‘454’ and ‘456’ have dissimilar object and region numbers i.e. do not belong to the same component, and ‘040,1’ has already been labelled (step 6); the queue is empty and the process is returned to the outer phase.
4 .6 .3
S p a tia l S earch
The fundamental objective of spatial searching is to determine whether a point of interest exists in a known object space. With a linear octree model, one method of achieving this is to encode the integer cartesian coordinate of the point and determine its composition using a binary search on the octree list. In many situations, however, this method is not applicable as the cartesian co ordinate of the point of interest is unknown. To overcome this problem an alternative technique is employed which utilises the spatial coherency of the encoding scheme and is known as neighbour fin d in g . 7A queue is a ‘first in  first out’ data structure.
8A binary search is an efficient method of searching a sorted list (Schildt, 1987).
118
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
Step 1
Step 2 Queue (Labelled
005
1 (mi
Neighbouring Octant Left  Right  Up  Down  Front  Back
004(L)
X
X
007
X
 040, 1(L)
1
Step 4
Figure 4.27: Identification of a Connected Com ponent
4.6. O C T R E E ANALYSIS 4.6.3.1
119
T h e Neighbour Finding Algorithm
One characteristic of the encoding scheme is that each octal key explicitly defines the location of an octant in the universe with respect to the root of the abstract tree structure. Given an octal string, therefore, it is possible to calculate the spatial index of any other equal or greater sized octant without the need to convert to and from a cartesian system9. This is achieved by applying a case analysis function to the significant octal digits of a host octant in order of decreasing subdivision. More formally, this can be stated as (Gargantini, 1982):
W
= V i (I )
=
V l (d*_,) II V i (d R, 2)  ...  V i (d0)
(4.23)
where / ac^ is the spatial index of the octant of interest, I is the spatial index of the host octant, d s is one of the digits { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } , S : S = 0 , 1 , . . . , ! ? —1 is the level of resolution and Vj? (/) is the case analysis function for a vector with direction V : D = { R , L , £7, D , B , F } and distance £, : £, — 0 ,1 X 25 ,2 X 2 s }. . . , R 2 — 1. The following terminology (Samet, 1990) is introduced to ease the description of direction: R ight Up B ack
(R) : ft direction (U) : —j direction (B) : f k direction
Left D ow n F ro n t
(L) : —i direction (D) : f j direction (F) : —k direction
To explain how the case analysis functions can be derived, consider the function which determines the R ight neighbour (/) j of any octant. If the m o st sign ifican t d ig it10 (M SD) of the host octant has a value of {0,2,4,6}, the MSD of the adjacent octant will have a value of d f lg (Gargantini, 1982) and all other digits remain unchanged as the host and adjacent octant have a common parent (Figure 4.28a):
Iadj. = VjS (/) =
dR  1 dR 2 II— II\dMSD + ls
(4.24)
If the MSD of the host octant has a value of { 1 , 3 , 5 , 7 } , the M SD of the adjacent octant will have a value of df 7g (Gargantini, 1982). The adjacent octant will also have a different parent to that of the host octant and, therefore, digits at lower levels of resolution i.e. increasing S , must be further investigated (Figure 4.286):
Iadj. = V,1 (/) =
v ,1 (d R  i) V j (dR 2)  ...  IdMSD + 7„
(4.25)
The case analysis functions which determine the remaining five neighbours of an octant can be derived in a similar fashion. They are given, with reference to Figures 4.29 and 4.30, in Table 4.8.
°Linear octree transformations, as discussed in section 4.5.2, are an example of how the spatial index of any octant can be calculated from a known octal string by converting to and from a cartesian system. 10The most significant digit is the first significant digit in an octal string: ds,S = 0. The use of the term MSD is analogous with that of the term MSB.
120
C H A P T E R 4. A D A P T IV E SPATIAL SU B D IV ISIO N IN A E G IS
0 0 0 0
O ctant Host Neighbour 'd s+ llg dS 0 m 10 0 m 0 1 0 0 as 0 H 10 0 £ 0 M L 10 0 m
A : T h e R i g h t ( L e f t) N e ig h b o u r s o f O c t a n t s { 0 , 2 , 4 , 6 }
B : T h e R i g h t ( L e f t) N e i g h b o u r s o f O c ta n ts {1 , 3 , 5 , 7 } F ig u r e 4.28:
M ost Significant Digits fo r Right and Left Neighbours
B R
0 0 0 0
Octant Host Neighbour ld s+ 2lg ds 1 m o 1 m 1 ::P  o 1 m 1 M o 1 m . 1 J o 1 ;y l:
A : T h e D o w n (U p ) N e ig h b o u rs o f O c ta n ts { 0 , 1 , 4 , 5 }
B : T h e D o w n (U p ) N e ig h b o u rs o f O c ta n ts
{2
,3,6,7}
Figure 4.29: M ost Significant Digits fo r Down and Up Neighbours
4.6. O C T R E E ANALYSIS
121
u
D
Octant Host Neighbour lds+4lg ds 0 1 m o 1 m. 0 1 m Io 1 m 0 1 M 1° 1 M 0 1 m Jo 1 M
A : The Back (Front) Neighbours of Octants { 0 , 1 , 2 , 3 }
Octant Neighbour ldt+ 41, * 8 lds+i+ ^Ig1 1 5 _0_ HIIQ H o 5 T ■ Jo 5 T B : The Back (Front) Neighbours of Octants { 4 , 5 , 6 , 7 } Figure 4.30: M ost S ig n ifican t D igits fo r B ack a n d F ro n t N eighbours
D ir e c tio n
M SD
A d j. M S D
{0 ,2 ,4 ,6 }
hdj. = K jS { !) = J r  1 II d fi 2 II — II \dttSD + 1(8)
{1 ,3 ,5 ,7 }
{1 ,3 ,5 ,7 }
hdj. = V * ( I ) = V * ( d j t  , ) I I V * ( d * _ , ) I I ... II dMSD + 7(8)
{0 ,2 ,4 ,6 }
{0 ,2 ,4 ,6 }
hdj. = Vfs ( I ) = Vfs (d R + l) V * {dR_ 2) ...  dMSD + 1(8)
{1 ,3 ,5 ,7 }
{1 ,3 ,5 ,7 }
hdj. = V 2i ( / ) = d R  l d f i 2  ... II \dMSD + 7(8)
{0 ,2 ,4 ,6 }
{0 ,1 ,4 ,5 }
ladj. = Vfs ( / ) = dR i dje_2 ...  dMSD + 2(8)
{2 ,3 ,6 ,7 }
{2 ,3 ,6 ,7 }
hdj. = V § ( / ) = V $ (d B _ x ) V ° (d R 2) ...  dMSD + 6(8)
{0 ,1 ,4 ,5 }
{0 ,1 ,4 ,5 }
U . = V2U S ( / ) = V g (d R+1) V " (d R. 2) ...  dMSD + 2(8)
{2 ,3 ,6 ,7 }
{2 ,3 ,6 ,7 }
hdj. = V j s ( / ) =
dR—2 II ... II 1dMSD + 6(s)
{0 ,1 ,4 ,5 }
{0 ,1 ,2 ,3 }
hdj. = V&S ( I ) = djtx d f l 2  ...  I dMSD + 4(8)
{4 ,5 ,6 ,7 }
{4 ,5 ,6 ,7 }
hdi. = V ® ( / ) = V ® ( d *  l ) II V ® (d X  2)  ...  IdM S D + 4(8)
{0 ,1 ,2 ,3 }
{0 ,1 ,2 ,3 }
hd j. = V / s ( / ) = V 2S
(d B+1) \\v fs ( d n  2) I I ... I I 1dMSD + 41(8)
{4 ,5 ,6 ,7 }
{4 ,5 ,6 ,7 }
hdj. = Vfs ( I ) = dR l  dR—2 II ... II dMSD + 4(8)
R ig h t
L e ft
Dow n
Up
C a s e A n a ly s is F u n c t io n
Back
F ron t
1 II
Table 4.8: C ase A nalysis F u n ctio n s to D e te rm in e A d jacen t N eighbours
{0 ,1 ,2 ,3 }
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
122
On inspection, it can be seen that, for a given direction, there is a trend in the bit pattern of the M S D ’s. For example, in the Down direction if the second bit in the M SD is 0 the MSD of the neighbour will be ds + 2\% . Similarly, if the second bit in the M SD is 1 the MSD of the neighbour will be d$ + 6g This trend, which is illustrated in Table 4.9, allows the case analysis functions to be implemented using bitwise operators as opposed to a set of relational operators which involve exhaustive testing and are computationally less efficient. Program code fragment 4.6 is the ‘C ’ programming language implementation of these functions. C ase A n a ly sis Function  D ire ction
M o st S ign ifican t D ig it (M S D ) B inary Bit 3 Bit 2 (MSB)
 D istan ce  ^
1 tl
D ecim al
j
l
0
0
2 iiiiiiiif iii
4
iiiiiiiiiiiii ! ! l l !  ! l l ! l ! ! l ! l  !
6
1
t
0
0
W ;: 0
1
0
i
4
1
5
1
0
0 :
1
0 ;
2 3
D R ig h t
2s
(L e ft) i
Dow n
2s
(U p )
wm m m m
:
i Back (F ro n t)
2s
i Table 4.9:
Decim al
B in a ry Bit 3 Bit 2 (MSB)
0
1
0
0
1
3
0
1
1
0
5
1
0
7
1
1
2
0
3
0
S
0
6
1
&£:•••
1
7
1
0
0
4
1
0
0
0
1
5
1
0
1
0 :
i
0
6
1
1
0
t) ;
i
1
7
1
1
1
WM 1 W B
0
'$ x $
0 i
1 0 1
B it T re n d in th e M o s t S ig n if ic a n t D ig its
The case analysis functions presented in Table 4.8 determine the spatial indices of neighbours. In many situations, however, it is desirable to consider an octant which is positioned £ = n x 2 s , n : n = 2,3,..., ^§, units in any direction P : a d i s t a n t o c t a n t . One characteristic of the encoding scheme is that each digit in an octal string represents an octant of size 2 s x 2 s x 2 s . For a given level of resolution, therefore, a neighbour of equal size is positioned 2 s units in any direction V . The spatial index of such a neighbour can be determined by applying one of the case analysis functions to the appropriate digit in the octal string of the host octant, as illustrated in Figure 4.31. In a similar fashion, the spatial index of a distant octant can be calculated by identifying the neighbours of appropriate parent octants. The latter are those which have a dimension equivalent to the binary exponents of the distance £ — n X 2 s . Consider a distant octant positioned 5 units from the voxel I = 401 in the direction P = R . The binary exponents of £ = 5 are ‘2 ’ (22) and ‘O’ (2°). The distant octant is the neighbour of the octant at level of resolution S = 0 whose parent, at level of resolution S = 2, is also a neighbour: U.
= V ? ( I ) = V ? ( d 2)  < 2 .livedo) = V *(4)0V *(1) = 5V*(0)0
= 5  1 j 0 This is illustrated in Figure 4.32.
4.6. O C T R E E ANALYSIS
123
number_of_bits = 3 * g_factor; if (direction == J  direction == J) number_of_bits++; else if (direction == K II direction == K) number_of.bits +2; bit_position = 1 « number_of.bits; maximum.bits = resolution * 3; if (increment == PLUS) { do { if ((code & bit.position) !=0 ) code k= (“bit.position); number.of.bits += 3; bit.position « = 3;
/* Case analysis function for */ /* directions {R, D, B}. */
I
} else { code = bit.position; adjacent.code = code; node.adjacent = TRUE;
> } while ((number.of.bits < maximum.bits) &&
/ * Case analysis function for */ /* directions {L, U, F}. if ((code & bit.position) == 0) { code = bit.position; number.of.bits += 3; bit.position « = 3;
} else { code &= (“bit.position); adjacent.code = code; node.adjacent = TRUE;
> } while ((number.of.bits < maximum.bits) (node.adjacent == FALSE));
&&
} Program 4.6: E x tra c t o f A lgorithm to D e te rm in e A d jacen t N eighbours
*/
124
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
Figure 4.31: The Neighbour of an Octant Represented by an Octal Digit ds
4.6. O C T R E E ANALYSIS
125
u B R D
Voxel: I = 401 Direction :D = R Distance: L = 5
Identify the binary exponents of the distance and determine the neighbours of the appropriate octal digits The binary exponents of the distance are: L = 5 = 1012= 22+ 2°
The appropriate digits are: d 2 = 4  d o= 1
Octal String for the distant octant:
V5 (I)= vj(d2)d,v'(d.) =510 Figure 4.32: The Distant Neighbour of a Voxel with Spatial Index I = 401
126
C H A P T E R 4. A D A PTIV E SPATIAL SU B D IV ISIO N IN A E G IS
The binary exponents of C are synonymous with the decimal values of those bits which are set to 1. The appropriate parent octants are represented by the octal digits dp where: P = log (binary exponent) / log 2
Determining the spatial index of a distant octant can, therefore, be achieved by bitwise operators and a single relational operator in conjunction with the case analysis functions. Program code fragment 4.7 is the ‘C ’ programming language implementation of this process. The spatial search functions in A E G IS , which utilise both the ‘encoding’ and neighbour finding methods, can be categorised by the set of points which are of interest: the search w indow. These functions are discussed with reference to Plates 4.8 and 4.9 which show their operation on a linear octree model depicted in Plate 4.7. 4.6.3.2
R e g u la r and Irre g u la r S p a tia l Search
A regular search is one in which the search window is a region of space described, in parametric form, by a mathematical equation. There are many such regions, however, at present, only three have been implemented in A E G IS : A n O rthogonal P ris m a tic H e x ah ed ro n  The search window is a prismatic hexahedron which is orthogonal to the axes of the universe. It is described by a base vertex and an apex vertex: Vertex No.
1 2
3 4 5
6 7
8
Coordinates i
3 Ibasc Jbase *apez Jbase *apex Japex *basc Japex *6a«e Jbase *ape z Jbase *ape x Japex *basc Japex
k kbase kbase kbase kbase k i*apex k "'apex k "'apex k "'apex
ibase — *apcx jbase ^ Japex kbase ^ kapex
The spatial indices of the points of interest, which are calculated by a scan conversion process (Foley et al ., 1982), can be determined by using either the encoding algorithm or the neighbour finding algorithm. Program code fragments 4.8 and 4.9 are the ‘C ’ programming language implementations of the respective approaches and the top left image in Plate 4.8 shows the result of an orthogonal prismatic hexahedron search on the object in Plate 4.7. A Sphere  The search window is a spherical volume described by a point at the centre of the sphere and a radius. The spatial indices of the points of interest are determined in a similar fashion to those of the prismatic hexahedron. The top right image in Plate 4.8 shows the result of a spherical search on the object in Plate 4.7.
4.6. O C T R E E ANALYSIS
127
find.neighbour (d ire c tio n , distance, code, g .fa c to r) in t d irectio n , distance, code, g_factor; { in t b its , number_of_bits, maxinnim_bits, po sitio n _ in _ d ig it, b it.p o sitio n ; in t node.adjacent, adjacent.code, mask, zero, increment; nnm ber.of.bits = b it.p o s itio n = zero = 0; mask = 1; b its = 3 * g.factor; increment = MINUS; i f (abs(distance) == 0) return(code); i f (abs(distance) >= 0) increment = PLUS; i f (d ire ctio n == J) bits++; else i f (d ire ctio n == K) b its +=2;
/* Direction given as I, J or K */ /* and distance as e ith e r a */ /* positive or negative value */
maximnm.bits = resolution * 3; p o s itio n .in .d ig it = 1 « b its; do •( /* Determine neighbour for appropriate d ig its using */ i f ((d istan ce k mask) ! = 0) *C /* binary components of distance */ node.adjacent = FALSE; num ber.of.bits = b its; b it.p o s itio n = p o sitio n .in .d ig it; i f (increment == PLUS) /* Perform case analysis function for directions {R, D, B> */ else i f (increment == MINUS) / * Perform case analysis function fo r directions {L, U, F> */ num ber.of.bits = 3; b its += 3; p o s itio n .in .d ig it « = 3; distance » = 1;> else { num ber.of.bits = 3; b its += 3; p o s itio n .in .d ig it « = 3; distance » = 1;> } while ((num ber.of.bits < maximum.bits) k k (b its < maximum.bits) ((d ista n ce k ("z ero )) != 0 )); i f ((node.adjacent == FALSE)   (num ber.of.bits >= maximum.bits)) { adjacent.code = 1;> retu rn (ad jacen t.co d e);
Program 4.7: N eighbour F in d in g A lgorithm
kk
128
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
A L in e  The search window is a line, at any orientation in space, defined by two vertices. The points describing this line are derived using Bresenham’s line algorithm and encoded into spatial indices. The neighbour finding algorithm is, in this case, inappropriate as adjacent points may be either 0(l)connected, 0(2)connected or 0(3)connected. Program code fragment 4.10 is the ‘C ’ programming language implementation of this search function. The bottom left image in Plate 4.8 shows the result of a line search on the object in Plate 4.7. A P o in t  The search window is any point in space. As already discussed, the composition of such a point can be determined by use of the encoding algorithm and a binary search. An alternative method, known as Tracking, utilises interactive graphics techniques and is presented in section 4.7.1. An irregular search is one in which the search window is a volume described by another linear octree model. In practice such a search is equivalent to a regularised octree set intersection operation. 4 .6.3.3
Connected S p a tia l Search
A connected search is one in which the search window is defined by the connectivity of octants with a given attribute. Three such searches are generic to numerous applications: Com ponent Search  A component search identifies 0(l)components with a given object or region number. If the search criterion is an object number the component can be identified by a simple list scan: object numbers Eire unique. If, however, the search criterion is a region number the components are identified using the connected component labelling algorithm: each component is a unique object with a similar region number. The bottom right image in Plate 4.8 shows the yellow components of the object in Plate 4.7. B o rd e r Search  A border search identifies the surface voxels of a specified object or region. This is achieved by performing a list scan of the octree and investigating both the visibility and contact bit strings of the applicable octants. If a surface octant is not a voxel, but has a level of resolution of S > 0, it is decomposed such that only the appropriate voxels are identified. The spatial indices of the latter are calculated using the neighbour finding algorithm. The direction P equates to the face of the octant which is on the surface and the distance £ is 2s  1 . The top left image in Plate 4.9 is a ‘cut’ view of the border of the grey component in Plate 4.7. C o n tact Search  A contact search identifies the surface voxels of a specified object or region which is 0(l)adjacent to another object or region. This is achieved by performing a list scan of the octree and investigating the contact bit strings of the applicable octants. As with the border search, if a surface octant is not a voxel it is decomposed appropriately. The top right image in Plate 4.9 shows the contact voxels of each component in Plate 4.7 while the bottom images in Plate 4.9 show the contact voxels of the red and grey components separately. At present, only two applications, derived from these generic functions, have been implemented in A E G IS : a com ponent ad jacen cy search and a su rface co n to u r search. The component adjacency search identifies the composition of those components which are 0 ( 1 ) connected to a specified object or region. The search proceeds by applying the contact search
4.6. O C T R E E ANALYSIS
fo r
(i
129
= b a s e _ v e r t e x _ i; i
fo r
(j
fo r
<= a p e x _ v e r t e x _ i ; i + + )
{
= b a s e _ v e r t e x _ j ; j <= a p e x _ v e r t e x _ j ; j + + ) (k = b a se _ v e rte x _ k ;
code = e n c o d e (i,
j,
k <= a p e x _ v e r t e x _ k ;
{
k++)
{
k );
fo u n d _ n o d e = b i n a r y _ s e a r c h ( c o d e ) ; /*
P ro c e ss th e r e s u lt *)
W r ite
to
o f th e b in a r y
se arch :
d is k
*)
C a lc u la t e
in t e g r a l p r o p e r tie s
*)
V is u a lis e
e tc .
*/
> > > Program 4.8: A R egular ‘H exahedron’ Search utilising the E n co d in g A lgorithm
d e lt a _ k = a p e x _ o f_ b o x _ k  b a se _ o f_ b o x _ k ;
/*
The A p e x a n d t h e
B ase
box are in t e r a c t iv e ly fo r
(i fo r
= b a s e _ o f_ b o x _ i; i (j
= b a se _ o f_ b o x _ j; j
sta rt_ c o d e fo r
<= a p e x _ o f _ b o x _ i ; i + + )
(k = 0;
= encoded,
k <= d e l t a _ k ;
code = f in d j a e ig h b o u r
th e
{
<= a p e x _ o f _ b o x _ j ; j + + ) j,
of
d e fin e d
{
b a se _ o f _ b o x _ k ); k++)
{
( " k " , k,
sta rt_ co d e ,
0 );
fo u n d _ n o d e = b i n a r y _ s e a r c h ( c o d e ) ;
/ * P r o c e s s th e r e s u l t o f th e b in a r y s e a rc h : *)
W r ite
to
d is k
*)
C a lc u la t e
in t e g r a l p r o p e r tie s
*)
V is u a lis e
e tc .
*/
> > > Program 4.9: A R egular ‘H ex ah ed ro n ’ Search utilising the N eighbour F in d in g A lgorithm
*/
130
C H A P T E R 4. A D A P T IV E SPATIAL SU B D IV ISIO N IN A E G IS
struct line_points { int i , j, k; struct line.points *next_line;
>; struct line.points *line, *temp_line; line = bresenham_line(base_vertex_i, base.vertex.j, base.vertex.k, apex.vertex.i, apex.vertex.j, apex.vertex.k) ; while (line != NULL) { code = encode(line>i, line>j, line>k); found.node = binary.search(code); /* Process the result of the binary search: *) Write to disk *) Calculate integral properties *) Visualise etc. */ temp.line = line; line = line>next_line; free(temp.line);> Program 4.10: A R egular ‘L in e ’ S earch u tilising the E ncoding A lgorithm
function. The adjacent neighbours of the (contact) surface voxels identified are then determined using the neighbour finding algorithm. The object number of each neighbour represents an adjacent component. These numbers are recorded and are used in further processing. The function of the surface contour search is to generate a set of cartesian coordinates which, when sequentially connected, define a contour string in a plane orthogonal to the universe axes. To achieve this a voxel surface, which can be identified by using either the border or the contact search function, must be sliced , sorted and decoded. A slice is a set of voxels which lies in a plane orthogonal to the axes of the universe. If such a slice is intersected with a surface the resultant voxel set will be a contour at the given i , j or k elevation. This process is referred to as slicing and is illustrated in Figure 4.33 and shown in Plate 4.10. Implementation of the process can be achieved by performing a list scan operation and an investigation of the component of each octal string which corresponds to the axis of elevation. An octree set intersection operation is unnecessary, as illustrated in Program code fragment 4 .11. The voxel set representing a contour string is stored in ascending order (a characteristic of the linear octree encoding scheme). Such an order does not convey any information about the connectivity of points in the string and, therefore, the voxel set must be sorted accordingly. The latter is achieved by use of a modified neighbour finding algorithm which has a limited set of adjacency directions determined by the orientation of the slice. For example, if the slice is parallel to the i O j plane the adjacency directions will be {R , D , L, U }, as illustrated in Figure 4.34.
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
132
/* /* /* /* /*
This algorithm assumes that all octants have a grouping factor of 0 i.e. they are voxels. If the octree model has not been decomposed prior to slicing a decomposition function can be used to process appropriate octants i.e. those that intersect the desired elevation.
*/ */ */ */ */
struct octree_node linear_octree[MAX_NODES]; i = slice = 0; mask = 1; bit_position = 1 «
axis;
/* ‘axis’ has values which equate to bit /* positions (refer to bit interlacing /* algorithm): /* i == 0 : j == 1 : k == 2
*/ */ */ */
while (i < resolution) { /* This control loop is equivalent */ if ((mask & elevation) > 0) { /* to encoding a spatial index. */ slice = bit_position; mask « = 1; bit_position « = 3; > else { mask « = 1; bit_position « = 3; > i++;> for (i = 0; i < number_of_nodes; i++) I if((slicefelinear_octree[ i ] .code) = = slice) process(linear_octree[i]) ; >
{
/* Identify and process */ /* voxels at the desired */ /* elevation. */
> Program 4 .11: The Slicing A lgorithm
Figure 4.34: Search D irectio n s fo r a M odified N eighbour F in d in g A lgorithm
4.7. LIN EA R O C T R E E D ISPLA Y
4.7
133
Linear Octree Display
The linear octree display algorithm, used in A E G IS , was developed by Irene Gargantini (Gargantini et al., 1986) and implemented in a system called L inoct (Atkinson et al ., 1987). The algorithm is based on a backtofront mechanism which utilises the spatial ordering of the linear octree to identify hidden surfaces. Visible octants are projected with a parallel projection and displayed using both depth shading and a basic reflection model. The algorithm proceeds by defining a direction of view using a 3D transformation, sorting the octal strings of the linear octree in a ‘backtofront’ order and ‘painting’ the octants on to the screen. The octree universe is assumed to exist in a right handed world coordinate system, with axes {a : ,y ,z } . The dimension of this universe is 2 R x 2 R X 2 R . However, to ensure that the entire universe is visible from all angles, it is expanded to a maximum dimension of (Figure 4.35): (V
3)
2r
X
(\/3 )
2r
X
2r
This expanded universe is referred to as the view volume. The direction from the origin of the view volume to the viewer is given by a vector {x u, yv, zv}, called the view p lan e n o rm a l (V PN ). As the display screen is assumed to be normal to the V P N at all times, a second coordinate system, referred to as the view reference co o rd in ate system (V R C ), is defined by axes { u ,v ,n } where N coincides with the V P N (Gargantini et al., 1986). Figure 4.36 illustrates the relation between these coordinate systems. To view an object it is projected onto the view plane using an ax o n o m etric orth o g rap h ic projec tion. The latter assumes that the direction of projection (view) is coincident with the V P N and that the view plane may be freely orientated about the principle axes. The view volume axes {x, y , z } can be mapped onto the V R C { u , v ,V P N } axes in two steps: firstly rotating the x and z axes about the y axis, such that the positive z axis coincides with the projection of the V P N on the x O z plane, and secondly rotating the y and z axes about the x axis such that the positive z axis coincides with the V P N . The x axis maps on to the u axis and the z axis maps on to the V P N (Gargantini et al., 1986).
Figure 4.35: D im en sio n o f the View Volume
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
134
Figure 4.36: T ra n sfo rm atio n o f the O ctree Universe in to the View Volume The rotations are performed about the origin of the view volume coordinate system which, conventionally, is located at (0,0,0). Such rotations position the objects of interest outside the view volume and, therefore, two translations are required to maintain a field of view. The complete transformation is given by a matrix called the v iew .m atrix (Gargantini et a l ., 1986):
v ie w jm a trix
^origin — *centre * Ry ' Rx *^centre —► origin
sin 9
(
0
= > v ie w jm a trix —
—COS0 2
—(cos 0)(sin ) cos —(sin 9 ) (sin ) 2
(cos 9 ) (cos ) sin<£ (sin 9 ) (cos )
0^ 0 0 1)
where f{ 0 ■,<}>)
— 1 —sin 6 + cos 6
g(0,)
=
1 —cos^ f (cos# + sin0)(sin<£)
h (9,< fj
sin 6
= =
1 —sin —(cos# + sin0)(cos<£) jf , cos 9 = jf  , (0 < $ < 2 ir)
d v
=
(*; + z l ) 2
sin
=
p > cos<^ = ^ , (f <
D
=
(x l + y l + z l ) 1'
4>
Hidden surface removed is achieved by displaying octants in order of their distance from the viewer, with the furthest being displayed first i.e. a backtofront order. As the position of the viewer changes the distance to each octant will also change; the order of display varies for a
4.7. LIN EA R O C T R E E D ISPLA Y
135
P r io r it y
VPN
xv
< > < >
0
<
y«
O rd e r
Zv
0
<
0
7,6,5,4,3,2,1,0
0
0
6,7,4,2,5,3,0,1
0
< <
0
5,4,7,1,6,0,3,2
0
< < > >
0
<
0
4,5,6,0,7,1,2,3
0
<
0
0
3,2,1,7,0,6,5,4
>
0
0
2,3,0,6,1,7,4,5
0
< > >
0
< >
> > > >
0 0
0
0 0
0
1,0,3,5,2,4,7,6
0
0,1,2,3,4,5,6,7
Centred P ro je c tio n s
=
1
= ( i) = 0 = 0 = 0 = 0
= = =
0 0 1
= ( l) = 0 = 0
= = = = =
0
4,0,6,2,5,1,7,3
0
3,7,1,5,2,6,0,4
0
1,0,5,4,3,2,7,6
0
6,7,2,3,4,5,0,1
1
0,1,2,3,4,5,6,7
= ( l)
7,6,5,4,3,2,1,0
Table 4.10: P rio rity O rder fo r O c ta n t Labelling according to V P N C o o rd in ates given view direction. There are 14 such view directions of which 6 are central projections. For each of the latter there are 576 possible orders of display, called p rio rity orders. For each of the remaining 8 discrete regions of view there are 36 possible priority orders. Table 4.10 lists just one of the possible priority orders for each of the 14 views. To illustrate the octal string sorting process consider the simple object presented in Figure 4.5. If the V P N has coordinates:
2/y
0 , t/(j
0,
^ 0
the priority order is (1,0 ,3 ,5 ,2 ,4 ,7 ,6 ), as illustrated in Figure 4.37. As there are no spatial indices with an octal digit cIr  i = 1, all indices with a digit = 0 are considered first. The priority order is applied recursively such that the set of keys with an octal digit d jt  1 = 0 is sorted into a backtofront order. This process continues until the entire octree has been sorted. The final list for the example is: {012,003,005,002,004,007,006,031,030,033,021, 020,022,040,310,301,300,351,355,211,400,455, 454,457,456,440,475,474,477,476,700,655} Having sorted the octree appropriately, the visibility bits, associated with each octal string, are investigated. If there are no blocked faces the octant is not visible and can be discarded from the sorted list.
136
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
x  0 VPN: y  1 z  0
Priority Order : { 1,0,3,5,4,2,7,6 } Figure 4.37: A n Octree U niverse Viewed with a known V P N
4.7. LINEAR O C T R E E DISPLAY
137
VPN
Visible Faces
xv < 0 xv > 0
Left Right Up Down Front Back
yv < o
o A zv < 0
o A
Table 4 .11: Visibility of an O ctant with respect to VPN Coordinates The visual representation of an octant is the projection of a face or faces on to the display screen. Each octal string must, therefore, be converted into a set of screen coordinates defining the associated projection. This is achieved by: 1. Decoding an octal string into its corresponding base vertex coordinates. 2. Mapping the base vertex into the V R C system by applying the view matrix. 3. Calculating the V R C of the vertices defining the face or faces of the octant using the V P N , the grouping factor and the V R C of the base vertex. 4. Mapping the V R C for the set of vertices into the screen coordinate system. One characteristic of an octant is that, at most, only three adjacent faces are visible at any one time. If the direction of view is known i.e. the V P N , it is possible to determine the visibility of each face. This is shown in Table 4 .11. Using this characteristic and knowing an octant to be a cube, the V R C of the vertices defining each visible face can be calculated by the addition of a 8V R C vector to the V R C of the base vertex. There are seven such vectors: 8V R C 1 8V R C 2 8V R C 3 8VRC< 8V R C h 8V R C 6 8V R C r
(1,0,0)) (0,1,0)) (1,1,0)) (0,0,1)) ( 1,0 ,1 )) (0,1,1)) (viewmatrix (1,1,1))
(v ie w .m a trix (v ie w m a trix (v ie w m a trix (v ie w m a trix (v ie w jm a trix (v ie w m a trix
x x x x
2s 2s 2s 2s X 2s x 2s
x 2s
Once the V R C of the vertices of the visible faces have been calculated they are mapped into screen coordinates and the polygons representing each face are scanconverted into a frame buffer.1 Two techniques are used to determine the colour intensity value for each pixel in the buffer: 1A detailed description of raster algorithms and display devices is given in Fundamentals of Interactive Computer Graphics, Chapters 3 and 11 (Foley et al., 1982).
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
138
1. D epth Shading  The visible faces are assigned a colour value according to the distance of the octant from a preselected plane which is parallel to the view plane i.e. the distance from the viewer. 2. F la t Shading  The visible faces are assigned a colour value according to the position of a light source and Lambert’s cosine law (see Appendix C). Plates 4 .11 and 4.12 show the simple object in Figure 4.5 displayed with depth shading and flat shading. By utilising raster technology to display an octree model, it is possible to retrieve 3D information from the 2D image. This capability is known as tracking (Gargantini et al., 1986).
4 .7 .1
T rack in g
When the face of an octant is scanconverted, colour intensity values are assigned to memory locations in a pixel frame buffer while pointers2, which identify visible octants, are assigned to memory locations in a tracking frame buffer. As these two buffers map onto each other, the spatial index and attribute values of a visible octant can be retrieved from the screen using an interactive device such as a mouse or cursor. By retrieving the spatial indices of two visible octants or voxels it is possible to calculate the distance between them. This is achieved by decoding each spatial index into Cartesian co ordinates and applying Pythagoras’ theorem.
2A pointer provides a way of accessing digital data without referring to that data directly i.e. a pointer stores the address of the variable to which it points (Schildt, 1987).
4 .8 . P L A T E S
4 ,8
139
P la t e s
Plate 4.1: An Octree M odel o f A P o in t D a ta S et
Plate 4.2: An Octree Model of A P oint D ata Set (In te rio r)
140
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
4.8.
PLA TES
141
Plate 4.3: A n Octree M odel of A C o n to u r D a ta S et
Plate 4.4: An Octree Model of A Topographic Surface
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
4.8.
PLA TES
143
Plate 4.5: C om position of an Octree Model resulting from a R egularised Octree S et In tersectio n O peration
Plate 4.6: An Octree Model at Resolution R — 1 (T ransform ation Exam ple)
144
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
4.8.
PLA TES
145
Plate 4.7: A n Octree M odel at R esolution R = 7 (S p a tia l S earch E x am p le)
Plate 4.8: Examples of Regular and Irregular Spatial Searches
146
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
4.8. PLA TES
147
Plate 4.9: E xam ples of C onnected S p atial Searches
Plate 4.10: Contouring a Slice
148
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
4.8.
PLA TES
149
Plate 4.11: D epth S hading of a L in ear Octree M odel
Plate 4.12: Flat Shading of a Linear Octree Model
150
C H A P T E R 4. A D A P T I V E SPATIAL SUBDIVISION IN AEGIS
This is a blank page.
Chapter 5
P r a c tic a l A p p lic a tio n a n d A s s e s s m e n t o f A E G IS
In Section 2.8, it is proposed that one appropriate method of modelling a 3D subsurface environ ment is a hybrid scheme combining two independent techniques: boundary representation and adaptive spatial subdivision. The choice of these two techniques is dictated by the spatial charac teristics of a subsurface environment: high geo m etric , reso lu tio n and co m p o sitio n al complexities, and the functionality required for effective engineering design: • Model creation. • Model modification. • Visualisation. • Integral property calculations. • Spatial search. • Spatial query. • Relational query. • Geometric data Conversion. • Sectioning and contouring. Although the theory presented in Chapters 3 and 4 indicates that the combining of linear octree encoding with boundary representation fulfills the above requirements, practical application and assessment is essential to determine whether this combination can be implemented successfully and utilised in an engineering practice. To achieve such assessment, A E G IS , while running on a Sun 3/60 3.5 M IP machine with a floating point processor, 4M bytes of main memory and 20M bytes of swap space, was applied to a variety of data sets. 5 .1
D a t a S e ts
The data sets used in assessing A E G IS included the M olson, L abatt and S leem an projects and a series of mathematical shapes. T h e M o lso n P ro je ct  The Molson project is a wholly synthetic data set. It represents an underground mining operation which covers a surface area of approximately 0.69 km2 and extends to a depth of 840m. The project comprises:
151
C H A P T E R 5. PRACT I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
152
1.
A mineralised zone of interest defined by a discrete surface boundary.
2. A grade distribution within the mineralised zone. 3. Eight production and development levels. 4. An ore pass. 5. A main shaft. 6. A ventilation/secondary access shaft. Although the geology of this project is neither ‘typical’ nor complex, the integration of a grade block model with a discrete surface boundary offers an opportunity to assess the ana lytical functionality of A E G IS . Furthermore, by assuming the project to be an underground operation, model creation capabilities using the description language can be investigated. T h e L a b a tt P ro je ct  The Labatt project1 is a quarrying operation in northern England. The data supplied by the contributing company included: • contour maps of the surface topography; • contour maps of a granite batholith; • working plans of an existing quarry; • plans of a proposed quarry; • historical production data. The existing quarry, which is 106m deep and covers an area of approximately 0.855km2, has benched faces. Contours defining such benches axe complex and, therefore, this project of fers an opportunity to assess the surface triangulation capabilities of A E G IS . Furthermore, the availability of historical data allows the investigation of model accuracy. Sleem an P ro je ct  The Sleeman project1 is a surface mining operation in southern Wales. The data supplied by the contributing company included: • contour maps of the surface topography; • plans of a proposed openpit; • plans of a ramp into the openpit. The surface topography, which covers an area of approximately 1.36km2, is defined by contour loops and strings. The latter do not form closed boundaries and present an oppor tunity to investigate the branching capabilities of the surface triangulation algorithm. M a th e m a tic a l Shapes  Four mathematical shapes: a torus, a sphere, a cylinder and a poly hedron, serve to investigate the accuracy of both boundary and octree models. Details for these shapes are as follows: Torus: Inner radius Outer radius Surface Area Volume
: : : :
10 units 30 units 7895.7 units2 39478.4 units3
J The names of the Labatt and Sleeman projects have been changed at the request of the contributing companies.
5.2. P R A C T I C A L APPLICATION
153
Sphere: Radius : 10units Surface Area : 1256.6 units2 Volume : 4188.8 units3 Cylinder: Radius : 10units Length : 10units Surface Area : 1256.6 units2 Volume : 3141.6 units3 Polyhedron: Vertex 1 Vertex 2 Vertex 3 Vertex 4 Surface Area Volume 5.2
(0, 0, 0) (10, 0, 0) (5, 0, 8.66) (5, 10, 2.88) 199.4 units2 144.3 units3
Practical Application
To avoid repetition, only the application of A E G IS to the Molson project will be fully discussed. The other data sets will be referenced during the discussion on system assessment. 5.2.1
M o d e l Creation
The initial step in creating the components of the model of the Molson project was to generate a 3D polygonal mesh defining the boundary of each entity2. This was achieved using either the surface triangulation algorithm or the description language: M in e ralise d Zone  In accordance with current mine design practice, the mineralised zone was defined by a series of 2D contour loops on adjacent elevations. Using the surface triangulation algorithm, these loops were meshed together and ‘capped’ to form a 3D surface boundary, as shown in Plate 5.1. Details of this feature are given in Tables 5.1 and 5.2. P ro d u ctio n a n d Developm ent Leve ls  Again, as is common practice on most mining sites, the production and development levels were defined by plans at the ‘offset’ elevation3. Assuming each plan to be representative of the tunnel outline at both the roof and the floor, a 3D surface boundary was generated for each level by meshing together and capping identical outlines positioned 6 metres apart (in elevation), as shown in Plate 5.2. Details of these features are given in Tables 5.1 and 5.2. 2The grade distribution within the mineralised zone was defined using geostatistical techniques and is repre sented by a block model. A discrete surface boundary for such data is inappropriate. 3The offset elevation is generally 1.5 metres above the floor of the tunnel and is used to control the gradient of the excavation.
154
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
V e rtic a l Shafts  The ore pass, main shaft and secondary shaft, shown in Plate 5.3, were gen erated by revolving a straight line about the xaxis, transforming the volume of revolution to the desired location in the project space and capping it using the vertex manipulation facilities. To illustrate this process consider the following example: The main shaft has a diameter of 20 metres, runs from surface to a depth of 840 metres and is centred on a vertical axis located at: Easting (x) : 60m
Northing (y) : 580m
To generate such a shaft, a line, defined by vertices (0,10) and (840,10) in a local co ordinate system, was revolved about the xaxis in 12 increments. The resultant volume of resolution was then positioned in the project space by specifying: 1. A new origin at {Easting, Northing, Elevation}: 60m,580m, —840m.
2. A
point on the new xaxis {Easting, Northing, Elevation} : 60m, 580m, 0m.
3. A point in the new x O y plane {Easting, Northing, Elevation} : 60m, 600m, 0m. Capping of the shaft was achieved by inserting (into the model) two vertices with co ordinates (60m, 580m, 0m) and (60m, 580m ,—840m) and connecting these vertices with adjacent nodes of the volume of revolution i.e. those at the same elevation. Similar details for the other vertical shafts are given in Table 5.3. G ra d e D istrib u tio n  Incorporating a grade distribution in the Molson project was achieved by integrating an existing grade block model. The latter was generated from a genuine borehole data set using geostatistical techniques. It should be noted that such generation was performed by colleagues at Imperial College (Dunstan, 1988) and that the direct inte gration of geostatistical techniques with the solid modelling methods employed in A E G IS was undertaken by other researchers (see Section 5.3.4). The block model consists of 7 different grades and has 37, 88 and 50 blocks, of size (16m X 16m X 16m), in x , y and z respectively. Full details of this model are given in Table 5.4. Having created each entity in the project space, the boundary models were displayed using Movie. As shown in Plates 5.3 to 5.6, the graphics capabilities of Display, combined with the hierarchical database, allow cogent visualisation of boundary models. To analyse the Molson project the boundary models were converted to linear octree models and integrated with the grade distribution data using Boolean operations. Details of these operations are given in Tables 5.5 and 5.6 and Plates 5.7 and 5.8 show the complete octree model.
5.2 .2
M odel A nalysis
To illustrate the analytical capabilities of A E G IS , consider some typical problems and values of interest which a mining engineer or geologist may wish to query:
5.2. P R A C T I C A L APPLICATION
Feature Mineralised Zone
Contour
1 2 3 4 5
6 7
8 9 Level 1
1 2 3
Level 2
1 2 3
Level 3
Level 4
Level 5
1 2
Level 8
22
23 46 40 5 47 74
6
37 114
8
3
122 6
1 2 1 2 1 2 3
Level 7
No. of Vertices 13 14 25 47 33 40 33
3
3 Level 6
155
1 2
42
40 98 7 48 87
6
45 70
3
6
3
41 28 5
1 2
Elevation (metre) 340.00 390.00 440.00 490.00 540.00 590.00 640.00 690.00 740.00 398.50 398.50 398.50 438.50 438.50 438.50 488.50 488.50 488.50 538.50 538.50 538.50 588.50 588.50 588.50 638.50 638.50 638.50 688.50 688.50 688.50 738.50 738.50 738.50
Range Min. 362.44 393.10 385.68 364.10 397.22 474.30 485.24 518.98 537.60 60.00 327.10 161.82 61.38 298.34 152.88 60.74 286.04 140.72 60.72 293.96 146.06 59.94 394.50 153.28 61.74 393.44 155.28 61.68 454.94 159.32 59.82 475.34 143.00
X (m) Max. 465.16 447.92 481.06 551.44 560.08 598.26 605.40 624.44 659.80 918.44 548.32 242.68 918.56 604.22 229.22 918.50 682.72 233.02 919.66 681.42 235.16 918.88 719.90 276.64 918.10 731.54 266.28 919.78 703.14 263.16 918.08 776.10 274.64
Table 5.1: C o n to u r D a ta fo r the M olson P ro ject
Range Min. 414.75 505.64 368.86 230.10 203.40 251.09 369.17 381.07 364.71 440.41 457.94 546.41 316.64 329.57 543.21 182.86 198.94 544.49 136.08 154.61 544.91 215.15 233.28 546.48 317.86 333.54 545.61 337.82 353.59 545.55 338.52 353.91 547.42
Y (m) Max. 656.78 665.04 762.96 874.26 906.58 875.86 895.22 783.52 647.68 728.74 712.94 571.88 823.30 807.74 570.98 937.88 923.52 571.76 940.80 923.28 573.62 939.00 923.02 572.24 938.30 923.22 571.56 817.92 801.84 571.70 699.56 683.46 573.20
156
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
Feature Mineralised Zone Main Shaft Ventilation Shaft Ore Pass Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8
No. of Vertices 252 26 26 26 182 254 318 340 290 282 242 148
No. of Edges 1500 120 120 120 776 1068 1332 1424 1205 1176 1016 624
No. of Polygons 500 36 36 36 198 278 346 370 3 11 304 264 162
Range Min. 362.4 50.0 914.0 194.0 60.0 61.3 60.7 60.7 59.9 61.7 61.6 59.8
X (m) Max. 659.8 70.0 926.0 206.0 918.4 918.5 918.5 919.6 918.9 918.0 919.7 918.1
Range Min. 203.4 570.0 574.0 534.0 440.4 316.6 182.8 136.0 215.1 317.8 337.8 338.5
Y (m) Max. 906.6 590.0 586.0 546.0 728.7 823.3 937.9 940.8 939.0 938.3 817.9 699.5
Range Min. 740.0 840.0 840.0 820.0 390.0 440.0 490.0 540.0 590.0 640.0 690.0 740.0
Z (m) Max. 340.0
0.0 0.0
470.0 384.0 434.0 484.0 534.0 584.0 634.0 684.0 734.0
Table 5.2: B o u n d ary M odel D a ta fo r the M olson P ro je c t
Parameter Diameter Depth Axis Location (E, N) Vertex A (x, y) Vertex B (x, y) New Origin (E, N, Elev.) New xaxis (E, N, Elev.) New x O y Plane (E, N, Elev.) Top Cap (E, N, Elev.) Bottom Cap (E, N, Elev.)
Main Shaft 20m 840m 60m, 580m 0, 10 840, 10 60m, 580m, 840m 60m, 580m, 0m 60m, 600m, 0m 60m, 580m, 0m 60m, 580m, 840m
Ventilation Shaft 12m 820m 920m, 580m 0, 6 820, 6 920m, 580m, 820m 920m, 580m, 0m 920m, 600m, 0m 920m, 580m, 0m 920m, 580m, 820m
Table 5.3: S h aft D etails fo r the M olson P ro ject
Ore Pass 12m 820m 200m, 540m 0, 6 350, 6 200m, 540m, 820m 200m, 540m, 0m 200m, 600m, 0m 200m, 540m, 470m 200m, 540m, 820m
5.2. P R A C T I C A L APPLICATION
Object No.
1 22 23
Region No. 3 5
2
21
4
25 26
7
20
24 Total
6 1 6
Density ( g / c m 3) 1.820 1.820 1.820 1.820 1.820 1.820 1.820 1.820
157
Volume (m3*x 106) 146.24 10.59 18.04 10.27 9.49 13.49 8.14 6.31 222.57
Mass ( T x 106) 266.16 19.27 32.83 18.69 17.28 24.56 14.82 11.48 405.08
Grade (% )
< 1 2 2 3 3 4 4 5 5 6 6 7 > 7
1
Mineral Content ( T X 106) < 2.66 0.2891 0.8208 0.6542 0.7776 1.3508 0.9633 > 0.8036 « 8.3194
Table 5.4: M olson P ro ject B lock M odel D a ta T o ta l O re Reserve  The total reserve for the Molson project is the sum of all octants, within the mineralised zone, which have a grade greater than a specified cutoff value. Assuming the latter to be 3 % , the total ore reserve is 10.69 million tonnes with an expected mineral content of 0.53 millions tonnes. The practical method of calculating this tonnage was to apply the integral property algorithm to the intersection of the mineralised zone and grade distribution models (see Table 5.7). S p a tia l D is trib u tio n of O re  To assist in maximising profits, the production planner must determine an optimal ore/waste extraction ratio. One factor affecting this ratio is the spatial coherency of ore within the mineralised zone i.e. the s p a tia l d istrib u tio n of ore. Based on a cutoff value of 3% , the mineralised zone contains 19.10 million tonnes of waste (Table 5.7). Intuitively, it is desirable to leave in situ as much of this waste as possible. By applying the connected component labelling algorithm and assuming that all homogeneous units of ore with a volume greater than 50,000m3 can be extracted without dilution, it is possible to determine more precisely the ore/waste extraction ratio 4. With reference to Table 5.8, there are five discrete components of ore (10.4 million tonnes) in the Molson project which can be extracted without dilution: 2, 4, 10, 19 and 28. If all other components of ore are left in s itu , there is no need to mine any waste. Although this example is substantially simplified, it illustrates the importance of spatial distribution and the functionality of the connected component labelling algorithm. Stope L o catio n s  Preliminary stope designs and locations can be determined from the initial project model. However, as the development ends progress, more data are made available and more appropriate stope locations can be determined by investigating the surrounding ore composition. For example, a spherical search can be used to identify the grade con centrations within 25m of the end of tunnel 1 on level 6. Using this information a more precise stope location can be identified.
4It is understood that the ore/waste extraction ratio is determined by numerous factors including mining method, equipment selection and rock strength.
158
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
Feature Mineralised Zone Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8 Main Shaft Ventilation Shaft Ore Pass
No. of Polygons 500 198 278 346 370 3 11 304 264 162 36 36 36
No. of Nodes 42011 15346 20857 33477 45628 41889 33255 23847 16807 12386 9056 3872
Time (seconds) 763 143 244 561 529 621 5 11 388 215
66 42 18
Table 5.5: Octree Model G eneration Times fo r the M olson Project
Operation Intersect Join Join Join Join Join Join Join Join Join Join Join
Dominant Feature (A) Block Model Level 1 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8 Main Shaft Ore Pass Levels Utilities
Subordinate Feature (B) Mineral Zone Level 2 Temp. 1 Temp. 2 Temp. 3 Temp. 4 Temp. 5 Temp. 6 Vent. Shaft Temp. 7 Shafts Orebody
Resultant Model (C) Orebody Temp. 1 Temp. 2 Temp. 3 Temp. 4 Temp. 5 Temp. 6 Levels Temp. 7 Shafts Utilities Molson
Nodes (A) 19670 15346 33477 45628 41889 33255 23847 16807 12386 3872 231106 255863
Nodes
Nodes
(B)
(C)
130906 20857 36203 69680 115308 157197 190452 214299 9056 21442 25314 131802
131802 36203 69680 115308 157197 190452 214299 231106 16258 25314 255863 425396
Table 5.6: Octree Model Boolean Operations for the M olson Project
Time (seconds) 77 5
10
17 23 27 31 33
2
3 38 76
5.3. S Y S T E M A S S E S S M E N T
1 22 23
2
21
4
25 26
7
20 24 Total
6 1 6
Density (g / c m 3)
1.820 1.820 1.820 1.820 1.820 1.820 1.820 1.820
Volume (m3 x 103) 3675.08 1660.64 5160.83 1363.11 1276.78 2427.67 463.08 346.24 16373.43
Mass (T x 103) 6688.65 3022.36 9392.71 2480.86 2323.74 4418.36 842.80 630.16 29799.64
Grade (% ) < 1 1 2 2 3 3 4 4 5 5 6 6 7 > 7
Mineral Content (* o
Region No. 3 5
X
Object No.
159
< 66.89 45.34 234.82 86.83 104.57 243.01 54.78 > 44.11 w 880.35
Table 5.7: M olson P ro je c t O re R eserves C o n to u rin g  Generating 2D contour maps is an effective method of conveying the shape and distribution of grade. To illustrate this process consider a contour map of grade concentrations at a depth of 636m. Such a map can be generated by slicing the model at the appropriate elevation and extracting the borders of each grade component, as shown in Plate 5.9. D evelopm ent C o stin g  One factor which effects development costs is ‘length of tunnel’ i.e. distance. By using the tracking facility, an engineer can interactively determine the distance between two points. For example, the distance between the end of tunnel 2 on level 1 and the mineralised zone is 8m. Another factor which effects development costs is the type of rock being excavated. By simulating an exploratory borehole using the line search function, an engineer can identify the expected composition of the rock to be excavated. For example, if tunnel 4 on level 2 were to be advanced 50m, it would intersect material with a grade value of 1 %  2% . These examples illustrate the analytical capabilities of A E G IS and indicate their possible use in a wide range of applications.
5 .3
S y s te m A ss e ss m e n t
Analysis of the Molson data set indicates that the solid modelling techniques employed in A E G IS offer all the capabilities specified in the research mandate (section 1.2) and can be utilised in a working environment: model creation took approximately 12 hours of labour5 and the computational time required to perform most analytical functions was in the order of seconds. Although this example data set offers strong support for the use of such techniques in geoscientific applications, a more detailed discussion on accuracy and computational efficiency is required to verify the validity of A E G IS as a practical tool. 5Model creation included digitising existing plans and sections, surface triangulation and conversion to octree models.
160
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
Component No.
1 2 3 4 5
6 7
8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 Totals
Composition Waste Ore Waste Ore Waste Waste Waste Ore Waste Ore Waste Ore Ore Ore Waste Waste Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Ore Waste Ore Waste
Volume (m3 X 103) 10437.0928 2253.9990 0.0323 609.0256 1.2025 1.6545 30.8052 0.0323 4.8746 2679.9287 10.5643 0.3793 0.0081 1.7029 0.0323 4.7213 4.1321 0.0081 129.0314 0.1695 4.1321 4.1321 4.1321 4.1321 33.6783 16.5284 4.1321 52.7731 4.1321 3.7528 30.1272 11.4924 1.5495 5.3346 8.2642 3.7528 0.4439 1.7271 3.4945 0.4762 0.1453 0.2744 5.4234 16.3734
Mass X 103) 18995.5098 4102.2783 0.0588 1108.4265 2.1886 3 .0 111 56.0654 0.0588 8.8718 4877.4707 19.2270 0.6904 0.0147 3.0992 0.0588 8.5927 7.5204 0.0147 234.8372 0.3085 7.5204 7.5204 7.5204 7.5204 61.2945 30.0817 7.5204 96.0471 7.5204 6.8301 54.8316 20.9162 2.8202 9.7090 15.0409 6.8301 0.8079 3.1433 6.3601 (T
0.8666
0.2644 0.4994 9.8706 29799.6348
Table 5.8: C onnected C om ponents in the M olson P ro je c t
161
5.3. S Y S T E M A S S E S S M E N T
Figure 5.1: S urface A rea o f a Triangle in E u clid ean E? Space
5 .3 .1
M o d e l A c cu ra c y
Geoscientific features include points, lines, surfaces and solids and, therefore, model accuracy must be evaluated for each Euclidean dimension: E 1, E 2 and E 3. As A E G IS is a solid modelling system, the latter dimension is of greatest significance. 5 .3 .1 .1
B o u n d a ry M odels
As stated in Section 2.6, it is computationally complex to calculate the volume of boundary models; the volumetric accuracy of such models is difficult to determine. Surface area, however, can be calculated by summing the area of each triangle in a polygonal mesh (see Figure 5.1): n
Surface Area A
=
An
n:n = Number of polygons
*=i An
“ _ ~
2 (Vy‘WzVz‘UJv) + (vzWxVxWz) + (vx‘U}yVvWx) 2
where: V U)
A , B, P
= = =
AP AB
Vertices in triangle
162
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
Feature
Sphere Sphere Sphere Sphere Torus Torus Torus Torus Torus Torus Cylinder Polyhedron
No. of Polygons 800 1800 3000 4000 720 1440 2160 2880 3600 5040 108 4
Surface Area
Estimated Surface Area
Error in Surface Area
(u n i t s 2)
(u n i t s 2)
1256.64 1256.64 1256.64 1256.64 7895.68 7895.68 7895.68 7895.68 7895.68 7895.68 1256.64 199.42
1251.12 1254.17 1255.43 1266.59 7568.85 7805.92 7850.63 7866.34 7873.62 7879.97 1252.65 199.42
(% ) 0.43 0.19 0.09 0.79 4.14 1.14 0.57 0.37 0.28 0.19 0.32
0.0
Table 5.8: E rro r E stim a te s in the S urface Area o f B o u n d ary M odels In geoscientific applications the boundaries of discrete subsurface features aredifficult to define and are often subjective, given the sparsity of data. Furthermore, heterogeneous features have dynamic boundaries determined by threshold ranges; it is difficult to compare the surface area of a geometrically complex feature with that of its boundary model i.e. to determine the ac curacy of the model. Such a comparison can, however, be made for shapes which are defined mathematically. Error estimates were calculated for a number of simple geometric shapes created using the description language: a torus, a sphere, a cylinder and a polyhedron. The results of these calculations, detailed in Table 5.9, indicate that planar faceted objects e.g. polyhedrons, can be represented precisely while the accuracy of models representing objects with curved surfaces improves, up to an optimal value, with an increase in resolution i.e. the number of polygons in the model. Beyond a certain resolution the accuracy decreases. Although boundary models define volume, the edges and vertices which compose a polygonal mesh can be used to represent lines and points; it is possible to identify a linear accuracy. Such accuracy is determined by the architecture of a computer i.e. the number of bits in a floating point variable, which is sufficient for geoscientific applications.
5 .3 .1 .2
O ctre e M o d e ls
To determine the accuracy of octree models generated by the conversion algorithms presented in Chapter 4 a number of computational trials were performed on the octree representations of the simple geometric shapes created using the description language: the torus, sphere, cylinder and polyhedron. The results of these trials, detailed in Appendices D and E, indicate that both mapping criteria and octree resolution affect accuracy. For each solid the error in estimated volume is seen to diminish significantly with increasing octree resolution. At resolution R = 9 the greatest such error is 1 . 3 1 % while the least is only
163
5.3. S Y S T E M A S S E S S M E N T
0.24%. The latter is so small that the inaccuracy of the boundary model becomes apparent, as indicated by negative error values. The Tables in Appendix D detail the effect of resolution on estimated volume error for object spaces which are mapped as closely as possible into the octree universe i.e. with the smallest possible scaling factor for the given object space. In a heterogeneous assemblage of solids, such mapping can only be achieved for the largest component. Small components are, effectively, being represented by octree universes at lower resolutions: model accuracy is reduced. This is illustrated in the Tables in Appendix E which detail the effect of increasing scale factor on estimated volume error for a sphere at different resolutions. Although scale factor has a significant effect on estimated volume error for a single component in a heterogeneous assemblage, it is the size and spatial distribution of neighbouring components which determines the error for the total assemblage. To illustrate this consider a trivial example. Assume an object space to consist of three components with typical error estimates as identified in Appendix E: Component No.
1 2
3 Total
Volume (units)
100 10 1 111
Error (% )
0.5 3.5 9.3 0.85
Error (units) 0.5 0.35 0.093 0.943
Although the error in volume for the third component is 9 .3 % , the overall contribution of this error to the total assemblage is only 0.084%. The average error for such an assemblage is difficult to determine using theoretical techniques. Rather, an empirical approach is more appropriate. Historical production data from the Labatt project were compared with values calculated using A E G IS . To ensure minimal error, the data set was encoded into an octree model at resolution R = 9. The amount of overburden removed and granite extracted was estimated by intersecting the quarry model with the surface topography and granite batholith models. A comparison of these estimated tonnages with the historical data indicated an 8 % difference between values. Although this discrepancy is significantly greater than that for a single component universe, the accuracy of the historical data is believed to be dubious: the results of this empirical approach are approximate. Surface area calculations were performed by summation of the areas of voxel and octant faces which were blocked i.e. on the surface of the object. This approximation is course for all but rectilinear, regular solids and is not improved significantly with increasing octree resolution, as detailed in Appendix D. Although more complex computational methods could be used to decrease the error in estimated surface area, the implementation of such methods is unwarranted as spatial decomposition techniques are unrefined at representing surface properties. Points and lines are represented in an octree universe by 3D voxels. The error associated with such representation is dependent on scale factor: Linear Accuracy
(Scale factor2 x 3) 2
(7Ex£m tV x
164
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
For a given assemblage of components, linear accuracy is improved with increased resolution. In practice, such an increase is limited to approximately R = 9 as octree universes with resolutions greater than this become too large to manipulate effectively. Consider the previously discussed sphere as an example. Assuming the sphere and octree universe to be mutually centred, the number of octants required to represent this sphere at different levels of resolution is: Octree Resolution 4 5
6 7
8
9
No. of Octants 720 2,922 11,097 46,171 185,265 741,169
Memory (bytes) 5796 23412 88776 369368 1.482 X 106 5.929 x 106
Meagher (Meagher, 1982) has shown that the number of octants required to model an object is proportional to the surface area of that object; the number of octants quadruples for a unit increase in resolution, as shown in the example. Based on this reasoning, it is possible to determine the approximate number of octants required to represent the sphere at increased levels of resolution: Octree Resolution 10 11 12 13 14 15 20 25
« « » « « « » «
No. of Octants 2.965 x 106 11.858 x 106 47.434 x 106 189.739 x 106 758.957 x 106 3.035 x 10° 3.109 x 1012 3.183 x 1016
« » » « « « « »
Memory (bytes) 23.72 x 106 94.86 x 106 379.456 X 106 1.518 x 10° 6.071 x 109 24.285 x 109 24.868 x 1012 25.464 x 1015
Similarly, it is possible to determine model sizes, at resolutions greater than R = 9, for the Molson project: Octree Resolution 9 10 15 20 25
No. of Octants 425.396 x 103 « 1.702 X 106 « 1.742 x 109 » 1.784 x 1012 « 1.827 x 1016
Memory (bytes) 3.40 X 106 « 13.61 x 106 « 13.939 x 109 » 14.274 X 1012 « 14.616 x 1015
Manipulating a 13 Mbyte model on the Sun 3/60, which only has 4 Mbytes of main memory, requires extensive ‘swapping’. Such memory management is I/O (input/output) bound and computationally slow. Furthermore, the external memory storage requirements for resolution
165
5.3. S Y S T E M A S S E S S M E N T
R = 10 models can become extensive. This is indicated by the Molson project which, in its entirety, consumes 25 Mbytes of disk space (at resolution R = 9).
Given that the maximum practical resolution is R = 9, the linear accuracies for the three example projects are: Project Molson Labatt Sleeman
Scale Factor 2.01 1.91 2.47
Linear Accuracy 3.48units 3.31 units 4.27units
Such linear accuracies are inadequate for surveying operations (Bak, 1987) and are, therefore, inappropriate for many geoscientific applications. In summary, the accuracy of octree models is determined by scale factor and resolution. In practice, memory requirements restrict such resolution to R = 9 which, with respect to volumetric accuracy, ensures a maximum error of 1 .3 1 % for single entity universes and approximately 8 % for complex heterogeneous assemblages. As stated, the latter is based on erroneous historical data and, therefore, is a crude estimate. Given the inaccessibility of subsurface environments and the incompleteness of available information, the volumetric accuracy of octree models is appropriate for geoscientific applications. The error estimates for surface area proved to be unrelated to octree resolution and unacceptably high. Similarly, the linear accuracy of octree models is inappropriate for many geoscientific applications.
5.3.2
Surface Triangulation
Creating a model of the mineralised zone in the Molson project proved the shortest span trian gulation algorithm to be easy to use and computationally efficient: the 3D surface boundary was both topologically valid and triangulated in real time without any manual intervention. Although an effective test case, the contour loops of the mineralised zone were similar in shape and mutually centred and required neither mapping nor branching. To investigate the flexibility and computational efficiency of the latter capabilities, the algorithm was applied to the topographic surface in the Sleeman project. The topographic surface, represented by a set of contours digitised from maps, is a geometrically complex feature with branched loops and contour strin g s i.e. contours which are not closed loops. Triangulating such branches and strings proved to be time consuming, requiring extensive manual intervention. Nevertheless, the resultant 3D surface boundary, shown in Plate 5.10, is topologically valid. To further investigate the flexibility of the surface triangulation algorithm, a 3D polygonal mesh boundary was created for the granite quarry in the Labatt project. This data set, which is representative of many quarries and open pits, required subjective preprocessing to determine suitable border lines and extensive manual intervention during triangulation. Although the resultant surface boundary, shown in Plate 5 .11, is topologically valid, the need for planar parallel contour loops proved to be a constraint.
166
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
In conclusion, the shortest span surface triangulation algorithm performed effectively, generated topologically valid 3D surface boundaries and proved to be an appropriate method for creating boundary models of geometrically complex geoscientific features.
5 .3 .3
D e sc r ip tio n L a n g u a g e
Although the description language in Movie utilises general algorithms to create a wide variety of mathematical models, the user interface is cumbersome, requiring an extraneous number of parametric values to define a shape. To illustrate this, consider the creation of the main shaft in the Molson project which involved revolving a curve and transforming the volume of revolution to a position in the object space. The parametric values required included: 1. Two points to define the curve. 2. An increment of revolution. 3. Three values to transform the volume of revolution. An application specific algorithm could achieve the same goal with only three parametric values: two vertices defining the central axis of the shaft and a radius. Furthermore, such an algorithm could utilise a graphical interface. The latter is generally more ergonomic and easier to use than a keyboard. Another problem associated with the use of general algorithms, rather than application specific functions, is the inability to create regular shapes which are difficult to define mathematically, such as the ramp in the Sleeman project (Plate 5.12). In conclusion, a description language with more application specific functionality and an im proved graphical interface would provide a method of creating boundary models of regularly shaped features. The extensive use of such languages in commercial surface and solid mod elling systems, such as A lia s ™ , Id eas™ , I / C E M ™ and P A D L 2 ™ , further emphasises their appropriateness.
5 .3 .4
S t a tis tic a l G rid d in g
Although statistical gridding functions have not been implemented in A E G IS , collaborative research with Rene Prissang, at the Freie Universitat Berlin, has resulted in a geostatistical characterisation system which employs the linear octree concepts and algorithms presented in Chapter 4. A detailed discussion on this research is given in the final report of the E E C Raw Materials Contract No. M AlM 0026D(B), CAD of U nderground M etalliferous M ining layouts (Prissang, 1990).
5 .3 .5
G e o lo g ic a l P r o c e s s S im u la tio n
Geological process simulation is a method of extrapolating geometric, property variable and time related data from both physical characteristics and historical events. For example, refolded ore bodies can be identified by manipulating a finite element mesh using event data such as fold waveform, amplitude and orientation (Thiessen et a/., 1986).
167
5.3. S Y S T E M A S S E S S M E N T
Process simulation methods are typically complex and their investigation is beyond the scope of this thesis. However, finite element meshes, which are essentially boundary models, can be visualised using Movie and converted into linear octree models for analysis purposes. Modular integration of such creation techniques can be achieved by file format conversion algorithms.
5 .3 .6
O c tre e M o d el G e n e ra tio n A lg o rith m s
Octree model generation is computationally efficient as the core algorithms (encoding and com pression) utilise integer processing and bitwise operators: point, block, line and surface models can be generated in seconds as illustrated by the following examples: Feature
Dimension
Resolution
No. of Nodes
Points Blocks Line Surface
34317 units 24640 blocks 885 units 5 11 X 5 11 units2
9
34317 9345 512 262144
6 9 9
Time (seconds) 17 .71 12.81
0.22
89.47
Solid octree model generation is computationally more intensive than for point, block, line and surface model generation as it employs not only encoding and compression, but also Boolean operations and connected component labelling. Computation times for such model generation are in the order of minutes as illustrated by the Molson project example (see Table 5.5). Although the solid octree model generation process is computationally inefficient, it ensures validity. Furthermore, as the algorithms in the process are independent of each other, they can be easily implemented and modified; this is of value as more sophisticated algorithms become available. For example, Kaufman has presented a 3D polygon to raster scan conversion algorithm (Kaufman, 1987) which could improve the surface generation process employed in A E G IS . One characteristic of the solid model octree generation method is that polygons with a high aspect ratio degenerate when mapping from a real world to an integer octree universe. Although this degeneration has little effect on volume error, it reduces the representational ‘correctecness’ of the model. The latter, howver, is difficult to quantify as methods of comparing the shape of octree and boundary models have not been identified. In conclusion, the octree model generation algorithms employed in A E G IS ensure validity and are of value in geoscientific applications.
5.3.T
B o u n d a ry M odel M odification F u n ctio n s
The boundary model modification functions implemented in A E G IS include rigid transforma tions, vertex manipulation and polygon generalisation and orientation. These functions are computationally efficient and can be performed in realtime; rotation of the Molson project was achieved in less than a second (see Plates 5.5 and 5.6). As stated in Section 1.2, blending is an effective method of shape modification. Such modification, which involves moulding new parts onto existing models, can be achieved through interactive graphics techniques. For example, a surface can be extruded by ‘grabbing’ a vertex and ‘dragging’ it in 3D space. Similarly, new surfaces can be created by ‘snapping’ new edges to existing vertices.
C H A P T E R 5. PRAC T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
168
Although blending functions are not available in A E G IS , advances in interactive graphics tech nology has made the implementation of such functions practical. 5.3.8
Octree M o d e l Modification Functions
The modification functions implemented in A E G IS include transformations and Boolean opera tions. The latter, which involve a list scan and case analysis, are computationally efficient and can be performed in the order of seconds. Table 5.6 details the computation times of Boolean operations used to create the Molson project. As stated in Section 4.5.2, the translation and rotation of octree models is achieved by decoding each octant, applying a transformation matrix and encoding the transformed coordinates. A l though this method is employed by most ‘octree’ investigators (Gargantini et al ., 1986; Meagher, 1982; Kavouras, 1987), it is computationally inefficient; the transformation matrix must be applied to every octant in the model. This is illustrated by the example transformations in Section 4.5.2: translation took 4.3 minutes and rotation took 6.2 minutes. Another problem associated with these transformation operators is that they are not rigid. The octree universe has finite dimensions. If a model is translated beyond the bounds of this universe, data is lost and the model is modified: translation is not rigid. Although rigidity can be enforced, such enforcement will further decrease computational efficiency. When a model is rotated through an angle which is not a multiple of 90°, the coordinates of the transformed base vertex of an octant become real values. The rounding of such values does not consider adjacency relations and distortions in the model occur. This is illustrated in Figure 5.2 which shows the effect of rotating a set of voxels 45° about the z axis. Although rotations are closed i.e. the transformed models are valid, they are not rigid: shape is distorted. In conclusion, octree translation is the only transformation function which can be used with confidence. Although this may seem a limitation, experience to date has indicated that rotation of octree models is rarely required in geoscientific applications. 5.3.9
B o u n d a r y M o d e l Display Capabilities
The boundary model display capabilities in Movie are comprehensive, as indicated by the plates in previous sections. These capabilities include: • 3D perspective and orthographic display. • Light source manipulation. • Colour manipulation. • Hidden surface removal. • View transformations. • Scene composition utilising a hierarchical database. One characteristic of the Display module is that image generation is achieved in ‘software’ i.e. it does not utilise hardware functionality. Although this characteristic ensures portability to a wide
169
5 .3 . SY ST E M A SSESSM EN T
i 255 256
i
i
2 5 7 258
i
25 9
r 260 261
262
263 2 6 4
i
265
i i i i
266 2 6 7
268
269
Figure 5.2: N onR igid R o tatio n o f an O ctree M odel variety of computer platforms, it increases display times. For example, the colour shaded image of the Molson project (Plate 5.5), which comprises 2733 polygons, was generated in approximately 2.2 minutes. Hardware specific display systems, which are capable of rendering between 5000 and 100,000 shaded polygons per second (Gorey, 1990), could generate a similar image in real time.
5.3.10
Octree M o d e l Display Capabilities
Although the octree model display capabilities in A E G IS are not as comprehensive as those for boundary model display, images generated using the ‘backtofront’ algorithm are visually cogent. Unfortunately, certain characteristics of this algorithm limit its use in practical applications: P ro je ctio n  Images axe displayed using an axonometric orthographic projection. Such a pro jection does not preserve perspective foreshortening (Foley et al., 1982) and is less realistic than a perspective projection. The latter is more appropriate for visual realism. S h ad in g  Flat or uniform shading emphasises the cubic structure of octants. Although this enhances definition for complex geometries, such shading detracts from the visual realism of shapes that can be recognised easily. A less aliased effect, characteristic of Gouraud or
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
170
Phong shading6, would be more desirable. D is p la y tim e  Image generation, which is performed in ‘software’, requires extensive process ing: 1. Sorting octal strings into a backtofront order. 2. Decoding an octal string into its corresponding base vertex coordinates. 3. Mapping base vertices into the V R C (view reference coordinate) system. 4. Calculating the V R C of vertices defining the face or faces of an octant. 5. Mapping the V R C of vertices into the screen coordinate system.
6. Scan converting the face or faces of octants defined by vertices in the screen coordinate system. Such processing involves numerous floating point operations and is, therefore, computa tionally expensive. As high resolution octree models can comprise thousands of octants, image generation is time consuming. For example, the Molson model in Plate 5.7 took 15 minutes to generate. Although the octree display capabilities of A E G IS have limited practical application, Voxel View , a product developed by Vital Images Inc., is capable of rendering upto one million ‘voxels’ per second. Unlike A E G IS , this system has numerous advanced capabilities including: • realtime rotations; • colour manipulation; • interactive sectioning; • transparency control. Voxel V iew ™ is indicative of both the capabilities of current graphics technology and the speed of future voxel/octree display systems.
5 .3 .1 1
In teg ra l P r o p e r ty C a lc u la tio n s
Integral properties are calculated by determining the number of voxels in an octree model and applying an appropriate multiplication factor. For example: Volume Surface Area
= =
(Total No. of Voxels) X (Scale Factor3) (Total No. of Voxel Border Faces) X (Scale factor2)
Such calculations involve a list scan and a single multiplication. These operations are computa tionally efficient and ensure that integral properties can be determined in the order of seconds: volume, surface area and mass calculations for each object in the Molson project took 69 seconds. 6U n lik e u n ifo rm s h a d in g , G o u r a u d a n d P h o n g reflection m o d e ls v a ry c o lo u r in te n s ity ove r a p o ly g o n a l face. S u c h s h a d in g generates a v is u a lly s m o o th surface. A d e ta ile d d iscu ssio n on these s h a d in g m o d e ls is presented in
F u n d a m e n t a l s o f T h r e e  D i m e n s i o n a l C o m p u te r G r a p h ic s ( W a tt , 1989).
171
5.3. S Y S T E M A S S E S S M E N T 5.3.12
Spatial Search Functions
The spatial search functions are computationally efficient as the core algorithm: neighbour find ing, utilises integer processing and bitwise operators. This is illustrated by the computation times for the examples in Section 5.2.2: Example
Search
Spatial distribution of ore Stope locations Contouring Development costing
Component Spherical Border Line
No. of Nodes Identified 131620 692 1957 36
Time (seconds) 272.55 3.18 1.42
0.02
The processing time of a component search is significantly greater than for other search types as a list scan is required for each component in the model. By being more selective i.e. specifying an object, the computation time of such processing can be decreased. The ability to investigate adjacency is a unique characteristic of spatial enumeration and offers advanced design capabilities which cannot be supported by manual ‘pen and paper’ modelling methods. Although the examples in Section 5.2.2 illustrate some of these capabilities, the full potential of the generic spatial search algorithms has not been identified. Further possible ap plications include: G e o sta tistica l an a ly sis  Rene Prissang at the Freie Universitat Berlin, has investigated the use of linear octree encoding techniques and neighbour finding algorithms to improve the accuracy and processing speed of geostatistical analysis (Prissang, 1990). O p e n p it design  Steve Dunstan, at Imperial College, London, has investigated the use of h e u ristic depth bounded spatial searching of linear octree models to optimise openpit design and extraction scheduling (Dunstan, 1990). Fe atu re tracin g  Optimisation of extraction methods in multiple thin vein deposits requires detailed knowledge of geological structure and spatial location (MirekuGyimah, 1988). By utilising the spatial search functions it is possible to trace a vein through the host rock and: • identify possible discontinuities; • determine the average width of the vein along a given length; • investigate the adjacency of neighbouring veins and calculate ore content for a given mining width. C o n ta ct tracin g  In numerous mining operations the exposure of certain geological contacts can cause stability problems. If such contacts have been defined, their position relative to mining excavations can be determined through tracin g i.e. applying a contact search. Another unique characteristic of spatial enumeration is the ability to investigate composition. Such investigation is utilised in the tracking function.
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
172
5 .3 .1 3
T rack in g
The tracking function in A E G IS allows interactive retrieval of spatial location and composition. Although such retrieval has only been utilised in point searching and distance measurement, it has numerous possible applications including: • interactive attribute manipulation; • interactive connected component labelling and contact search; • interactive model modification. Such interactive capabilities are examples of graphics in fo rm a tio n m an ag em en t. The latter is a current area of research and is an effective method of manmachine interfacing (Beach, 1990).
5 .3 .1 4
S p a tia l a n d R e la tio n a l Q uery
Spatial queries, such as “Where is ... ? ”, “How far from ... ? ” and “What is the distance between ... ? ”, are specific applications of the generic spatial search functions. Although such applications have not been implemented in A E G IS , numerous queries can be processed through combinatorial means. For example, consider the query: “What is the mass of the nearest ore component to development end 3 on level 4?” One method of processing this query would be to identify all connected components of ore (connected component labelling algorithm), display both these components and the development end in plan and use the tracking facility to identify the nearest neighbour. Having identified the nearest component, its mass can be determined using the integral property algorithm. An alternative approach would be to automate the process of determining the nearest neighbour by employing an application specific function: identify the border voxels (border search) of each ore component and determine the minimum distance between these voxels and the development end. As the mandate of this research is to investigate and design generic algorithms, such specific functions have not been implemented. At present, relational queries cannot be processed in A E G IS . Furthermore, A E G IS has not been integrated with a RD BM S. Investigation has shown, however, that such integration, although nontrivial, can be achieved by employing a commercial RDBM S such as In g res™ (Chivers, 1989). The G Q u a d tre e /G O c tre e Im age D a ta B ase System (G ID BS), developed by Xiaoyang Mao at the Kunii Laboratory, Tokyo University (Mao et a/., 1989), is an example of this approach. G ID B S integrates an extension of the conventional octree data structure: G octree, with a com mercial RD BM S known as G B ase™ The latter employs a G raph D a ta M odel (GDM ) which is semantically more powerful than the relational model (Kunii, 1983). By assigning octal strings to appropriate table field s and indices, the RDBM S can be made to simulate a hierarchical tree structure: spatial and relational query can be performed simultaneously (Mao et al., 1989). A more detailed discussion of this process is presented in A M odified Octree S tru ctu re fo r the R ep re se n ta tio n o f G eoO bjects in a M ining D atabase M an ag em en t System (Bak et al., 1988).
5.3. S Y S T E M A S S E S S M E N T
5 .3 .1 5
173
G eo m etric D a ta C onversion
As stated in Section 1.2, geometric data conversion assists in the integration of numerous mine design functions. Although such conversion algorithms have not been implemented in A E G IS , Mark Shephard has developed an ‘octree’ based finite element modelling processor (Shephard et a l ., 1988) and directed graphs can be determined using the spatial search functions. Connected paths between points can be identified using the neighbour finding algorithm. Such paths define graphs which are commonly employed in production scheduling and costing, oper ations research and ventilation circuit design. If nonspatial attributes are assigned to entities within the model e.g. the resistance of a tunnel, weighted graphs or netw orks (Wilson, 1985) can be derived. Such an adjacency search, which involves a relational query, is nontrivial and application specific.
5 .3 .1 6
S ectioning a n d C o n to u rin g
Octree models can be sliced along any plane that is orthogonal to the axes. Such a plane, which comprises 0(l)connected voxels, constitutes a section or plan when viewed as a central projection. As stated in Section 4.6.3.3, this slicing process employs a list scan, bitwise operators and case analysis: it is computationally efficient. For example, it took 35 seconds to extract the slice shown in Plate 4.8. Although the sectioning function is presently limited to extracting planes which are orthogonal to the principle axes, a more general algorithm can be implemented by combining the surface generation process with either a Boolean operation or a spatial search. The current implementation of the contouring algorithm is elaborate and user ‘unfriendly’: it involves a border search, a slicing operation and a modified adjacency search. Although this implementation can be improved by employing a more application specific approach, it illustrates the capabilities of A E G IS .
174
C H A P T E R 5. P RACTICA L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
175
5.4. PLA TES
5.4
Plates
Plate 5.1:
C o n to u r a n d W ire fra m e Im a g e o f th e M o lso n P r o je c t M in e ra lis e d Z o n e
Plate 5.2: Contour and Wireframe Image of the Molson Project Underground Openings
176
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
5.4. PLA TES
177
Plate 5.3: W irefram e Im age of the M olson P ro ject U nderground U tilities
Plate 5.4: Wireframe Image of the Molson Project
178
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
5.4. PLA TES
P la t e 5.5:
179
Shaded Image of the Molson Project Boundary Model (View 1 )
Plate 5.6: Shaded Image of the Molson Project Boundary Model (View 2 )
180
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
5.4. PLA TES
181
Plate 5.7: Shaded Im age o f the M olson P ro ject O ctree Model
Plate 5.8: Shaded Image of the Molson Project Octree Model ( In terio r)
182
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
5.4. PLA TES
183
Plate 5.9:
Im a g e o f a G ra d e C o n to u r O c tree M o d el
Plate 5.10: An Image of the Boundary Model of the Sleeman Project Topography
184
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
5.4. PLA TES
Plate 5.11: An Im age o f the B o u n d ary M odel of the L abatt P ro je c t O penpit
Plate 5.12: An Image of the Boundary Model of the Sleeman Project Access Ramp
185
186
C H A P T E R 5. P R A C T I C A L APPLICATION A N D A S S E S S M E N T O F AEGIS
This is a blank page.
C h a p te r 6
D is c u s s io n
The application of A E G IS to example data sets, as discussed in Chapter 5, has substantiated the theory presented in Chapters 3 and 4 and emphasised the need for a hybrid representation scheme; the complexities of modelling and analysing a subsurface environment demand the use of both boundary and volume models. Subsurface environments are characterised by two general classes of feature: h eterogeneous en tities and hom ogeneous entities. The latter, which include geological structures and mining excavations, can be represented using boundary modelling techniques. Such techniques are ap propriate for geoscientific applications as they have a general domain and offer effective model creation and visualisation functionality: M o d e l cre atio n  In current mining practice, both geological structures and mined out exca vations are represented by contour loops and strings on 2D maps, plans and sections. An effective method of creating a 3D boundary model from such contours is surface triangu lation. As discussed in Section 5.3.2, such triangulation is computationally efficient, easy to use and flexible; models were created for subsurface features, underground excavations, surface topographies, an openpit, a quarry and an access ramp. Although surface triangulation is computationally efficient, easy to use, flexible and gen erates topologically valid boundary models, it is difficult to quantify whether such models axe representative of the corresponding real world object. Many excavations have shapes which can be defined using parametric values e.g. a shaft. By utilising a description language, such shapes can be created, modified and positioned in space through interactive means and without the need for laborious draughting. 3 D v isu a lisa tio n  Cogent visualisation of complex 3D geometries requires advanced computer graphics techniques including colour shading, light source manipulation, view transforma tions and scene composition. Although such techniques can be applied to volume models, they are primarily designed to operate on boundary models (Foley et a/., 1982; Burger et a/., 1989; Watt, 1989). Heterogeneous bodies, which are defined by variable attributes, such as mineral content, con taminant concentration and porosity, do not have discrete boundaries and, therefore, cannot be represented by boundary models. Space subdivision schemes are the most appropriate alterna tive as they have a general domain, are inherently valid and index space i.e. represent every unit of space within the solid. Current geoscientific information management systems employ regular space subdivision schemes e.g. block models, to represent heterogeneous bodies. Although such models offer certain func
187
C H A P T E R 6. DISCUSSION
188
tionality, such as integral property calculation and arbitrary sectioning, they are memory ineffi cient and unable to represent features with both high geometric and high resolution complexities. A daptive spatial subdivision e.g. linear octree encoding, overcomes these disadvantages and, by employing a spatial indexing technique, also offers advanced generic functionality: S p a tia l search  The spatial search functions offer advanced design capabilities which are not supported by either manual models or current 3D geoscientific information systems e.g. L y n x ™ , Datam ine™ and G O C A D ™ • Such capabilities include: • identifying the spatial distribution of ore and waste components; • investigating regions of an orebody to assist in stope design and positioning; • simulating exploratory boreholes; • feature tracing; • contact tracing; • improving the accuracy and computational efficiency of geostatistical analysis (Prissang, 1990); • optimising openpit design and extraction scheduling (Dunstan, 1990). T rack in g  The tracking function allows interactive retrieval of spatial location and composi tion. Such retrieval has wide application in manmachine interfacing and graphics data management. S p a tia l and relatio n al query  Although spatial and relational query functions have not been implemented in A E G IS , the integration of octree models with a RD BM S has been achieved by Mao (Mao et al., 1989). Such integration allows the effective query of both spatial and nonspatial features simultaneously. Although the characteristics and functionality of a hybrid scheme combining boundary and vol ume modelling fulfill the requirements for a geoscientific information management system as defined in Section 1.2, the scheme has certain disadvantages which pose both implementation and application problems. In dynamic projects, such as a mining operation, components of a model are continually being updated and modified. If such modifications include Boolean operations, congruency between corresponding boundary and octree model envelopes i.e. geometric structure, cannot be main tained: Boolean operations can only be performed on octree models. This limits visualisation functionality as the updated model can only be viewed as an octree. Furthermore, once congru ency of envelopes has been lost, objects can no longer be transformed with confidence. As discussed in Section 5.3.8, the octree transformation operations are not rigid. Such trans formations must, therefore, be performed on a corresponding boundary model. However, if a component of the octree universe has been modified by a Boolean operation, its envelope is no longer congruent with the corresponding boundary model; rigid transformations of modified objects cannot be performed. One solution to the problem of maintaining congruency is to employ a hybrid scheme which in teg ra te s boundary and volume models, such as the extended octree (Navazo et al., 1986). As discussed in Section 2.7, such schemes suffer the black hole effect (Durst et al., 1989). Further more, integrating vector and raster concepts increases the complexity of Boolean operations.
189
The application of such schemes to features with high geometric, resolution and compositional complexity has not yet been investigated. An alternative solution to the problem of congruency is to improve octree visualisation capa bilities and to develop algorithms which allow rigid transformations of octree models. This approach, which could be implemented in the near future given the visualisation capabilities of Voxel V ie w ™ and the octree algebra1 concepts developed by Gunther Schrack at the University of British Columbia (Schrack, 1988), has certain merits: • Congruency between boundary and volume model envelopes is not required. • A ll object modification and analysis functions are performed on octree models; system implementation is simplified. In dynamic projects, where numerous design alternatives axe continually investigated, it is es sential to be able to retrace data manipulation operations i.e. perform a roll back . Implementing such a capability in a geoscientific information system is complex as historical records of both the occupancy and composition of space must be maintained. To illustrate this complexity consider an example. Assume a geological feature, with a homogeneous composition, to intrude into a mineralised zone of heterogeneous composition (grade). When these entities are ‘joined’ the composition of common space becomes that of the intruding body i.e. grade information is lost. If the location of the intruding feature is modified (because of updated information) the composition of certain regions of common space must be set back to their original state. As grade information has been lost, this can only be achieved if a record of the original composition of the mineralised zone is maintained. One method of implementing a roll back capability is to maintain records of the changes in occupancy and composition resulting from modification operations i.e. exception reporting. With the hybrid scheme, however, this approach demands large storage requirements as octree models are not concise. For example, a record of the grade information lost by ‘joining’ the tunnels in the Molson project with the mineralised zone i.e. the octree model resulting from an intersection operation, comprises 255863 octants (2.05 Mbytes). In applications which consider regional geology the domain extent may vary between 10km and 1000km requiring scale factors of 19.53 to 1953.12 to map the domain into a resolution R = 9 octree universe. Intuitively, from the results discussed in Section 5.3, the linear, surface area and volumetric accuracies associated with such scale factors are unacceptable. One method of overcoming this inaccuracy is to increase the octree resolution. However, as discussed in Section 5.3.1.2, such an approach is impractical (due to memory constraints). An alternative method is to employ an hierarchical database management system. A domain with ‘regional’ dimensions can be recursively divided into octants such that each voxel represents the root of a resolution R = 9 octree universe i.e. a linear octree file. This division process does not consider geometric entities but is controlled by the existence of octree files. Hence, a set of disjoint and adjacent resolution R = 9 octree universes can be employed to represent the entire region and can be managed in a hierarchical database management system utilising an octree indexing scheme. 1O c tre e a lg e b ra is a m e th o d o f n e ig h b o u r fin d in g w hich a cco u n ts fo r the finite d im e n sio n s o f an o ctree u nive rse and th e o rie n ta tio n o f o c ta n ts .
190
C H A P T E R 6. DISCUSSION
In conclusion, after reviewing both current C A D practices in mineral resources engineering and solid modelling theory, it is proposed that an appropriate method of representing a subsurface environment is a hybrid scheme combining boundary modelling techniques with adaptive spatial enumeration. Implementation of such a scheme, in a prototype Advanced Engineering Graphics Information System, and the application of generic algorithms to example data sets, has proven the method to offer new and advanced functionality.
C h a p te r 7
C o n c lu s io n
The emergence of 3D geoscientific information systems, and the growing interest in the use of databases of all forms, focuses attention upon the importance of versatile spatial indexing and spatial query through graphical userinterfaces. The inclusion of animation and analysis of the dynamics of engineering and scientific systems, as a capability in C A D , further emphasises the need for efficient indexing of events and features in a temporal and spatial context. It is for these reasons that the combining of boundary representation and spatial indexing techniques, as presented in this thesis, will find wide and enduring application in the disciplines of geoscience. With the recent development of voxel processing hardware e.g. the Sun Microsystems T A C C board and the Silicon Graphics Inc. V G X supercomputers, and volum e in v estig atio n software e.g. Voxel V ie w ™ , Camra 2000™ and S G M ™ , it is apparent that spatial enumeration tech niques are not ephemeral. However, before such techniques are applied enthusiastically to diverse problems such sis robotic surgery (Flynn, 1989; Dekel, 1990), cost allocation in environmental litigation (Lush, 1990; Seltzer, 1990) and tracing fluid flow through host rock (Budding, 1988), it is essential that the underlying theory is understood. The serious consequences of analysing invalid solid models may be particularly significant. Although there is a wealth of literature on the theory and use of solid modelling in C A D , little has been presented on the use of such theory in geoscientific applications. Furthermore, only Karonen (Karonen, 1985) and Kavouras (Kavouras, 1987) have investigated the functionality of spatial enumeration techniques in mine design. Hence, the contribution of this research to the applied earth sciences includes: • The p re se n ta tio n o f m ath em atica l theory defining solidity in the context of g eo scien tific ap plication: In ‘conventional’ solid modelling theory, the concept of solidity does not consider spatial composition: solid objects are assumed to be homogeneous bodies. This is inappro priate for geoscientific applications as subsurface environments comprise both homogeneous and heterogeneous features. • V alidation o f the p ra c tic a l use o f sp atial en u m eratio n techniques in m in e ra l resources engi neering: By implementing a prototype Advanced Engineering Graphics Information System and applying it to example data sets, it was possible to validate the theory presented in this thesis and investigate the practiced use of spatial enumeration techniques in mineral resources engineering. • Im p le m e n ta tio n o f g en eric algorithm s which offer new a n d advanced cap ab ilities in m ine design a n d volum e investigation: The generic algorithms implemented in A E G IS offer ad vanced functionality which have not been reported previously.
191
192
C H A P T E R 7. C O N C L U S I O N
With recent advances in technology, many of the deficiencies of A E G IS can be overcome by hardware specific implementation. For example, octree models can be visualised in real time on Silicon Graphics Inc. V G X supercomputers using Voxel V iew ™ . Certain aspects of this research do, however, require further investigation. 3 D Surface T ria n g u la tio n  Currently, surface triangulation algorithms generate polygonal mesh models from planar parallel contour or border loops. Such loops are projections of 3D boreholes and are, therefore, less accurate than the original data from which they are derived. The triangulation of nonplanar, nonparallel contour or border loops, defined directly from 3D data, would generate more accurate and realistic boundary models. Another disadvantage of current surface triangulation algorithms is that components in a heterogeneous assemblage are generated as independent units and without adjacency considerations. Although this approach ensures valid components, there are no topological constraints preventing interference; the total assemblage may be an invalid solid model. In te ra ctiv e B le n d in g of L in e a r Octree M o dels  Gargantini has developed an algorithm to generate linear octree models through label pro p ag atio n (Chan et al., 1986). The latter is essentially a filling technique, similar to those used in raster technology, which floods with voxels a region of space defined by an octree surface. If this algorithm is integrated with the frame buffer concept utilised in the tracking function, is could be possible to blend interactively polygonal mesh boundaries onto existing octree models (Gargantini, 1989). A n im a tio n of F lu id F lo w  Hydrogeologists utilise finite difference methods to simulate the flow and transport of contaminants in a subsurface environment. As this process is time related, it can be visualised as an animated sequence. Although systems exist which can perform such visualisation (Flynn, 1989), none axe capable of displaying the flow of con taminants through a host rock. By utilising filling techniques, similar to those discussed for interactive blending, the flooding of an octree model could be visualised as an animated sequence. Octree F ile M anagem ent  One method of representing an expansive domain, using octree models, is to decompose the domain into adjacent, disjoint resolution R = 9 octree uni verses. By treating the root nodes of these universes, or octree files, as the voxels of an higher resolution octree e.g. R = 20, it is possible to maintain conformity of functionality throughout the database. Although this approach is conceptually feasible, further research is required to identify methods of encoding and manipulating features which lie partly in two or more adjacent octree universes. In particular, the regularised octree set operations must be modified to process not only two lists but an arbitrary number of lists simultaneously. Furthermore, memory requirements must also be investigated.
R e fe re n c e s
Abel D .J. and Smith J.L . A data structure and algorithm based on a linear key for a retrieval problem. C o m p u ter Vision G raphics an d Im age P ro cessin g ., 2 4 :113 , 1983. Atkinson H. H., Gargantini I., and Wu O. L. L IN O C T 2.0. Technical Report 176, The University of Western Ontario, Department of Computer Science, September 1987. Bak P .R .G . Amberg M easu rin g Technique P ro filer 2 0 0 0 / 2 Test P ro g ram m e R eport. Technical Report, Imperial College of Science, Technology and Medicine, Department of Mineral Resources Engineering, 1987. Bak P.R .G . and Kunii T .L . A modified octree structure for the representation of geoobjects in a mining database management system. In Proceedings In fo rm a tio n P ro cessin g Society o f J a p a n ’88, 1988. Baer A ., Eastman C ., and Henrion M. Geometric modelling: a survey. C o m p u ter A ided D esig n , ll(5 ):2 5 3 2 7 2 , 1979. Baumgart B. G eom etric M odelling fo r C om puter Vision. Ph.D. thesis, Stanford University, Artificial Intelligence Laboratory, Computer Science Department, 1974. Beach R .J. A C M S IG G R A P H ’9 0 C onference Proceedings. Association of Computer Ma chinery, New York, 1990. Bowyer A. and Woodwark J. A p ro g ra m m e r’s geom etry. Butterworths, Sevenoaks,England, 1983. Bresenham J.E . Algorithm for computer control of a digital plotter. IB M S y stem s J o u rn a l , 4(l):2530, 1965. Brown C.M . PA D L2: a technical summary. I E E E C o m p u ter G rap h ics a n d A p p licatio n s , 2(2):6984, 1982. Brunet P. and Navazo I. Solid representation and operation using extended octrees. A C M T ra n sactio n s on G rap h ics , 9(2): 170 19 7, April 1990. Budding M. Stochastic modelling in oil reservoir characterisation. Personal Communication, Shell Exploration and Production Laboratory, Rijswijk, Holland, 1988. Burger P. and Gillies D. In teractiv e C o m p u ter G raphics: F u n ctio n al, P rocedural a n d D eviceLevel M ethods. In te rn a tio n a l C o m p u ter Science S e rie s , AddisonWesley Publishing Com pany, Wokingham, England, first edition, 1989.
~ Carlbom I. An algorithm for geometric set operations using cellular subdivision techniques. IEEE Computer Graphics and Applications,7:4455, May 1987. 193
194
REFERENCES
Chan K .C ., Gargantini I., and Walsh T .R . D ouble C onn ectiv ity F illin g fo r SD M odelling. Technical Report 155, The University of Western Ontario, Department of Computer Sci ence, 1986. Chivers I. Relational database management systems. Personal Communication, Imperial College Computer Centre, Imperial College, London, England, 1988. Christiansen H.N. and Sederberg T .W . Conversion of complex contour line definitions into polygonal element mosaics. A C M C o m p u ter G raphics, 12(3):18 719 2, 1978. Christiansen H.N. and Stevenson M. M O V IE .B Y U T rain in g Text. Provo,Utah, 1986. Curran J.H . 3D visualisation in mining. Personal Communication, Visualisation Laboratory, Department of C ivil Engineering, University of Toronto, Canada, 1989. Dekel D. Use of interactive solid modelling techniques in medical applications: the visual wand. Personal Communication, I.S.G . Technologies Inc., Mississaugua, Canada, 1990. Dunstan S. Geostatistical analysis of the Carribou copper deposit. Personal Communication, C A D Research Group, Imperial College of Science, Technology and Medicine, 1988. Dunstan S. In fo rm a tio n M an ag em en t in S urface M ine D esign. Ph.D. thesis, Imperial College of Science, Technology and Medicine, Department of Mineral Resources Engineering, 1990. In print. Durst M .J. and Kunii T .L . Methods for the efficient storage of spatial geological data. In Proceedings T h reeD im en sio n al M odeling with G eographic In fo rm a tio n S y stem s, N A T O A dvanced R esearch W orkshop, 1989. Faux I.D and Pratt M .J. C o m p u ta tio n a l G eom etry fo r design a n d M an u factu re. M a th e m a tic s a n d its A pplicatio n s, Ellis Horwood Limited, Chichester, England, 1979. Flynn J.J. The use of graphics super computers in medical and geoscience applications. Personal Communication, Silicon Graphics Computer Systems, Mountain View, C A ., USA, 1989. Foley J.D . and Dam van A. F u n d am en tals of In te ra c tiv e C o m p u ter G raphics. AddisonWesley, Reading, M A, 1982. Fujimura K . and Kunii T .L . Hierarchical space indexing method. In Kunii T .L ., editor, Proceedings o f C o m p u ter G raphics Tokyo ’85, pages 2 13 3 , 1985. Gan apathy S. and Dennehy T .G . A new general triangulation method for planar contours. A C M C o m p u ter G raphics, 16(3):6975, 1982. Gargantini I. Linear octtrees for fast processing of threedimensional objects. G raphics an d Im age P rocessing, 20:365374, 1982.
C o m p u ter
Gargantini I. and Tabakman Z. Separation of connected components using linear quad and octtrees. C ongressus N u m eran tiu m , 37:257276, 1983.
Gargantini I., Walsh T.R., and W u O.L. Viewing transformations of voxelbased objects via linear octrees. IEEE Computer Graphics and Applications, 6(10):1221, October 1986.
REFERENCES
195
Gargantini I. Modeling natural objects via octrees. In Proceedings T h reeD im en sio n al M od eling with G eographic In fo rm a tio n S ystem s, N A T O A dvanced R esearch W orkshop, 1989. Gorey K . Periodic tables of the Irises. Sales documentation, Silicon Graphics Computer Systems, Mountain View, C A ., USA, 1990. Greenberg M.M. and Dekel D. Glass submarine of volume imaging navigates through patient anatomy. D iag n o stic Im ag in g , April 1989. Henle M. A C o m b in a to ria l In tro d u c tio n to Topology. M ath em a tica l S ciences, W.H. Freeman and Company, San Francisco, 1979. Henley S. and Wheeler A .J. The use of solid modelling in underground mine design. In Proceedings C o m p u ter A p p licatio n s in the M in e ra l In d u s try , pages 359364, 1988. Hoffman C. G eom etric a n d S olid M odeling: an in tro d u ctio n . S eries in C o m p u ter G raphics a n d G eom etric M odelling, Morgan Kaufmann, San Mateo, 1989. Houlding S.W . 3D computer modelling of geology and mine geometry. M in in g M agazine, 226231, March 1987. Jones T .A . Modeling geology in three dimensions. G E O B Y T E , 3(4):1420, February 1988. Karonen O. G eom etric M ine M odeling o f T h reeD im en sio n al O bjects B ased on Incom plete In fo rm a tio n . Ph.D. thesis, Helsinki University of Technology, Laboratory of Information Processing Science, 1985. Kaufman A. An algorithm for 3D scanconversion of polygons. In Marechal Guy, editor, Proceedings of the E uro p ean G raphics C onference an d E xhibition, pages 197208, Elsevier Science Publishers B .V ., 1987. Kaufman A. and Reuven B. Memory and processing architecture for 3D voxelbased imagery. I E E E C o m p u ter G rap h ics a n d A p p lications, 8(6):1023, November 1988. Kavouras M. A S p atial In fo rm a tio n S ystem fo r the G eosciences. Ph.D. thesis, University of New Brunswick, Department of Surveying Engineering, 1987. Kelk B. 3D modelling in geoscience information systems: the problem. In Proceedings ThreeD im e n sio n a l M odeling with Geographic In fo rm a tio n System s, N A T O A dvanced R esearch W orkshop, 1989.
Kim ura F. GeomapIII: designing solids with freeform surfaces. I E E E C o m p u ter G raphics a n d A p plications, 4(6):5872, June 1984. Klein H., Pflug R., and Ramshorn Ch. Shaded perspective views by computer: a new tool for geologists. G E O B Y T E , 4(4):1621, August 1989. Krouse J .K . Sculptured surfaces for C A D /C A M . M ach in e D esign, 53(5):115 —120, March 1981. Kunii H.S. G raph D a ta Language: A High Level Access P a th O rien ted L anguage. Ph.D. thesis, University of Texas at Austin, 1983.
REFERENCES
196
Lee Y .T . and Requicha A .G . Algorithms for computing the volume and other integral proper ties of solids. I: known methods and open issues. C o m m u n icatio n s of the A C M , 25(9) :635641, 1982. Lush D. Contaminated subsurface characterisation and remediation. Personal Communica tion, Beak Environmental Consultants, Mississuaga, Canada, 1990. Lynx Geosystems, Inc. Lynx Geologic an d M ine M odeling S ystem T raining Text. Vancouver, B .C ., 1988. Mallet J L . G O G A D : a computer aided design program for geological applications. In P r o ceedings T h reeD im en sio n al M odeling with G eographic In fo rm atio n System s, N A T O A d vanced R esearch W orkshop, 1989.
Mantyla M. A n In tro d u ctio n to Solid M odeling. P rin c ip le s of C om puter Science S eries, Computer Science Press, Rockville, Maryland, first edition, 1988. Mao X ., Fujishiro I., and Kunii T .L . G ID B S: a database system for hierarchically represented grayscale images. In Proceedings T hreeD im en sio n al M odeling with Geographic In fo rm a tio n S ystem s, N A T O A dvanced R esearch W orkshop, 1989. Mark D.M . and Cebrian J.A . Octtrees: a useful datastructure for the processing of to pographic and subsurface area. In Proceedings A C S M A S P R S A n n u al C onvention 1 9 8 6 , C artography a n d E d u catio n , pages 10 4 113 , Washington, D .C ., March 1986. Meagher D.
Geometric modeling using octree encoding.
C om puter G raphics an d Im age
P rocessing, 19(2): 129147, June 1982.
Mill A .J.B . and Bak P.R.G . C om puter Aided D esign of U nderground M etalliferous M ining L ayouts. Technical Report, Imperial College of Science, Technology and Medicine, De partment of Mineral Resources Engineering. E E C Raw Materials Research Programme Contract No. M AIM 0026D(B), July 1989. MirekuGyimah D. C o m p u ter A ided M ine D esign an d P la n n in g at P an asq u e ira, P o rtu g al. PhD thesis, Imperial College of Science, Technology and Medicine, Department of Mineral Resources Engineering, 1988. Morton G.M . A C o m p u ter O rien ted Geodetic D a ta B ase an d a New Technique in F ile S e quencing. Technical Report, IBM Canada Ltd., March 1966. Navazo I., Ayala D., and Brunet P. A geometric modeller based on the exact octree repre sentation of polyhedra. C o m p u ter G raphics F o ru m ., 5:91104, 1986. Notley K .R . and Wilson E .B . Threedimensional mine drawings by computer graphics. C IM B u lletin , 6064, February 1975. Peuquet D .J.
Data structures for a knowledgebased geographic information system. In Proceedings In te rn a tio n a l Sym posium on S p atial D a ta H andling, pages 372391, August 1984.
Prissang R . C o m p u ter A ided D esign o f U nderground M etalliferous M ining L ayouts. Tech nical Report, Freie Universitat Berlin, Department of Mathematical Geology. E E C Raw Materials Research Programme Contract No. M AlM 0026D(B), December 1990.
REFERENCES
197
Requicha A .A .G . M ath em a tica l M odels o f R igid Solid Objects. Technical Memo., Production Automation Project 28, University of Rochester, November 1977. Requicha A .A .G .
Representations for rigid solids: theory, methods, and systems.
ACM
C om puting Surveys , 12(4):437464, 1980.
Rhind D. Spatial data handling in the geosciences. In Proceedings T h reeD im en sio n al M od eling w ith Geographic In fo rm a tio n System s, N A T O A dvanced R esearch W orkshop, 1989. Rogers D .F. P rocedural E lem en ts fo r C o m p u ter G raphics. McGrawHill International Book Company, London, 1985. Samet H. and Tamminen M. 19 (3):121—130, July 1985.
Bintrees, C S G trees and time. A C M C o m p u ter G raphics,
Samet H. A p p licatio n s o f S p atial D a ta S tructures: C o m p u te r G raphics, Im age P rocessing an d G IS. AddisonWesley Publishing Company, Reading, M A, first edition, 1990. Scheltzer R. Use of 3D computer graphics in the courtroom. Personal Communication, Litigation Sciences Inc., Los Angeles, C A ., USA, 1990. Schildt H. C: The C om plete Reference. Osborne McGrawHill, Berkeley, California, 1987. Schrack G. Model transformations using octree algebra. Personal Communication, Electrical Engineering Department, University of British Columbia, 1988. Shephard M.S., Baehmann P.L., and Grice K .R . Versatility of automatic mesh generators based on tree structures and advanced geometric constructs. C o m m u n ica tio n s o f A pplied N u m eric al M ethods, 4(3):379392, May 1988. Smart J.R . T h reeD im en sio n al M odelling o f Irreg u lar N a tu ra l Objects. Master’s thesis, Uni versity of New Brunswick, Department of Surveying Engineering, 1986. Thiessen R .L . and Brown S.P. Computer simulation of refolded ore bodies. C o m p u ter A p p licatio n s in M in eral E x p lo ratio n , 6063, January 1986. Tilove R.B . Set membership classification: a unified approach to geometric intersection problems. IE E E T ra n sactio n s on C om puters, C29(10):874883, October 1980. Timmer H .G. and Stern J.M . Computation of global geometric properties of solid objects. C o m p u ter A ided D esign, 11(6), November 1980. Tamminen M. and Samet H. Efficient octree conversion by connectivity labelling. A C M C o m p u ter G raphics, 18 (3):4351, July 1984. Turner A .K . The role of threedimensional geographic information systems in subsurface characterization for hydrogeological applications. In Proceedings T h reeD im en sio n al M od eling with Geographic In fo rm a tio n System s, N A T O A dvanced R esearch W orkshop, 1989. Watt A. F u n d am en tals o f T hreeD im en sio n al C o m p u ter G raphics. AddisonWesley Publish ing Company, Wokingham, England, first edition, 1989.
Wilson Robin J. Introduction to Graph Theory. Longman Group Limited, Essex, England, third edition, 1985.
198
REFERENCES Yamaguchi K ., Inamato N., Kunii H.S., and Kunii T .L . Threedimensional input by selection of hierarchically defined blocks. In B0K. and Tucker H .A , editors, P roceedings o f the E u ro p ean G rap h ics C onference an d E x h ib itio n , pages 1524 , Elsevier Science Publishers B .V ., 1984. Yau M M . and Srihari S.N. Recursive generation of hierarchical data structures for multidi mensional digital images. In Proceedings I E E E C o m p u ter Society C onference on P a tte r n R ecognition an d Im ag e P rocessing, pages 4446, 1981.
Appendix A
P o in t S e t T o p o lo g y : B a s ic C o n c e p ts
The basic concepts of pointset topology, presented in this Appendix, are wholly based on the text by Henle (Henle, 1979).
A .l
P o in t S e t T o p o lo g y
Consider a circular disk cut from a sheet of rubber. If it is subjected to pulling, twisting and stretching i.e. a variety of distortions, its geometric properties of shape, surface area and perime ter will change, as illustrated by the examples in Figure A .l. If the distortions are co n tin u o u s tran sfo rm a tio n s i.e. they do not tear the disk, each new shape will be topologically equivalent: any one shape can be continuously transformed to another.
Figure A .l: A D isk an d Topologically E q u iv alen t F ig u res Informally, a continuous transformation must preserve the ‘nearness’ of points. If a point is near a certain set, then, the transformed point must be near the transformed set. The notion of nearness can be more formally defined as: D e fin itio n A . l L et P be a p o in t in the p lan e.
A neighbourhood o f P is any c irc u la r disk (w ith o u t the boundary circle) th a t co n tain s P (F ig u re A .2 ). L et S be a subset of the p la n e . The p o in t P is called near the set S i f every neighbourhood o f P co n tain s a p o in t o f S . I f P is n ea r S , th en P «— S .
199
A P P E N D I X A. POINTSET T O P O L O G Y : BASIC C O N C E P T S
200
Vt / Ti V
/
Figure A.2: The N eighbourhood o f a P o in t To illustrate this, let S be an open unit disk i.e. the set of points P such that P < 1. The points near S include all the points of S plus the points on the boundary circle P = 1, as shown in Figure A.3.
The open unit disk S
The points near S
Figure A .3: The N ear P o in ts of a set S A continuous transformation can now be formally defined as: D e fin itio n A .2 A continuous transformation fro m one su b set D of the p lan e to a n o th e r V is a fu n c tio n f with do m ain D a n d range V such th a t fo r any p o in t P 6 D a n d set S C D , if P is n ea r S , then f (P) is n ea r the set f (5) = { / ( ) \ G
Q Q
f(P)<f(S).
The notion of nearness is fundamental in defining further topological concepts: D e fin itio n A . 3 A set is open if every p o in t in the set is n o t n ea r the com plem ent of the set. The interior of the set S , denoted by i (5), consists o f those p o in ts o f S th a t are n o t n e a r the com plim ent of S .
Definition A.4 The boundary of a set S, denoted by b(S), consists of those points that are near both S and the complement of S .
A.l. POINTSET T O P O L O G Y
2 01
D e fin itio n A .5 A set is closed if it co n tain s all its n e a r p o in ts an d the closure o f a set S , den o ted by c ( S ) , consists o f S an d all the p o in ts n ea r S .
D e fin itio n A .6 A set is bounded if it is co n tain ed in a rectangle. Intuitively, the concept of boundedness defines a set to be finite; an infinite set cannot be con tained in a rectangle. T h e o re m A . l A subset S o f the p lane is compact i f an d only if S is closed a n d bounded. D e fin itio n A .7 A set S is connected if w henever S is divided in to two n o n em p ty , d isjo in t su b sets A an d B:
S = A uB,A ^0,B^0,A nJ3 = 0 one o f these sets always co n tain s a p o in t n e a r the other.
202
A P P E N D I X A. POINTSET T O P O L O G Y : BASIC C O N C E P T S
This is a blank page.
Appendix B
A lg e b r a ic T o p o lo g y : S u r fa c e s a n d P l a n e M o d e ls
The basic concepts of algebraic topology, presented in this Appendix, are wholly based on the texts by Mantyla (Mantyla, 1988) and Henle (Henle, 1979). Surfaces are those topological spaces in which every point has a neighbourhood that is topologi cally equivalent to an open disk: a 2m anifold. Intuitively, such spaces may be regarded as open subsets of E 3 which are ‘two dimensional’; the properties of a surface can be studied using a 2D model in the plane, referred to as a plan e model. To illustrate the representation of a surface by a plane model consider a simple example. If two opposite sides of a rectangle are glued together it is possible to create a cylinder, as illustrated in Figure B .l. The latter is a surface in E 3 while the rectangle is a 2D model in the plane.
A Rectangle
Folding of a Rectangle
A Cylinder
Figure B .l: C reating a C ylinder fro m a R ectangle The rectangle is not an open subset of the plane as the points on those edges which are glued together do not have neighbourhoods which are topologically equivalent to open disks1 . There fore, to be an effective representation of the cylinder the rectangle must have a special topology which labels symmetrical points, on opposite edges, to have similar neighbourhoods i.e. iden tify these points to be topologically equivalent. To be able to represent more complex surfaces it is necessary to formalise the concept of plane models. Consider first the topological identification of edges: D e fin itio n B . l L et P be a s e t o f polygons an d let a 1, a 2) . . .,a n be a collection o f edges fro m these polygons. The edges are term ed identified when a new topology is defined on P : • E ac h edge is assigned an o rie n ta tio n fro m one en d p o in t to the o th er a n d placed in topological correspondence with the u n it in te rv a l in such a way th a t the in itia l p o in t o f each edge corresponds to 0 an d the fin a l p o in t corresponds to 1. *The points on the top and bottom edges of the rectangle are ignored for the time being as the cylinder is a surface with boundary. The latter is a special case of general surfaces as defined.
203
A P P E N D I X B. A L G E B R A I C T O P O L O G Y : S U R F A C E S A N D P L A N E M O D E L S
204
• The points on the edges a 1, a 2) ...,a n that correspond to the sam e value of the u n it interval are treated as the sam e point. • The neighbourhoods of the new topology on P are the disks entirely contained in a s in gle polygon plus the unions of halfdisks whose diam eters are m atching intervals around corresponding points on the edges a1}a2,...,an. C o n s id e r n o w th e id e n tific a tio n o f vertices:
Let P be a set of polygons and let P i,P a , — ,Pn be a collection of vertices from these polygons. The latter are said to be id e n tifie d when a new topology is defined on P in which this collection of vertices is treated as a single point and the neighbourhoods are defined to be disks completely contained in a single polygon plus the unions of portions of disks around each of the points p x,p 2, ...,p n . In case any of the edges meeting at one of these vertices is also identified, the sectors form ing a neighbourhood at p t ,p 2, ...,p n m ust also contain m atching intervals from these edges.
D e fin itio n B .2
H a v i n g defin e d th e id e n tific a tio n o f b o th ed ges a n d ve rtice s a p la n e m o d e l c a n be m o re fo r m a lly defin ed as:
A p la n e m o d e l is a p lan ar directed graph {N , A, R} with a finite num ber of vertices N = { rii,n 2, ...}, edges A = { a 1}a 2,...} and polygons R = { r n r 2,...} bounded by the edges and vertices. Each polygon of the graph has a certain orientation around its edges and vertices. Polygons, edges and vertices of the graph are labelled; if a collection of the edges or vertices has the sam e label they are considered to be identified according to definitions B .l and B.2.
D e fin itio n B .3
T h e p la n e m o d e l o f th e c y lin d e r, in th e p r e v io u s e x a m p le , is s h o w n in F ig u r e B .2 ; id e n tifie d e d ge s are a t tr ib u te d a c o m m o n la b e l a n d th e ir o rie n ta tio n is in d ic a te d b y a n arrow . U s i n g th is g r a p h ic a l te ch n iq u e , so m e f u n d a m e n t a l su rfac e s c a n be d isc u sse d in te r m s o f th e ir p la n e m o d e ls:
A
S p h e r e  In tu itiv e ly , a sph ere, w h ic h is one o f th e s im p le s t su rface s, c a n be c o n s tr u c te d b y g lu in g to ge th e r the tw o sid e s o f a cell. T h e p la n e a n d sp a c e m o d e ls for su c h a su rfac e are s h o w n in F ig u r e B .3 .
A
T o r u s  In tu itiv e ly , a to r u s is a c y lin d e r w h ic h h a s been b e n t su c h th a t th e to p a n d b o t t o m e d ge s con nect.
T o p o lo g ic a lly , the to ru s is a su rfac e w h ic h re s u lts fr o m id e n tify in g b o t h
o p p o site p a ir s o f e d ge s o f a re ctangle . T h e p la n e a n d sp a c e m o d e ls fo r su c h a su rfa c e are sh o w n in F ig u r e B .4 . A
P r o j e c t i v e P l a n e  A p ro je c tiv e p lan e , a lso referred to as a
twisted sphere , c a n b e t h o u g h t o f
a s a c irc u la r d is k w it h d ia m e t r ic a lly o p p o site p o in t s ide ntifie d . A l t h o u g h th e p la n e m o d e l o f su c h a su rfac e c a n be d e p icte d , as in F ig u r e B .5 , it is im p o s s ib le to id e n tify , o r v isu a lise , th e c o r r e s p o n d in g sp a c e m o d e l.
T h e su rfa c e s pre se n te d are ge n e ric
surfaces without boundary a n d c a n b e c o m b in e d to cre ate connected sum o f surfaces. T o illu s tr a te
m o re c o m p le x surfaces. T h e la t te r are referred to as th e
th is c o m b in a t io n p roce ss, c o n s id e r th e con n e cte d s u m o f tw o tori. A d is k is c u t fr o m e ach to ru s
205
u
*
Plane Model
Space Model
Figure B.2: The P la n e M odel o f a C ylinder and the resulting surfaces are glued together along the boundary of the cutouts. The plane2 and space models for such a connected sum Eire shown in Figure B.6. Topological identification does not necessarily define topological surfaces. For example, the objects in Figure B.7 have points whose neighbourhoods are not open disks; the common vertex in Figure B.7a and the points on the common edge in Figure B.7b. To exclude such cases the topological identification of plane models is further qualified: D e fin itio n B .4 A topological space is triangulable if it can be obtained fro m a set o f trian g les by the id en tificatio n o f edges an d vertices subject to the re stric tio n th a t an y two tria n g le s are id en tified eith er along a single edge or a t a single vertex, o r are com pletely d isjo in t. A surface is a trian g u lab le space fo r which in addition: • E very edge is id en tified with exactly one other edge.
• F o r each collection o f id en tified vertices, the polygons (tria n g le s ) id en tified a t th a t collection can be arran g e d in a cycle such th a t each consecutive p a ir o f polygons ( trian g les) in the cycle is id en tified a t an edge a d jac en t to a vertex from the collection.
A surface need not be restricted to triangular polygons as every polygon can be triangulated. Based on plane model representations further topological characteristics of surfaces can be de fined: Th eo rem B . l A surface is compact if a n d only if its tria n g u la tio n s use only a fin ite n um ber o f trian g les.
This theorem gives an algebraic interpretation of pointset topological compactness: a compact surface is closed and bounded. Similarly, the algebraic interpretation of pointset topological connectedness is: T h eo rem B .2 A surface is connected i f a n d only i f the polygons in a tria n g u la tio n o f the su rface can be a rran g e d in a sequence P u P 2, . . . , P n so th a t each polygon has a t least one edge id entified to an edge o f an earlier polygon in the sequence. 2T o simplify plane models, identified edges are drawn just once and their labels are not included. Similarly, a collection of identified vertices are drawn as a single point.
206
A P P E N D I X B. A L G E B R A I C T O P O L O G Y : S U R F A C E S A N D P L A N E M O D E L S
a
Plane M o d e l
Space M o d e l
F ig u r e B .3 : The P la n e M odel of a Sphere
Plane M o d e l
Space M o d e l
F ig u r e B .4 : The P la n e M odel o f a T orus
Plane M o d e l
F ig u r e B .5 : The P la n e M odel o f a P ro jectiv e P la n e
B.l. T H E E U L E R  P O I N C A R E F O R M U L A
207
Space M o d e l
Figure B.6: The P la n e M odel o f the C onnected Sum o f two T ori The most important theorem in the topological theory of surfaces is the classificatio n th eo rem : Th eo rem B .3 E very com pact, connected surface is topologically equivalent to a sphere, or a connected sum o f to ri, or a connected sum o f projective p lan es.
As stated, projective planes are impossible to identify in E 3. Obviously, this is also true for a connected sum of projective planes, such as the celebrated K lein bottle. To be able to distinguish between such unidentifiable and identifiable surfaces, 2manifolds can be o rien ted according to Mobius’ rule: D e fin itio n B .5 A p lan e m odel is orientable if the direction o f its polygons (tria n g le s ) can be chosen so th a t fo r each p a ir o f id entified edges, one edge occurs in its positive o rie n ta tio n in the d irection chosen fo r its polygon an d the other one in its negative o rien ta tio n .
B.l
T h e EulerPoincare F o r m u l a
Consider, first of all, the plane model of a cube, as depicted in Figure B.8a. The model has six faces, twelve edges and eight vertices. If one of the faces is triangulated, as depicted in Figure B.8b, the new model will have seven faces, thirteen edges and eight vertices. Nonetheless, this model still represents the same cube. There is a relation between the faces, edges and vertices of the model: Th eo rem B .4 L et the su rface S be given as a p lan e m odel a n d let v ,e an d f denote the num bers o f vertices, edges a n d faces in the model. Then the sum v — e f / is a co n stan t in d ep en d e n t o f
208
A P P E N D IX B. A L G EB R A IC TO POLO GY : SU RFA CES AN D P L A N E M O D ELS
Two polyhedrons with a common vertex
B : Two polyhedrons with a common edge
Figure B.7: Solids with N on m an ifo ld S urfaces the m a n n e r in which S is divided up to fo rm the p lan e model. T his co n sta n t is called the Euler characteristic of the su rface a n d is denoted X (S).
Applying the Euler formula to the example, the Euler characteristic for both plane models is 2 which is equivalent to that of a sphere: x = v  e+ / = 8 1 2 + 6 = 2 and after the modification: x ' = v  e ' + / ' = 8 —1 3 + 7 = 2
The Euler formula presented is, in fact, only valid for surfaces which are topologically equivalent to a sphere; it does not consider the orientability of a surface. The theory of hom ology3 allows the Euler characteristic to be expressed in terms of the E ulerP o in c a re form ula: X = h 0  hi + h 2
(B .l)
where h 0, h x and h 2 are called the B e tti num bers of the plane model. The topological significance of these numbers is: 3The theory of homology is presented in the text by Henle (Henle, 1979). As the explanation of this theory is extensive it is not discussed in this Appendix.
B.L T H E E U L E R  P O I N C A R E F O R M U L A
209
Figure B.8: P la n e M odels o f a Cube
• The zeroth Betti number h 0 equals the number of com ponents in the surface i.e. the number of surfaces in the connected sum. For the example cube h 0 = 1.
• The first Betti number h x is the connectivity num ber and determines the number of closed curves that can be drawn on the surface without dividing it into two or more separate pieces. Intuitively, h i is twice the number of ‘holes’ in the surface. For the example cube h i = 0 while for a torus = 2; a torus has one hole.
• The second Betti number h 2 determines the orientability of a surface and for orientable surfaces is equal to h 0.
A more mnemonic notation for Equation B .l can be written as:
v —e + f = 2 ( s —h )
(B.2)
where s is the number of shells or connected surfaces (h0) and h is the number of holes or genus of the surface ( h 2/ 2 ). Using the EulerPoincare formula, the Euler characteristics of the generic surfaces previously presented are:
210
A P P E N D I X B. A L G E B R A I C T O P O L O G Y : S U R F A C E S A N D P L A N E M O D E L S Surface Sphere Torus Projective Plane
Euler characteristic
2 0 1
Connected sum of n tori
2—2n
Connected sum of n projective planes
2—n
Appendix C
A B a s ic R e fle c tio n M o d e l
The objective of a basic reflection model is to synthesize the interaction of light with a surface while maintaining computational simplicity. One such model, which is commonly used in com puter graphics, was developed by B uiT uong P h o n g in the early seventies (Watt, 1989). This model assumes the intensity of reflected light to comprise a diffuse component characteristic of matt surfaces, a specular component characteristic of shiny surfaces, an am b ien t term which accounts for background illumination and a distance correction.
C .l
D iffu se R e fle ctio n
Diffuse reflection is the result of light being absorbed and reradiated by a thin layer under the surface of an object. This physical process has two major characteristics (Burger et al ., 1989): 1. Light is reflected uniformly in all directions; the reflected light intensity is independent of the position of the viewer. 2. Reflectivity is a function of wavelength colour. Based on these characteristics and assuming that the incident light energy per unit area of surface is related to the cosine angle between the incident light direction and the outside surface normal (see Figure C .l) , the diffuse reflection intensity can be calculated using L a m b e rt 's cosine law: ■ ^reflected = ^incident ^diff COS0
(C .l)
where .Rdiff is the reflectivity for diffuse reflection and 6 is the angle between the incident light and the outside surface normal (Burger et a l ., 1989).
C .2
S p e c u la r R e fle ctio n
For a perfect specular reflector, such as a mirror, the incident, reflected and surface normal vectors lie in a plane and the angle between these vectors is equal i.e. light is reflected in one direction only (Burger et al., 1989). Furthermore, the reflected light ray has an intensity similar to that of the incident light ray (see Figure C.2). Intuitively, shiny surfaces are not perfect specular reflectors and, therefore, reflect light in many directions. The intensity of each reflected light ray is a function of the angle between the preferred reflected light direction, r, and the view direction, v , as illustrated in Figure C.3. 211
A P P E N D I X C. A BASIC R E F L E C T I O N M O D E L
212
I in c id e n t
F ig u r e C . l :
S in c e
T h e E n e rg y o f I n c id e n t L ig h t
is a p p lie d in 3 D , s p e c u la rly reflected lig h t is c o n ta in e d in a cone c e n tre d a r o u n d th e
ve c to r r a n d is s tr o n g ly in flu e n ce d b y the p o s it io n o f th e v ie w e r ( B u r g e r
et
a/., 1989). T h is is
represented b y the e m p ir ic a l fo rm u la :
^reflected — ^incident ^spec /
(^ )
cos
(^ )
(^ .2 )
w here th e sp e c u la r re fle ctivity R s pec in d ic a te s t h a t so m e lig h t m a y b e a b s o rb e d , c o s k {) defines the cone sh a p e ,
k
is a n e m p ir ic a l p a ra m e te r w h ic h d e te rm in e s th e s p e c u la r re fle ctive ne ss o f the
su rface (1 for d u ll su rface s a n d 1 0 0 + fo r h ig h ly s p e c u la r su rfa c e s) a n d / (0) d is t in g u is h e s betw een m a te ria ls su c h as glass, p la s tic o r m e ta l ( B u r g e r
C .3
et a l .,
1989).
A m b ie n t Illu m in a tio n
E q u a t io n s C . l a n d C .2 a ssu m e t h a t th e in te n sity o f reflected lig h t is d e p e n d e n t o n su rfac e c h a r acte ristic s, th e p o s it io n o f th e lig h t so u rce a n d th e n o r m a l d ire c tio n ve c to r a t a surface . B a s e d on th is a s s u m p tio n , su rface s w h ic h face aw ay fr o m th e lig h t s o u rc e d o n o t reflect an y lig h t a n d are n o t v isib le . T h is is u n re a listic a s in m o s t scenes there is a c o n s ta n t b a c k g r o u n d illu m in a t io n referred to as the
a m b ie n t lig h t in te n sity :
F ig u r e C .2 :
S p e c u la r R e fle c tio n f o r a M ir r o r S u rfa c e
C.4. D E P T H C U EING
213
r
Figure C.3: S pecular R eflection fo r a S hiny Surface
(C.3)
/ambient — ^amb /background
The background light intensity /background is dependent on the total intensity of the incident light from all sources and a constant illumination which is independent of the light source (Burger et al.j 1989).
C .4
D e p th C u e in g
The incident light intensity at a reflective surface is proportional to the inverse square distance between the light source and that surface. Similarly, the light intensity reaching the viewer of a scene is proportional to the inverse square distance between the viewer and the reflective surface. Although this inverse square law is true to life, its practical application does not generate realistic images; improved visualisation is achieved by using the inverse function:
1/ (d0 +
d)
where d is the appropriate distance and d 0 is an adjustable parameter. In cases where the distance between objects and the viewer varies significantly, the application of a distance correction results in depth cueing ; objects become fainter the further they are from the viewer (Burger et a l ., 1989). Having presented various sources of illumination, the intensity of a point on the surface of an object can be calculated using the basic reflection model:
/reflected — ^amb /background “1" ) ^ d
d ["^amk 4 Rj:*
COS0
where the summation is over light sources (Burger et a l ., 1989).
214
A P P E N D I X C. A BASIC R E F L E C T I O N M O D E L
This is a blank page.
Appendix D
E ffe c ts o f R e s o lu tio n o n O c tr e e M o d e l A c c u r a c y
Octree Resolution 4
5
6
7
8
9
Vector Domain Dimension (m)
62
62
61
61
61
61
Scale Factor for Universe
3.88
1.94
0.95
0.48
0.24
Volume Factor for Universe
58.19
7.27
0.87
0.11
0.01
Surface Area Factor for Universe
15.02
3.75
0.91
0.23
0.06
Volume Estimation (rrt* ) x 10 3
57.836
46.490
43.224
40.924
39.577
39.372
Volume Estimation Error (% )
46.5
17.76
9.48
3.66
0.25
0.27
Surface Area Estimation (m2 )x 10 3
15.916
15.796
15.902
16.657
16.757
17.248
Surface Area Estimation Error (%)
101.57
100.06
101.40
110.96
112.23
118.45
Octree Parameter
0.12 0.00 0.01
Table D .l: Volume a n d S urface Area C alcu latio n s fo r an Octree E ncoded Torus Octree Resolution 4
5
6
7
8
9
Vector Domain Dimension
21
21
21
21
21
21
Scale Factor for Universe
1.31
0.656
0.328
0.164
0.082
0.041
Volume Factor for Universe
2.26
0.28
0.035
0.004
0.0006
0.0001
S A Factor for Universe
1.72
0.43
0.11
0.03
0.006
0.0017
Volume Estimation (m3) x 10 3
4.825
4.475
4.316
4.233
4.174
4.134
Volume Estimation Error (%)
15.2
6.85
3.04
1.06
0.36
1.31
Surface Area Estimation (m2) x 103
2.439
2.444
2.785
2.832
2.877
2.916
Surface Area Estimation Error (%)
94.09
94.49
121.62
125.36
128.94
132.05
Octree Parameter
Table D.2: Volume a n d Surface Area C alcu latio n s fo r an O ctree Encoded S phere
215
216
A P P E N D I X D. E F F E C T S O F R E S O L U T I O N O N O C T R E E M O D E L A C C U R A C Y
O c tre e R e s o lu t io n
4
5
6
7
8
9
21
21
21
21
21
21
Scale Factor for U n iverse
1.31
0.656
0.328
0.164
0.082
0.041
V o lu m e Factor fo r U n iverse
2.26
0.28
0.035
0.004
0.0006
0.0001
Su rface A rea Factor for U n ive rse
1.72
0.43
0.11
0.03
0.006
0.0017
V olu m e Estim ation (m ) x 10
4.095
3.447
3.285
3.231
3.163
3.134
V o lu m e Estim ation E rror ( % )
30.35
9.72
4.56
2.17
0.68
0.24
1.721
1.516
1.735
1.711
1.746
1.698
36.95
20.64
38.07
36.16
38.94
35.12
O c tre e P a r a m e te r
V e ctor D om ain D im ension (m )
3
3
2
Surface Area Estim ation (m ) x 10
3
Surface A rea Estim atio n E rro r (% )
T a b le D .3 :
Volume and Surface Area C alculations fo r an Octree Encoded Cylinder
O c tre e R e s o lu t io n
4
5
6
7
8
9
li
11
li
11
11
li
S cale Factor for U n iverse
0.69
0.34
0.17
0.086
0.043
0.021
V o lu m e Factor for U n iverse
0.32
0.04
0.005
0.0006
0.0001
0.00
Surface A rea Factor for U n ive rse
0.47
0.12
0.029
0.0074
0.0018
0.0005
V olum e Estim ation (m3 )
232.7
175.1
158.2
151.6
148.9
146.0
V o lu m e Estim ation E rror ( % )
61.22
21.31
9.61
5.03
3.16
1.15
Surface Area Estim ation (m 2 )
407.9
368.7
372.4
383.0
387.6
395.3
Surface A re a Estim atio n E rro r (% )
104.5
84.88
86.74
92.06
94.36
98.22
O c tre e P a r a m e te r
V ector D om ain D im ension (m )
Table D.4: Volume and Surface Area Calculations for an Octree Encoded Polyhedron
A p p e n d ix E
E f fe c ts o f S c a le F a c to r o n O c tr e e M o d e l A c c u r a c y
Vector Domain Dimension
21
25
30
35
40
Scale Factor for Universe
1.31
1.56
1.87
2.19
2.50
Volume Factor for Universe
2.26
3.81
6.59
10.47
15.63
S A Factor for Universe
1.72
2.44
3.52
4.79
6.25
Volume Estimation (m3) x 103
4.825
5.447
5.418
5.778
5.953
Volume Estimation Error (%)
15.2
30.04
29.35
37.94
42.12
Surface Area Estimation (m ) x 10
2.439
2.900
2.749
2.593
2.253
Surface Area Estimation Error (%)
94.09
130.8
118.7
106.4
79.4
Octree Parameter
2
3
Table E .l: Volume a n d S urface A rea C alcu latio n s fo r an O ctree Encoded Sphere a t R eso lu tio n R = 4 Vector Domain Dimension
21
25
30
35
40
Scale Factor for Universe
0.66
0.78
0.94
1.09
1.25
Volume Factor for Universe
0.28
0.48
0.82
1.31
1.95
S A Factor for Universe
0.43
0.61
0.88
1.20
1.56
Volume Estimation (m ) x 10
4.475
4.609
4.793
4.833
4.931
Volume Estimation Error (%)
6.85
10.03
14.42
15.38
17.72
Surface Area Estimation (m2)
2.444
2.706
2.738
2.704
2.787
Surface Area Estimation Error (%)
94.49
115.4
117.9
115.2
121.8
Octree Parameter
Table E.2: Volume a n d S urface Area C alcu latio n s fo r an O ctree Encoded Sphere a t R eso lu tio n R = 5
217
218
A P P E N D I X E. E F F E C T S O F S C A L E F A C T O R O N O C T R E E M O D E L A C C U R A C Y
Vector Domain Dimension
21
25
30
35
40
Scale Factor for Universe
0.33
0.39
0.47
0.55
0.63
Volume Factor for Universe
0.04
0.06
0.10
0.16
0.24
S A Factor for Universe
0.11
0.15
0.22
0.30
0.39
3
4.316
4.330
4.403
4.399
4.525
Volume Estimation Error (%)
3.04
3.37
5.11
5.02
8.03
Surface Area Estimation (m2) x 1C?
2.785
3.028
2.678
2.642
2.615
Surface Area Estimation Error (%)
121.62
140.9
113.1
110.3
108.11
Octree Parameter
3
Volume Estimation (m ) x 10
Table E.3: Volume a n d S urface A rea C alcu latio n s fo r an O ctree Encoded Sphere a t R eso lu tio n R = 6
Vector Domain Dimension
21
25
30
35
40
Scale Factor for Universe
0.16
0.19
0.23
0.27
0.31
Volume Factor for Universe
0.004
0.007
0.01
0.02
0.03
S A Factor for Universe
0.03
0.04
0.05
0.07
0.09
Volume Estimation (m3 ) x 10 3
4.233
4.228
4.255
4.302
4.356
Volume Estimation Error (%)
1.06
0.94
1.58
2.70
3.99
Surface Area Estimation (m2) x 1C?
2.832
2.727
2.862
2.756
2.844
Surface Area Estimation Error (%)
125.36
117.0
127.8
119.4
126.4
Octree Parameter
Table E.4: Volume and Surface Area Calculations for an Octree Encoded Sphere at Resolution R = 7
219
Vector Domain Dimension
21
25
30
35
40
0.08
0.09
0.12
0.14
0.16
Volume Factor for Universe
0.0006
0.0009
0.0016
0.003
0.0W
S A Factor for Universe
0.007
0.009
0.014
0.018
0.024
Volume Estimation (m3) x 103
4.174
4.184
4.206
4.211
4.222
Volume Estimation Error (% )
0.36
0.11
0.41
0.53
0.79
Surface Area Estimation (m2) x 1C?
2.916
2.822
2.867
2.839
2.761
Surface Area Estimation Error (%)
132.05
124.6
128.2
125.9
119.7
Octree Parameter Scale Factor for Universe
Table E.5: Volume an d S urface A rea C alcu latio n s fo r an O ctree Encoded Sphere a t R eso lu tio n R = 8
2 2 0
A P P E N D I X E. E F F E C T S O F S C A L E F A C T O R O N O C T R E E M O D E L A C C U R A C Y
This is a blank page.