Content uploaded by Marcelo Gattass
Author content
All content in this area was uploaded by Marcelo Gattass on Nov 27, 2015
Content may be subject to copyright.
'90
\
arcelona,
Spain.
CATS'90, E. Oiiatc ct al.
(Eds
.). © 1990 CIMNE-Pineridge Press, Barcelona
A
SOFTWARE
TOOL
WHICH
PLANAR
SUBDIVISIONS
ALLOWS
INTERACTIVE
CREATION
OF
AND
APPLICATIONS
TO
EDUCATIONAL
PROGRAMS
P.
C.
P.
Carva
lho
lnstitu
to
de Matematica Puera e Aplicada,
Rio
de Janeiro,
BRAZIL
M.
Gattass
and
L.
F.
Martha
Pontificia
Universidade
Cat6lica,
Rio
de
Janeiro,
BRAZIL
ABSTRACT:
The
paper describes
the
use of topological
data
structures underlying interactive graphics educational systems related
to
planar subdivisions. This approach is adopted
in
a finite element mesh generator
and
in a program for creating geographical
maps. The geometric information is coupled with the
adja
cency information provided by the topological
data
structure in
an
object-oriented fashion.
The
result is
an
intelligent graphical editor, which is capable
of
recognizing adjacency relationships
among the regions
of
a subdivision and enforcing their consistency.
1.
Introdu
ction
Some educational programs in science and technology require
the description
of
a planar
body
to which
some
kind
of
analysis is to
be
applied.
The
body
may
be composed
of
several parts, perhaps
with
holes, eacb
part
usually defined
by
their boundary curves. To avoid geometric incompatibilities
(such as overlapping
and
gaps), curves that belong to more
than one
part
should
have
only one definition.
The
basic information
in
this representation is
the
set
of
oriented curves that define
th
e boundaries
of
a given part.
This information must
be
retrieved very rapidly for rendering
and analysis purposes.
When
the definition
of
a planar
subdivisi
on
is given
and
is
not
going to be changed, there are
many
si
mple ways to store this in formation.
If
, however, the
student interactively manipulates
boundary
curves,
inconsistencies
may
easily arise.
Topo
logical data structures,
with explicit storage
of
adjacency information,
can
offer an
efficient approach to this problem.
An
examp
le
of
this
situa
ti
on
occurs when a student needs
to create a finite element model
of
a body. Prior to the
proce
ss
of generating the mesh, each
part
of
the body may
be
further decomposed into regions in which a given meshing
scheme may
be
applied. Having adjacency
inf
onnation among
the elements allows the student to perform local discretization
efficientl
y.
Representing the results
of
finite element
analy
ses
can
also be made more efficient
if
adjacency information is
available. For example, representing tensions along a line is
much faster
if
the neighbors
of
each element are known.
Another instance
in
which a planar subdivision must be
specified is in the process of
crea
ting a geographical map.
Many times one studies the behavior
of
a certain variable
(e.g., mean income) through thematic maps, in which each
region is assigned a color
or
pattern accordi
ng
to
the value
of
that variable.
Many
packages have the capability
of
producing
such
map
s, provided that a list
of
polygons representing the
201
regions is available. These packages usually have a library
co
ntaining the description
of
common
regions (e.g., all
counties
in
the U.S.). However, they provide
no
means to
create a
new
map. Separate digitalization
of
each region is not
a good
so
lution, since
it
may
cause inconsistencies at the
boundaries
of
adjacent regions.
The
desirable tool is one that
allows the
map
to be
"dr
awn" in a natural
way
(that is, each
line is entered only once), automatically keeping track of
the
regions being created.
The
problem of creating
and
maintaining a planar
subdivision relates to the so-called "Boundary Representation"
approach
in
Solid Modeling. Such method
of
representation
stores a description
of
the adjacency relationships
amo
ng the
topological elements of a solid (vertices, edges, and faces).
In
the case that the solid
is
topologically equivalent
to
a
sphere, the data structure which represents the boundary
of
the
solid is a
planar
graph, i.e
.,
a s ubdivision
of
the plane in
regions,
wh
ich are bowided
by
edges, which are bounded by
vertices. Hence, the tool for creating a plan
ar
subdivision
can
be
seen
as
a special case
of
a solid modeler, in which the
geometry is simpler.
This work
de
scribes
an
implementation of a modeler
which is
able
to
maintain
the
structure
of
a planar graph.
2.
Topological
data
st
ructure
s
The
basic
idea
to represent planar subdivisions is to recognize
that one
must
deal both with the geometry
and
the topology
of
the subdivision.
The
geometric description has to do with
the actual location
of
the geometric objects: point coordinates,
curve equations, etc.
The
topological
de
scription is
combinatorial
in
nature and sees the plan
ar
subdivision as
defined
by
a hierarchy
of
topological elements: faces, edges
and
vertices. Each region
of
the subdivision determines a face.
The boundary common to two adjacent faces is
fo
rmed by
edges, which are bounded by vertices. Figure I shows a planar
subdivision and
th
e topologic
al
elements of the corresponding
planar graph. Note that the external Tegion is also considered
to
be
a face.
e2
Figure I - A
planar
subdivision and its topological elements
The combinatorial nature
of
the topological de
sc
ription
makes
it
mu
ch
easier to deal with than the geometric
description.
In
particular, giv•n the
li
st of all adjacencies
among the topological elements
of
a certain subdivision, one
can check, in a straightforward way, w
he
th
er they are
consistent (i.e., whether there is
so
me pl
anar
subdivision
having that adjacency structure).
Th
e geometric consisten
cy
is, in general much
hardt
.r to verify, since
it
has
to
deal with
location of points relatively to curves, curve intersections and
other problems that, in general, may involve numerical
dif
fi
culties.
A topological approach to represent a planar subdivision
consists in storing in a
data
structure its topological clements,
together with
th
eir adjacency relationships.
The
structure is
built and modified
in
such a
way
to guarantee topological
consistency
at
all times.
This
is achieved
by
ensuring that
ar.y changes to the
data
structure are made through a sma
ll
se
t
of
procedures - call
ed
Eule
r
operators,
sin
ce
they maintain
the validity
of
the
Euler
re
la
tion for the planar graph -that
preserve topological consistency. This discipline has also the
advantage of providing a natural layered structure to the
software. Since the higher-level procedures only access the
data structure through
Euler
operators, the actual organization
of
the
data
structure
is
transparent to these higher-level
procedures. Any changes in the
data
structure only requ
ir
e the
Euler Operators
(and
query routines) to be rewritten.
We
re
fe
r
the reader
to
Mantyla (1988) or
We
iler (1985) for a discussion
on Euler operators.
It
should
be
stressed
that
the u
se
of
a topological
approach, in itself, does not guarantee the overall consistency
of
a structure representing a planar subdivision. In practical
applications,
this
structure will be defined
by
geometric
operations (for example, a u
se
r m
ay
specify a
new
curve that
mu
st be added to the subdivision) and hence the syst
em
will
have to deal with geometric consistency as well.
How
ever,
the use
of
the t
opo
logical approach allows one to isolate the
problems involving geometry
(and
hence floating point
-computations) and treat these problems separately.
3.
The
face-
ed
g e da
ta
structure
The
need to represent the topology of the boundary
of
a solid
was first recognized
by
Baumgart, who proposed the winged-
edge
data
structure (Baumgart 1975).
Ot
her structures were
proposed
by
several authors (Mantyla
198
2, Weiler 1986). In
the current implementation the face.;,dge data structure,
introduced
by
Weiler, is used.
As
their names
imp
ly, both the winged-edge and the face-
edge
data
structures r
ely
on edges as the basic topological
ent
ities. But they use different approaches to deal with
orientation information.
The
purpose of a topological
data
structure is to represent
the
adjacencies among the elements in
such a
way
that questions such as
"w
hich are the regions
which contain a given vertex
on
their boundaries?" can be
answered efficiently.
In
or
der
for this
to
happen it is not
en
ough
to
store the fact that a certain edge e connecting
vertices v 1 and
v2
is on the
bo
undary
of
a certain face f. The
structure should contain
mo
re explicit information, such as:
when traversing e from v 1 to v 2. face f is on its left.
Th
e winged-edge structure represents each edge as
an
ordered
pair
of vertices and associates with
it
the faces which
are on the right and on the left with respect to that orientation.
The
face-edge structure deals with orientation
by
adding two
new
topological elements: ed
ge
u
ses
and
loop
s.
202
A loop is a connected, o
ri
ented boundary
of
a single face.
Loops are oriented
in
a consiste
nt
way: all external loops are
oriented clockwi
se
and all internal loops are oriented
counterclockwise (the face corresponding to the external region
can
be
seen as having only internal loops). Figure 2 shows a
planar
su
bdivision in which there are 3 faces and 4 loops.
loop 4
f3
Figure 2 - Faces and l
oo
ps
Each loop
is
stored as a sequence
of
edgeuses. The
terminology edgeuse
ref
ers to the
f~ct
that the same edge may
be
used
by
more
th
an one loop to close boundaries
of
faces.
In
the planar subdivision
cas
e an edge has e
xa
ctly
tw
o
edgeuses.
The
edgeuse topological element is sometimes
called half-edge, referring
to
the f
ac
t
that
an
edge is shared
by
exactly
two
faces, i.e, bas
two
si
de
s
or
halves.
lliere
arc
several advantages of the face-edge structure (or
any
structure
exp
lici
tly
storing each use of
an
edge) over
the
winged-edge structure.
The
face-
edge
strucrure
is
mo
re
general
and
is
able
to d
ea
l
with
gra
phs
co
ntaining selfloops (edges
having coincident endpoints)
and
multiple edges
(s
everal edges
having the
same
endpoints). Al
so,
Weiler
(Weiler 1988)
shows that one can
ge
neralize
the
face-edge
data
structure
in
such a
way
to
obtain
a new strucrure -
the
radial-edge
data
Model
structure -
whi
ch
is
able
to
repr
ese
nt
general
subd
ivi
sions
of
the
3-dimensional space.
figure
3 describes
the
hierarchy
of
the face-edge da
ta
structure.
Th
e
edg
euse
ent
i
ty
c
ontains
mos
t
of
the
topol
og
i
ca
l
information
co
ntent
of
the
da
ta
structure.
The
data
associa
ted
with each edgeuse is
shown
in
Figure 4.
Each
edgeuse
po
in
ts
to its loop, to its predece
ssor
and
its successor in
the
l
oop,
to
i
ts
starting vertex
and
to
its
mate
(i.e.,
the
edgeuse
which
shares the
same
ed
ge). M ost adjacency queri
es
(edge-edge,
face-face, edge-face)
access
th
is entity.
Doubly linked list
of
faces
on
she
ll
Vertex
Doubly linked list
of
loops
on
f
ace
Pointers to clockwise
and
counterclockwise
edgeuses
on
loop
figure
3 -
Th
e Face-edge
data
structure
mat
eeu
eu_mate 4
Doubly
linked list
of
all
ed
ges
in
model
Vertices
Dou
bly
linked
li
st
of all verti
ces
in
mode
l
starting
vertex
•
~
--'-
1 _________
_.
f_ parentedge
/leu_cx:w
f
"""
leu_
cw
l
oo
p
Figure 4 -
Th
e edgeuse topological element.
203
4.
Geometrical
attributes
Topological structures,
as
described in
the
previous section,
store
only
the
adjacency relations
hip
s among
the
basic
topological elements.
In
order
to
com
pl
ete
ly
define a planar
subdivision
one
mu
st
attach
geometrical
inf
ormation about
these elements.
In
a
more
general way, encb element
may
have some extra in.formation, or
attributes,
associated with
it. Besides geometric
data
, such
as
coordinates
or
curve
equations, these
may
include physical
data,
such
as
stiffness
and
density,
or
other
descript
ive
data,
such
as
the
name
of
the
material corresponding to a
give
n region.
This
is
achieved
by
inclu
di
ng
a pointer
to
the
block
of
attributes
of
each
t.opological
element
.
The
actual
or
ganization
of
this
block will
depend
on
the specific application.
Most
geometric
information
about.
the
planar
subdivision ·
is
concentrated
on
the
edges.
The
simplest
case
is
the
one
in
which
all
edges
are
straight line segments. In
this
case the edge
geometry
is
complete
ly
determined
by
it
s endpoint.s. Jn
the
case
the
edge is another curve,
some
extra
information
(s
uch
as
the
equation
of
the
curve)
must
be given.
This
implementation follows a procedural, object-orient.ed
approach.
The
system
only
needs
to
know
the
geometry
of
a
given edge
in
orde
r
to
perform
basic
geometric tasks, such
as
displaying
the
edge
or
det
erm
ining whether a g
iv
en
point
belongs to
the
edge.
Thus
,
if
the
attribute block associated
with
each
edge
contains pointers
to
the functions
which
are
capable
to
perform
the
basic geometric lllsks,
the
higher level
procedures
can
deal
with
all
types
of
edges
in
exactly
the
same
way. Whenever a geometric operation
has
to
be
performed,
the
procedure pointed
to
by
the
edge itself is called. Also,
if
one
wishes
to
introduce a
new
kind
of
edge,
it
suffices to write
the
standard
procedures
to
handle
that
particular geometry.
The
standard functions associated
with
each
edge are:
•
Display
function
• Bounding box function (returns
the
minimum
and
maximum
coordinates
of
point.son the
edge
,
in
order
to
compute
the
bounding
box
of
a
face)
• Intersection function (returns
the
number
of
times a
given
ray
intersects
tha
t edge;
in
order
to determine
whether
a
point
lies
on
a
given
face
it
suffices
to
count
the
tolal
number
of
times a
ray
starting
at
the
point intersects the edges that bound
the face).
•
Proximity
function (
de
termines
if
a
point
is
close enough
to
an
edge
to
be
considered belonging
to
that
edge).
• Sector
area
function (returns the signed
area
between
the
chord
and
the
arc corresponding
to
an
edge; it is
used
to
determine
wheth
er a l
oop
has
clockwise
or
cowiterclockwise
orientation).
Other
fWlctions can be
added
to
compute other integral
geometrical properties,
such
as
m
ome
nt
of
inertia
of
regions,
which
may
be
Rquired
for specific application
s.
These
area
integrals
can
be
evalualed
as
line integrals (i.e.,
as
edge-based
fWlctions)
using
Green's theorem.
S.
The
implementation
The
system
was written
in
standard
C,
but
following, whenever
possible,
an
object-oriented approach,
as
described in
the
previous section. The software organization is given
in
figu
re
5.
User Interface
Intcnnediate
Opera
to
rs
~
Database
Figure 5 -Organization
of
the
software
The
lowest
le
ve
l is occupied
by
th
e database,
co
ntaining
the
topological
data
structure
and
the attributes of
eac
h element.
Access to
all
topological information is
done
through
Euler
operators
and
query routines.
The
procedures on
the
next level
deal
with
the
geometrical
aspects
of
the
subdivisio
n, such
as
d
etermi
ning
the
region
to
which a
given
point
belongs, checking whether a certain curve
lies
on
a single region, etc.
The
user
interface will depend,
of
course,
on
the
specific
ap
pli
ca
ti
on.
From
the
point
of
view
of
the
planar
subdivision,
however,
all
request.s from
the
user can be
summarized
into
the
following:
• given a
new
candida!e edge, given
by
its geometric
description, cbeck whether it can be added to the
data
structure
without violating geometric
and
topological consistency;
•given
an
edge
in
th
e
data
structure, eliminate
this
edge,
carrying
out
all
the
necessary changes.
The
role
of
intermediate level procedures
is
to
carry
out
those actions,
by
translating
them
into
appropriate
calls
to
geometric
and
Euler
operators. Essentially, a
new
edge can
be
added to
the
mod
el
if
it
is completely
con
tained in a single face.
A series
of
geometric t
ests
have
to
performed
to
check
this
condition. Once
this
condition
is
verified
the
newly created
edge bas
to
be properly placed
in
the
database,
which
is
done
through
the
appropriate
Euler
operators.
6.
Application
•
to
mesh
generation
for
finite
element
analysis
In finite element analysis, a
planar
body
is studied
by
subdividing
it
into
a
number
of
simp
le cells (or e lements),
usually
triangles
or
quadrilaterals.
These
cells define a
planar
subdivision. Typical
systems
describe
the
mesh
as
a list
of
204
vertex
(or
node) coordinates, followed
by
a list
of
all
elements,
each containing the list
of
its vertices. This infonnation is
sufficient
to
build
the
matrices which are required for the
analysis. However, this approach is not appropriate for
interactive programs.
If
a certain region
of
the body under
study needs
to
be
remesbed, all the work bas
to
be done from
scratch.
The planar subdivision modeler described before was used
to develop
an
interactive mesh generator. The user can define a
planar body, decompose
it
into regions, specify which regions
of
this body
are
to be meshed, and which meshing techniques
are
to
be
used for
each
region.
Once
some kind
of
analysis
is
carried
out
for the model, a post-processor
can
take advantage
of
the
same
data structure to allow the
user
to visualize results
also
in
a interactive manner. Therefore, taking advantage
of
the
adjacency information results
in
improvement both
in
the
modeling process and in
the
scientific visualization
of
the
results.
It
is
hoped that this
Will
result both
in
a better
learning tool for the
novice
finite element user and
in
a
powerful production tool for the experienced user.
Another situation where
it
is
very important to be able to
change the mesh used to
study
a certain problem arises
in
fracture mechanics. Finite element analysis is used
to
predict
the behavior
of
cracks.
But
once the
crack
propagates, the
geometry
of
the body changes and
the
mesh bas to be modified.
Having
the
topological information
on
the current mesh allows
the
new
mesh to
be
generated in a local manner, making
propagation analysis
much
more efficient.
When
using planar subdivisions to represent finite element
meshes,
it
is
useful
to
look
at
a model
as
described
by
an
hierarchy
of
four
topological models
as
shown
in
Figure 6.
Each
model
can
be
seen
as
a refinement
of
the b.igher level
models.
The
topmost level -the geometry model -corresponds to
the geometric description
of
the
object
to
be
studied. Different
regions in this model correspond to different material types
or
to holes
in
the object.
The
several regions
of
the geometric model
may
be further
subdivided
into
subregions for analysis purposes. Each
subregion
may
be
meshed independently
of
the others. The
subregion model contains the planar subdivision induced
by
these subregions.
The
subdivision model
bas
exactly the
same
faces
as
the
subregion model.
But
the
subregion edges
are
subdivided into a
number
of
subdivision edges. These determine the nodes along
the
boundaly
of
each
region for
the
finite element mesh.
Finally, the mesh model contains the actual mesh. Once
each subregion is defined
and
a subdivis!on
of
their edges
is
specified, a mesb.ing scheme
can
be
automatically applied to
each
subregion.
Figure 7 shows
an
example
of
a planar
body
and
the four
corresponding models. This hierarchical structure
is
implemented
by
adding appropriate upPointers and down-
pointers
to
each
topological element.
An
element downpointer
al
ways points to
an
element
of
the
same
type
at
the
next
lower
le
ve
l.
An
uppointer points
to
an
element
of
equal
or
higher
dimension
at
the
next higher level. These pointers
are
used
by
the system to ensure the hierarchy defined
by
the
models:
any
change at a certain level
can
only
be
done
if
it
is
consistent
With
the higher levels.
On
the
other
hand,
changes
on
higher
205
Geometry
Model
Subregion
Model
Edge Subdivision
Model
Mesh
Model
Figure 6 - Hierarchical models
level models
Will
automatically affect the corresponding lower
level elements.
7.
Applications
to
map
making
The goal here
was
to provide
an
environment
in
which
maps
(as
described in
the
introduction) could be created
in
a
"natural" way.
When
creating a
map
by
hand,
one
simply
draws the lines which form the boundaries
of
the several
regions.
For
the present purposes
we
will assume that those
lines consist
of
a sequence
of
line segments.
This
creates a set
of
closed polygons, some
of
which share common boundaries.
An
important point is
that,
when
draWing a
map
by
hand, these
common boundaries
are
drawn
only once.
For
this reason the
use
of
separate
polygons
to
represent the regions
is
ifladequate,
since this Will
not
guarantee the consistency
of
the
common
boundaries.
Some
systems solve th.is problem through post-
processing:
after
a
family
of
polygons describing the map
subdivision has been defined, the system tries
to
detect the
existence
of
irregular boundaries, correcting the individual
polygons
to
guarantee that adjacent regions do not overlap.
These systems, however, do not store any specific adjacency
information about the regions.
Here, the planar subdivision modeler
is
used
as
the
basis
for the
map
defining system.
One
characteristic
of
this
particular application
is
that,
in
this case, the piece
of
the
boundaly
which
is
common to
two
faces tend to be relatively
long sequences
of
lin
e segments.
Each
one
of
these
line
segments
can
be
considered to
be
a separate edge, but this
causes a waste
of
storage space, especially important for
implementations
in
microcomputers.
For
this reason,
intermediate segments and points along
an
edge receive a
special treatment
in
this
application.
0
(a)
Geometric model (b) Subregi
on
model
(c)
Edge subdi
vi
si
on
model (d) Mesh model
Fig
ure 7 - A pl
anar
body
and
t
he
four models associated with
it
This
specific implementation distinguishes between
topological vertices (those
which
are
required for t
he
topological description
of
the
structure)
and
intermediate
vertices.
The
attribute block
of
each edgeuse contains a
pointer to a l
in
k
ed
li
st
containing
the
intermediate vertices
associated
with
it. Also
the
edge standard procedures are
rewritten
to
deal
with
edges
which
are
po
lygonal lines.
The
main purpose
of
thi
s application is to allows
one
to
create
maps
which
can
then
be
used for
data
analysis and
visualization.
For
that
purpose,
the
program
is
able
to read
and
write a variety
of
map
formats, including that used
by
SAS.
These
formats
consist essen
tially
of
a list
of
po
l
ygons
representing
the
regions,
each
described
by
the
list
of
its
vertex coordinates.
Topology-
based
representations
of
maps
can also
be
very
useful for i
mp
l
ementing
Geographical Information Systems.
These are database managers capable to attach information to
geographical elements, which,
in
an
abstract way,
can
be
points,
li
n
es
or
regions.
The
ability to represent
and
detect
adjacency results
in
systems
which
are
able
to ensure
cons
isten
cy
of
the
maps
being
created
and
can respond more
quickly
to
queries
about
these elements.
206
8 .
Conclusion
There
are
several
instances
in
science ln
which
one
needs
an
intelligent
graphical
editor
,
which
not
only
allows one
to
create
separate
polygons
or
regions
but
which
is
also
capable
of
recognizing
(and
enforcing) adjacency relationships
among
those
region
s.
This
work
shows
how
to
use
topological
data
structures
to
build
systems
which
possess
this
capability
.
They
provide
better, interactive, consistency-<:becklng
ways
to
handle
problems
which
must
deal
with
planar
subdivisions.
Tbe
approach presented
here
can
be
extended
to
model
subdiv
isions
of
tbe
three
-
dim
ensional space.
Martha
( 1
989)
developed a boundary and finite element
modeling
system in
three-dimensions
based
on
tbe radial-edge data structure
introduced
by
Weiler
(1986).
Acknowledgements
Part
of
this
work
was
cond
uc
te
d
at
the
Program
of
Computer
Graphics
at
Cornell
Un
iversity.
Special
thanks
are
due
to
Paul
'Wash'
Wawrzynek. Partial financial
suppo
rt
was
provided
by
CNPq-Brazil through fellowships
lo
the
first
and
third authors.
207
References
Baumgart,
B.
G.,
"A
Polyhedron
Representation for
Computer
Vision,"
AFIPS
Proc.,
44,
589
-
596
(1975).
Mantyla,
M.
and
Sul
onen,
R.,
"GWB:
A Solid
Modeler
with
Euler
Operators,"
IEEE
Comput. Graph. Appl.,
2,
17-31
(1982)
.
Mantyla,
M.,
An
Introduction
to
So
lid
Modeling,
Computer
Scien
ce
Press, Rockville,
Maryland,
1988.
Martha,
L.
F.,
"Topological
and
Geometrical
Modeling
Approach
to
Numerical Discretizalion
and
Arbitrary
Fracture
Simulation
in
Three-Dimensions
,"
Ph.D.
Dissertation, Cornell
Univer
sity, I
thaca,
NY,
1989.
Weiler,
K.,
"Edge
-Based
Data
Structures for
So
l
id
Modeling
in
Curved-Surface Environments,"
IEEE
Comput.
Graph.
Appl
., 5,
21-40
(1985)
.
Weiler,
K., "Topologi
cal
Structures for
Geometric
M
odeling,
"
Ph.D
.
Di
ssertation,
Rensselaer
Polytechnic
In
st
itute,
Troy,
NY,
1986.