Segal 1985
Segal 1985
Mark &gal
Carlo H. Sequin
Computer Science Division
Department of Electrical Engineering and Computer Sciences
University of California, Berkeley*
Msrch, 1984
Algorithms for computer graphics or solids modeling must often infer the struc-
ture of geometrical objects from numerical data. Unavoidable errors (due to limited
precision) affect the calculations from which these data are produced and may thus
affect topological information so derived. Ambiguities or even contradictions may
result from inferences made from an object’s representation.
To resolve these akbiguities for arbitrary polyhedral objects, we introduce a
minimum feature size and a face thickness and show how to convert any object
description into a form which insures topological immunity to numerical perturbs
tions. The minimum feature sise depends on the object’s overall dimensions and on
its placement in space. The face thickness depends on how well a face’s vertices con-
form to its computed plane.
1. INTRODUCTION
Programs in computer graphics or solids
modeling often need to infer the topology of
objects from their geometrical description
based on numerical data. For instance, one
might want to kndw whether two bricks such
as those depicted in Figure 1 touch or inter-
sect. One way to determine the answer is to
&
Fire 1. A situation prone to inauwistent repreaenta-
*This work was supported in part by the Semicon- It ion du: numerical inaccuracy y /
ductor Research Cooperative under grant number
SRC-821 l-008. examine the two neighboring faces and investi-
gate whether the top face of brick A and the
bottom face of brick B intersect. The algo=
rithm to do that may hrst try to determine
whether the two faces are parallel and then
determine their relative ordering in apace, or
else look for the line of intersection between
the planes of the two faces. Parallelism
between the two faces may be determined from
29
a comparison of their face normal vectors. boundaries.
However, because of the limited precision The vertices, edges, and faces are primi-
of the face normals, exact componentwise tivca; a collection of faces forms an 06jcct. A
equality of these vectors is too strict a test, and repreaenlation is a data structure which con-
planes that are parallel may not be recognized tains geometric information about a set of
as such. Furthermore, planes that are slightly objects.
out of alignment may lead to an ill-conditioned Topological information is derived from
intersection line computation, resulting in little such a description through tests that determine
or no accuracy. on which side of a face a certain vertex lies. In
On the other hand, we may create incon- particular we would like to know in an unam-
sistencies if we set some arbitrary tolerance for biguous manner whether a point lies ‘below’,
the range of orientations that we consider ‘on’, or ‘above’ a particular oriented plane.*
parallel. Upon examining the two critical faces The results of such tests should be invari-
of the two bricks, we might conclude that they ant under basic object transformations (rota-
are parallel within some accepted tolerance, tion, scaling, and translation) ao that the rel;lr
and are ordered in such a way that the bricks tive position of a point with respect to a plane
do not intersect. But upon examination of does not depend on the coordinate frame in
another pair of faces, e.g. the right face of which the determination is made. Complex
brick A and the bottom face of B, we find that objects are often built from sets of simpler
the bricks do seem to intersect. objects; in thi; context the topology of an
This example illustrates the problems we object must remain llxed when placed in
must overcome when computing topological different coordinate frames.
information from geometrical data. Geometri- Other object representations face similar
cal information based on numerical data is requirements. A CSG approach which specifies
prone to perturbations. However, topological objects through boolean operations on half-
information about an object requires absolute spaces3 depends equally critically on the
answers. numerical accuracy of the coefficients of the
We examine the source and effect of plane equations.
numerical errors in geometrical descriptions.
We then describe an approach that leads to 2.2. Consolidation
topologically consistent object descriptions. To overcome these difficulties we intro
This approach prevents topological changes duce explicit tolerances for edges and faces.
under certain classes of transformations and/or We begin by examining the two-dimensional
notifies the user when such topological changes problem of determining whether a vertex lies
are likely to occur. ‘to the left’, ‘on’, or ‘to the right’ of an edge
(See Figure 2).
2. NUMERICAL INACCURACIES In this context, we introduce a tolerance
for an edge so that all points within a small
2.1. Consistent Repreaentstionr strip around the edge are considered as lying
In computer graphics, geometrical objects ‘on’ it. The half-width of this region is
are often specified with a boundary representa- “small”; its size is set to the machine floating
tion.* A common approgrh is to define a set of point precision.
. .
vertices numerIca!!y by their coordinates in This method has one flaw: vertices close
apace, then specify a set of linear edges with
to the tolerance area may be moved inside it
the vertices as endpoints, and finally define Therefore,
through object transformations.
planar faces through the edges that form their vertices which do not lie ‘on’ an edge must
30
determination of the final vertex and edge posi-
tions has to be done exactly once from some
h
global point of view. An algorithm that
achieves this result makes use of a virtual
square grid, with spacing p, that covers the
plane.
First, vertices and portions of edges that
may require alteration are marked: a vertex is
marked if it is closer than (fi+l)c( to an edge
not passing through the vertex or if it is within
(fi+l)p of another vertex; each ed e is
Figure 2. An edge, its three regions, and the minimum marked at regions that lie closer than ( $ 2+l)p
feature size. to another edge or vertex.
maintain a minimum separation from it. The Next, marked items are forced onto the
separation must be large enough so that the virtual grid by replacing any marked edge
vertices never creep onto or across an edge regions with horizontal or vertical segments of
under reasonable transformations. We call this the p-spaced grid. As a result, a marked
separation distance the minimum /coture size, region’s endpoints will fall onto the closest grid
or ~1,of the representation. point. Any marked vertex is also forced to the
nearest grid point, carrying attached edges
In such a representation any small region
with it.
of space of radius p contains at most one ver-
tex, and any edge intersection is marked by a The result is a consolidation of the origi-
vertex, thus guaranteeing unambiguous top nal representation with minimum feature size
logical tests. In contrast, a representation p. The maximum perturbation of any single
which does not maintain a minimum feature primitive is (Ji/2 since no vertex is shifted
size may have arbitrarily many vertices in an by more than ( P 2/2)c(. Thus the maximum
arbitrarily small region of space, and the smal- separation of any two primitives changes by at
lest numerical inaccuracies may cause topologi- most I/&.L explaining why all vertices or edge
cal changes. portions within (fi+l)p of another primitive
were marked.
An arbitrary geometrical object descrip
tion can be converted into a consistent This method can be extended to perform
representation with a specified minimum vertex-edge consolidation in three dimensions.
feature size. We call this conversion a consoli- A three dimensional grid is used, insuring the
dation. All features which are within a dis- maximum perturbation of a single primitive is
tance of p of one another must either be no more than (&/2)~. Otherwise, the algo=
merged or pulled apart so that distinct primi- rithm is essentially the same as in the twe
tives are separated by at least /.J. Where edges dimensional case. If the representation con-
cross, they must be broken into two parts and tains faces as well as vertices and edges, a few
the pieces joined in a single vertex acting as more steps are required; these are outlined in
the intersection point. Similarly if a vertex section 3.2.
comes too close to an edge, the vertex must be One difficulty with this algorithm is that
pulled away, or the edge must be split so that it may introduce subdivision where none is
the vertex can be put ‘on’ the original edge. necessary. One solution is to add a second pass
If such consolidation steps are carried out that replaces edge segments with a direct edge
iteratively on an edge by edge basis, later steps where subdivison turns out to be superfluous.
may undo the work of earlier ones. Thus the However, this method would approximately
31
double the total work required for consolida- P(V’) - rP(v’-p’)
tion. An algorithm which recognizes more pre- GA”’
cisely where subdivision will not be required with n” = and p’=Ap+t.
IllPA-‘ll
should save considerable computation; such We wish to determine how large l(v) must be
algorithms are currently under investigation. to insure that its sign and that of V(v’) are the
aame - for then w’ lies in the same region of I’
2.3. Coordinate Transformationa asudasofI.
To determine an appropriate minimum Observe that
feature size, we must find the magnitude of the
perturbations a desired transformation may f(v) - I’(v’)ile=A-‘11
introduce. Conversely, given a minimum in exact arithmetic. We compute
feature size, we would like to know if a partic-
ular transformation may destroy topological I J(l’(v’) I I n=A-’ 1I ]-ft[J(v)] I,
integrity. the difference in distance calculations carried
A line equation in R* is of the form out in the two coordinate systems. It can be
proven using facts about roundoff in matrix
w = rP(v-p),
computations4 that
32
where m’ and m are the transformed and to define a minimum feature size.
untransformed plane equations, respectively; n If a transformation is applied to an object
is the corresponding plane normal. whose minimum feature size is smaller than
that required for consistency, vertices and
2.4. Limiting the Erron edges will have to be reconsolidated to conform
The errors in equations (1) and (2) have to the larger value. Therefore, the set of
two components. The hrst term arises because transformations that do not require object
the resolution of a floating point representation reconsolidation before their application depend
of R* or Rs is different at different pointa. The on the magnitude of the minimum feature size.
resolution is finest near the origin. But far
from the origin, large exponents make the 2. PLANE EQUATIONS AND NON-
separation between representable points large. PLANAR FACES
Thus, if a tiny object defined about the origin
is translated far from the origin, loss of preci- 8.1. Thickneu
sion may seriously affect the relative positions Because a face may be defined by more
of its vertices, edges and faces. than three vertices, there is another type of
The second error component arises error that can cause inconsistent decisions
because if kdA) is large, then A “skews” an about the side of a face on which a vertex lies.
object to which it is applied, scaling different If a face has many defining vertices, they may
dimensions by different amounta. Skewing not lie in an exact plane. Even if the original
makes shrunken dimensions less significant vertices are exactly planar, calculations may
relative to unshrunken ones. perturb the coordinates. It may also be that
An orthogonal matrix is one for which planar faces are being used to approximate a
ATA = I. If A is orthogonal, then non-planar faced object.
IIA-~II, = kd~) = 1. These matrices A plane equation is the three dimensional
correspond to rotations in two or three dimen- analog of the line equation of the last section; a
sions. For pure rotations, the bound in (2) normal vector indicates the plane’s orientation,
reduces to 6(lltl12+lIvl12)u. If the area of while a point on the plane (or a ‘distance from
interest in which our representation will be the origin) indicates its position. These quantt
manipulated is bounded by a constant, v, then ties are subject to errors because the coo&
Iltll, 5 w and Ilvl12 5 w, and the error nates of the plane’s defining vertices may not
becomes no worse than 12wu. In this case, the satisfy its equation perfectly.
indicated minimum feature size is roughly u This analysis leads us to define an error
times the whole representation’s maximum region or tlrickncss for a face’8 plane. Points
dimension. in this region are deemed ‘on’ the plane (See
Similarly, if A is a uniform scaling, then Figure 3).
liA-‘11, = i and ks(A) = 1, where 8 is &he The distance error determines the width
of the region at the point on the plane closest
scaling factor. In this case the distance ,crror is to the origin. The orientation error deter-
no more than s(lltll,Js + Ilvll); this is also mines how fast the thickness grows away from
true for arbitrary rotations combined with uni- this minimum point. If there is no orientation
form scaling. error, the thickness is bounded on the top and
The allowed transformations determine a bottom by simple planes perpendicular to the
minimum feature size. h (1) shows, mrne computed face normal.
affine transformations can obliterate any The magnitude of the errora, aa well IM
object’s topology, since they do not permit us how they are split between orientation error
33
mulated. We can determine whether one face
Feature lies entirely within another face’s thickness,
sic but the faces’ computed orientations may be
Thickness A
quite different. Nevertheless, we shall deem
coplunar any pair of faces such that one face’s
vertices are completely contained in the thick-
ness of the other.
34
of vertices as the basic primitive9 that define within the previously determined
an object. At points where more than three thicknesses.
plane3 meet, calculation3 may lead to error3 in (4) Any vertex which lies closer than the
a vertex’s location, i.e its direction (correspond- desired c to 3ome face’s thickness is
ing to a plane’3 orientation) and distance from moved out of this zone by either pulling it
the origin. The vertex position3 computed away from the face or topologically merg-
from intersections of plane triplet9 may be ing it with the face. Since faces do not
averaged together and represented with a intersect and all face thicknesses enclose a
simple region in the form of a small sphere (a3 alab of width p or greater, the required
was done with the thickness for a face). Alter- vertex movement can be chosen so that it
natively least squares can be used if a more will not affect the thickness of any face in
accurate model is desired. which it already lies.
Step (4) will not perturb any vertex or edge by
3.2. Consolidation in Three Dimendons
more than JL, M) that the final separation
If a vertex land3 close to a face’s thick- between any pair of vertices or edges will be at
ness, it may land inside this region after least ~1. This method does not guarantee
transformation. Therefore, a consolidated minimum face thickness or any minimum per-
representation must have no vertices in the turbation of the original object. Minimizing
zone defined by the minimum feature site the individual face thicknesses is a problem in
around the face’s thickness. Since perturba- linear programming.
tions induced by clearing a p region around a
Because a face’3 thicknc33 is se&five to
face thickness may undermine an edge coruoli-
the plane equation computed from the defining
dation, the algorithm for consolidating a
vertices, it is best to compute a face equation
representation with faces is based on a
once, keep it with the face, and never recom-
minimum feature size larger than p:
pute it. If more vertices are added to the
(1) Perform edge consolidation in R” (as out face’s contour (or some deleted), the plane
lined in section 2.2) with a minimum equation should remain unaffected. If we were
feature size three times the desired final to reapply least squares or Newell’s algorithm
value. A value of 3~ is necessary because with the set of altered vertices, alight
of the existence of skewed line9 which differences in calculated orientation could
may move independently by a3 much a3 /J undermine previous attempta at maintaining
in step (4). thickness.
(2) Compute a thickness for every face. All
thicknesses must be made large enough to 4. PRACTICAL CONSIDERATIONS
enclose a slab of width 2c( centered If an object is to be rotated, scaled,
around the computed face; this restriction and/or translated, the transformation must
insures that step (4) is possible. first be checked using (1) or (2) to insure that
(3) Partition ‘any mutually intersecting face3 the error it may introduce doe3 not exceed the
into non-intersecting parts. Contour3 of a object’3 minimum feature size. If the possible
face coplanar with another must be cut error is too large, there are two alternatives.
apart along the edge3 of the other face. The 6rst is simply to disallow the transforma-
For pair3 of non-coplanar faces, contour3 tion. This solution is not a very practical one,
are cut by splitting them and adding new as it may severely limit a designer’s freedom to
edges along the intersection line of the place object3 in space. The second approach is
two faces. This step may add new ver- to first reconsolidate the object using a larger
tices to faces, but they will always lie minimum feature size, and then apply the
35
transformation. which lies in a fixed, local coordinate system.
Applied blindly, this approach may con- An inetonce of that definition is it’s placement
fuse a potential user of a graphics aystem that in another coordinate system. A transformi+
tries to maintain topological integrity. Sup tion specifies how the copy of the definition’s
pose a user is working with an object like that primitives art copied to the new coordinate
shown in Figure 6. The point “0” lies at the frame.
origin of the scent’s coordinatt apace. If the It is this copy which may have to be
object is translated far from the origin, the slightly altered if an ill-conditioned transformr+
point labeled “A” may have to be collapsed tion is applied. The original definition can
into or forced away from the tubular section remain unchanged., Therefore, if the instance
above it. If the user then moves the translated is returned to the origin, the user can retain
object back to the origin (perhaps implicitly by the object he had; the instance is restored from
changing his viewpoint), he might find that it the underlying definition.
has changed slightly. On the other hand, somt “transforma-
tions” art not simple placements but art mort
complicated dcformotione .‘I A deformation
may change an object’s geometry, but leaves
topological relationships unaltered. For
instance, the object in Figure 7 is obtained
from the ont in Figure 6 by stretching it across
the dashed lint. If the point “0” is left fixed
at the origin, and the stretching is severe, the
region around the point “A” may require con-
solidation leading to possible topological altera-
tion. Btcaust the instance transformations
implemented in modeting systems usually do
not have the generality of deformations, opera-
Figure 6. An object which may require topological al- tions like stretching must operate on an
teration if transformed. object’s definition. It follows that if a highly
deformed object is subsequently restored, topo=
logical differences from the original may result.
A deformation may destroy topological
integrity if any portion of the object
undergoes an effective transformation that, if
applied to the entire object, would introduce
an error greater than the minimum feature
size. The solution in this case is to warn the
user. He can then decide if he wishes to save a
copy of the original object so that he may
retrieve it in case he wishes his deformations
reversed. Further, the user can specify the
fyre 7. A simple delormation of the object in Figure
1. nature of the required changes, e.g. choose if
topological items are merged or pulled apart.
The distortions induced by multiple In an interactive system, it may not be
transformations are alleviated if a distinction is worth the added trouble to keep a consistent
made between an object’s definition and its representation. The checks required every
instantiation. A definition specifies an object
36
time an edge or vertex is moved may take con- Many of these ideas have been imple-
siderable time for complex objects. If the mented in a program that computes a boun-
interactive renderer is capable of displaying a dary representation for the intersection, union,
scene with topological anomolies, checking and or difference of two polyhedral objects from the
consolidation can be omitted. When the design boundary representations of those objects.9
is completed, a consolidating algorithm can be The program works well even in cases like that
run that “i&s” any topological ambiguities shown in Figure 1, and always produces the
the user may have introduced. Algorithms consolidated boundary of a solid object 85 long
which exploit object coherence for computa- as t.he two starting objects are solids presented
tional efficiency’,* can then be run on this as consolidated boundary representations.
filtered version. We plan to explore how these ideas
developed for polyhedra can be extended to
6. SUMMARY curves and surfaces. The basic idea is the
In many computer graphics or solids same: transformations can destroy information
modeling systems the internal object descrip about. where a point lies relative to a surface,
tions may be inconsistent. For instance, planar and a minimum separation must thus be main-
faces may be assumed, but if a face contour tained. The key question is how the error
has more than three vertices, these rarely lie in bounds can be determined for different surfaces
a perfect plane. The ambiguity in the plane and how they can be limited in a practical sys-
equation for such a face can introduce incon- tem.
sistent answers when the position of a point
has to be classified as lying ‘below’, ‘above’, or Referencer
‘on’ the plane of the face.
1. A. Baer, C. Eastman, and M. Henrion,
Even if the object description is com- “Geometric Modelling: A Survey,” CAD,
pletely consistent, numerical inaccuracies are vol. 11 (5), pp. 253-272, Sept. 1979.
introduced when the object is subjected to a
2. R.B. Tilove, “Set Membership Classifi-
general transform. These unavoidable calcula-
cation: A Unified Approach to Geometric
tion errors can destroy the consistency of the
Intersection Problems,” IEii!X ‘Itansae-
representation and alter topological relation-
lima on Computera, vol. C-29, pp. 874-
ships between vertices and faces.
883, Oct. 1980.
Our approach to these problems is to
3. A.A.G. Requicha, “Representations for
introduce a minimum feature size and to conso-
Rigid Solids: Theory, Methods, and Sys-
lidate the original object description. During
terns,” ACM Computing Surveys, vol. 12,
&solidation, any geometrical primitives lying
no. 2, December 1980.
within the minimum feature size of each other
are either merged or pulled apart. 4. G.H. Golub and C.F. Van Loan, Mat&c
Computcltions, Johns Hopkins, Baltimore,
A face is not represented as an infinitely
MD, 1983.
thin sheet; rather, it is a slab with a thickness
determined by the vertex deviations from its 5. W.M. Newman and R.F Sproull, “Plane
computed plane. Equations,” in fiinciplcs of Interactive
Computer Graphics, &ad Edition, p. 499,
Transformations applied to the object
McGraw-Hill, New York, 1979.
must be checked to insure that they maintain
the given minimum feature size. If a transfor- 6. G.T. Whyburn, Analytic Topology, Amer-
mation must be executed that does not meet ican Mathematical Society, Providence,
this error criterion, consolidation must be RI, 1942.
repeated.
37
7. G. Hamlin and C.W. Gear, “Raster-Scan
Hidden Surface Algorithm Techniques,”
Computer Graphica, vol. 11, no. 2, pp.
264-271, Summer 1977.
8. C.H. Sdquin and P.R. Wensley, “Visible
Feature Return at Object Resolution,” To
be published in IEEE CG B A, May
1985.
9. M. Segal, “Partitioning Intersecting
Polyhedra into Non-Intersecting Parts,”
In Preparation.
38