Professional Documents
Culture Documents
1. INTRODUCTION
This chapter focuses on three computer-aided geometric design (CAGD) techniques that are often needed
to \prepare" a complex geometry for grid generation. Standard grid generation methods, as discussed in
[George '91], [Knupp & Steinberg '93], and [Thompson et al. '85], assume that parametric surfaces are well
parametrized and free of undesired discontinuities. We describe CAGD techniques that are extremely helpful
for the preparation of complex geometries for the grid generation process.
Surface renement and reparametrization. One problem that has plagued most grid generation
systems is that poorly parametrized surfaces create a poorly distributed grid. This is due to the fact
that the grid distributions are performed in the parametric domain and then mapped back to physical
space. It is desirable that the parametrization re
ect the geometry of the surface in physical space, i.e., the
parametrization should mimic the surface in physical space. The more a distribution of points in parametric
space resembles the corresponding distribution of points in physical space the better the parametrization
is. Imagine using a uniform parametrization on a sample of points that are not distributed evenly; if one
distributes points evenly in parameter space, they are not uniform in physical space. There are ways to
achieve a uniform distribution in physical space, but most approaches are based on iterative procedures.
To eliminate the need for such iteration procedures, a chord length parametrization can be used { it best
represents the surface in physical space.
Approximation of discontinuous geometries. Grid generation is concerned with discretizing surfaces and surrounding volumes in three-dimensional (3D) space { in this context, it is important that a given
geometry is continuous. Before one can generate grids for geometries containing discontinuities, one must
approximate the geometry by a set of surface patches which are continuous. The most common problems
y
(CIPIC)
z NSF Engineering Research Center for Computational Field Simulation, Mississippi State University,
P.O. Box 9627, Mississippi State, MS 39762-9627, USA; e-mail: brian@erc.msstate.edu
+ Partnership for Research in Stereo Modeling (PRISM), Arizona State University, Tempe, AZ 852875106, USA; e-mail: razdan@asu.edu
are gaps between neighbor patches, surfaces with undesired intersections, and overlapping surfaces. We have
developed an interactive technique that can be used to approximate a faulty, i.e., discontinuous, geometry
by a continuous one. One obtains approximating surface patches by projecting local approximants, Coons
patches, onto the discontinuous geometry, see [Coons '74]. Each approximating surface patch is constructed
by specifying four boundary curves, computing a Coons patch interpolating the four curves, and projecting
the Coons patch onto the given geometry. In the end, one has replaced the entire geometry by a new set of
continuous surface patches.
Surface-surface intersection. Accurate computation of surface-surface intersection (SSI) curves is
essential in many engineering applications including numerical grid generation. SSI curves represent important features that must be captured by the grid. These curves are typically used to trim surfaces; for
example, the location where an airplane wing meets the fuselage would be given in terms of the intersection
of the wing and the fuselage. Often, geometries dened in terms of standard data exchange formats either do
not contain the needed intersection curves, or the curves given in the le may not be in a form that is suitable
for the grid generator. A good SSI algorithm must be capable of treating analytic surfaces (e.g., cylinders,
cones, etc.), parametric surfaces (e.g., NURBS { non-uniform rational B-splines), surfaces described by discrete data points (e.g., resulting from stereo lithography, Plot3D surface grids, etc.), and combinations of
these types. Accuracy must be good enough for packing of grid points allowing high-aspect-ratio cells near
the intersection curves, which typically requires that the curves be accurate to at least 10 6 units. A good
method should be robust and should require a minimum of user input. A user should have to specify only
the surfaces to be intersected and the requested tolerance. Use in an interactive environment requires that
the method be reasonably fast, i.e., the solution of all but the most demanding problems should take only
a few seconds on a state-of-the-art workstation.
2. SURFACE REFINEMENT AND REPARAMETRIZATION
{ UNDERLYING PRINCIPLES AND BEST PRACTICES
The relationship between the parametrization and the control point net of a NURBS surface re
ects the
relationship between parameter space and range. Each Bezier segment of a curve, for example, may have
a normalized local parametrization (t; 0 t 1:0). However, there exists a global parametrization which
determines the relationship between each segment and the whole curve. The requirements for C 2 continuity
between two segments are that the second derivatives at the common break point should match { \from
the left and right." The notion of C r ; r 1 depends on the interplay between the domain and range
congurations. In other words, the rst and the second-order derivatives are dependent on the global
parametrization of a NURBS curve. As a rule of thumb, a better curve is obtained if the geometry (range) of
the NURBS curve is incorporated into the parametrization. Several parametrization schemes exist, such as
uniform, chord length, centripetal and one due to Nielson and Foley, see [Foley & Nielson '89]. Each scheme
has some favorable aspects, see [Foley '86, '87] for a detailed discussion.
2
In the context of grid generation, the grid can be smoothed to correct problems resulting from bad underlying parametrization, but this procedure is rather time-consuming. The other alternative is to reparametrize
the surface. The process does not change the geometry in physical space. Without going into the detail,
we state that reparametrization is independent of the degree of the rational-polynomial basis functions of
NURBS, see [Farin '95]. The reparametrization will then create a \smooth" parametric domain that will
promote high quality grids without jeopardizing accuracy.
The goal then is to rene a given, poorly parametrized surface, i.e., to construct a surface which is
chord length parametrized. A surface s(u; v) with knot sequence fu0; : : : ; uL+2n 2g and fv0 ; : : : ; vM +2m 2 g
is said to be chord length parametrized if it has the following properties:
ui
k s(ui+1 ; vj ) s(ui ; vj ) k
(1)
k s(ui 1 ; vj ) s(ui ; vj ) k ui 1
and
k s(ui ; vj+1 ) s(ui ; vj ) k
vi
(2)
k s(ui ; vj 1 ) s(ui ; vj ) k vi 1 ;
where
ui =
ui+1
ui ;
vi =
vi+1
vi ;
Yu and Soni, see [Yu & Soni '95], use reparametrization to create grids with dierent parameter distributions. The reparametrization in the curve case is achieved as follows: Let us consider a NURBS curve
with resolution n (number of points), and let
1. s1 (i); i = 1; :::; n; be the parametric values associated with the desired distribution of the curve in physical space and
2. s2 (i); i = 1; :::; n; be the normalized chord length of the curve evaluated at
parametric values s1(i); 1 = 1; :::; n.
The s2(i) values are known, and the s1(i) values are to be determined such that ks2(i) s1(i)k is minimized
for all i = 1; :::; n. This is accomplished by an iterative process. The initial values of s1(i) are set to be the
same as those at which s2(i) and s3(i) are evaluated. If the absolute dierence s2(i) s3(i) is smaller than
a certain tolerance, s1(i) is set as the desired parametric value. If the dierence of s2(i) s3(i) is negative
and the absolute value of this dierence is greater than the tolerance, s1(i) should be shifted to a value
between s1(i 1) and s1(i). The same strategy is applied to the case where s2(i) s3(i) is positive. In this
case, the value of s1 (i) should be shifted to a value between s1(i) and s1(i + 1). The algorithm is further
extended to deal with reparametrization of surfaces. Nevertheless, this approach cannot be used directly for
the reparametrization of surfaces, it leaves many questions open.
Kim, see [Kim '93], has attempted to come up with knot placement for NURBS interpolation. He
plots the distance between the interpolation points as a monotonically increasing function f (s) over its
parametrization. The parametrization is obtained from one of the several methods commonly used. The
function can be piecewise linear, piecewise rational-quadratic, or piecewise linear-rational B-spline interpolation. Knot placement is done by dividing the function space into equal number of segments and projecting
the division onto the parametric space. This is then used for determining the parametrization.
Approaches to solving the problem. Although many dierent approaches may be applied to solve
the problem at hand, the following two are considered:
1. Modify the control parameters of the given surface, with only minimal changes
to the surface, i.e., change weights, control points, etc., with the result that
the surface exhibits the property of chord length parametrization.
2. Construct a new NURBS surface which approximates the given surface, within
a given tolerance, such that the surface is chord length parametrized.
There are four design parameters available in the NURBS case
that control its behavior (it is assumed that the knot sequence does not have any multiplicities except at the
4
Modifying the existing surface.
ends); these are: degree, control points, weights associated with the control points (we will only deal with
the case wi > 0), and parametrization.
Raising (or lowering) the degree does not aect the parametrization and therefore is a non-issue in
our case. However, if one were to represent a NURBS curve with its approximation, the approximating
polynomial should be at least a cubic. This is due to the fact that cubics are the lowest degree which can
represent true space curves.
Modifying the control points modies the surface itself. It is very dicult to predict the behavior of the
surface when its control points are modied. Let us consider the curve case. Moving a control point means
aecting (degree 1) segments on each side. In order to not change the curve itself, the aected neighboring
segments would also have to be changed (by moving their control points). This can start a \chain reaction"
and convergence might be a problem.
Changing the weights is similar to changing the control points. However, in conjunction with the
parametrization, it is possible to keep the curve or surface the same. Thus, it would be a matter of nding
the new parametrization (the desired one), and we could possibly change the poorly parametrized curve to
a chord length parametrized one without changing the curve itself. Here, the problem is to nd the desired
knot sequences themselves. This approach, although theoretically appealing, requires as input something
that is not known. This rst approach, though ideal, does not always result in a convergent solution.
The surface approximation scheme. The second approach is to nd another surface as close
as possible to the original surface. Let Emax be the value which indicates the maximum Euclidean distance the two surfaces are apart from each other. If s(u; v) is the given surface with knot sequence
fu0; : : : ; uM g; fv0; : : : ; uN g, and r(u; v) with knot sequence fu0; : : : ; uK g; fv0 ; : : : ; uLg is the approximation
to the surface, then we want:
max fminfks(ui; vj )
(3)
where r(uk ; vl) is the closest point on r(u; v) for a given point s(ui; vj ) on s(u; v) and is the Emax bound
placed on the healing process.
This approach is used in [Razdan '95] to solve the problem at hand. The approximation is based on
the assumption that adequate points can be found on the surface, such that when an interpolating surface
is passed through them, the resulting surface will be very close to the original surface. The problem then
reduces to nding these interpolation points. If, however, the number of points is insucient, then the
error estimation process identies the point s(ui; vj ) on s(u; v) where the maximum deviation, Emax, occurs
between s and r. This information can be used to insert a knot in surface r such that r is now forced to
interpolate to s(ui ; vj ).
The construction of the new surface is a two-step process. First, the four boundary curves are determined, then the interior is lled. The reason for tackling the boundary curves rst is twofold. The boundary
curves provide the spatial bounds to the lling process. Second, it works out well to ll using the outside-in
5
approach. All computations are based on how well the surface is discretized. We have found that surface
evaluation at a density of 10 10 points per knot segment is sucient.
Boundary curve approximation. Approximation of the boundary curves is the rst step towards
approximating the surface. Each boundary curve is treated individually. The steps for approximating a
NURBS curve are:
1. Estimate the number of interpolation points needed.
2. Find interpolation points on the given curve (while keeping such points to a
reasonable number).
3. Pass a C 2 -continuous interpolating NURBS curve through these points.
The technique for choosing interpolation points uses arc length and curvature distribution characteristics
of the given curve. It also uses the adaptive knot selection scheme to properly place the knots on the
interpolating curve. Details on how this is done can be found in [Razdan '95]. The underlying principle is to
capture as much of the geometric properties of the original curve as possible while trying to keep the number
of interpolation points to a minimum. Figure 1 is an example of a NURBS curve and its approximation
using this technique.
The next step in the process is to combine information (parametrization) of opposite boundary curves into one. Although the interpolation points required to describe each
of the two boundary curves independently are available, the distribution of these points will not, in general,
be satisfactorily represented by a common knot sequence (parametrization). This is due to the fact that the
distributions of points in each set depends on the individual curves' curvature and arc length distributions.
Choosing a knot sequence of either one of the boundary curves will result in the same initial problem.
However, if somehow both curves and the interior surface did have the same distribution of interpolation
points, a single parametrization could be used without a problem. But at this time the interior interpolation
points are not xed. This is dealt with as follows. First, a reconciliation process of the opposite boundary
curves is performed to resolve the inequitable interpolation points distribution on the two boundary curves.
This ensures that the knot sequences computed after the reconciliation step of the opposite boundary curves
will be the same. Two knot sequences result, one for each parametric direction of the approximated surface.
Second, the interior interpolation points on the surface are located such that they satisfy the parametrizations
in both directions that resulted from the reconciliation process.
We describe brie
y the reconciliation process between boundary curves. The distance (arc length)
between neighboring interpolation points of one boundary curve is computed and tabulated. The same is
done for its counterpart, the opposite boundary curve. Next, distances in each set are represented as the
fraction of the total arc length of the respective curves. Once the two sets are compiled, they are reconciled.
For every point in one set, a corresponding point is sought in the second set (and vice-versa) that is the same
fraction of distance away from the starting end of the curve it belongs to. If there is no such point within a
tolerance, then an auxiliary point is inserted into the set that does not have the point. At the end of this
process, both sets have points that are similarly distributed along the length of the original boundary curves.
Similarity in distribution means that the ratio of distances between the neighboring points is similar in the
two sets. In other words, we have inserted auxiliary knots into the curves so that both curves have the right
distribution of knots or points for interpolation. This in turn is nothing but chord length parametrization.
This process is applied to the other set of opposite boundary curves. The set of interpolation points is
now xed for all four boundary curves. Figures 2 and 3 show two sets of interpolation points before and
after the reconciliation process. This process of adaptively generating knot sequences based on curvature
information and arc length (chord length) is called the RCA parametrization (Reconciled Curvature Arc
length parametrization).
Finding an interpolating surface.
2,2
2,1
1,2
1,1
2,2
2,1
u
1,1
1,2
whether a particular choice (point location on the surface) is good or bad, is done based on a penalty factor.
A high penalty factor means \not good." The penalty factors of all the interior points are computed and
sorted in descending order. The point with highest penalty factor is tackled rst, since it is most likely to
be moved. The algorithm keeps track of points moved in an iteration in a two-dimensional array. In the
iterative process, a point is a candidate for relocation if any of its four neighbors have moved since the last
iteration. In the case when none of the four neighbors have moved, then local conditions have not changed
and repeating the process will not improve the situation. On the other hand, if the local conditions have
changed, i.e., one or more of the neighbors has moved since the last iteration, then it is likely that the current
point is not the optimum point any more. Thus, it makes sense to apply the algorithm again. The iterative
process is terminated when all the points occupy optimum positions. Figure 5 shows an example before and
after this procedure is applied.
11
The essential procedure used to approximate a geometry is the construction of a single local approximant.
This procedure consists of these steps:
1. Creating four (or selecting four existing) curves as boundary curves for an
initial local approximant (Coons patch)
2. Constructing a bilinear Coons patch from the four boundary curves
3. Projecting a curvilinear grid on the Coons patch onto the original geometry
4. Determining \articial projections" for those points in the curvilinear mesh
that cannot be projected { due to possible gaps in the original surface
5. Interpolating the points resulting from steps 3 and 4
One has to perform step 1 interactively, while all other steps can be performed without user interaction.
The local surface approximant obtained as the result of this procedure is a bicubic B-spline surface, which
is guaranteed to lie within a certain distance of the original surfaces. The distance measure is based on
shortest (perpendicular) distances between points on an approximant and the original surfaces. We compute
this distance measure only in regions where there is a \clear" correspondence between an approximant and
the original surfaces and do not compute it for those parts of an approximant covering a discontinuity.
Once all local approximants are determined and their topology (connectivity) is known, a nal step
ensures that the overall resulting approximation is continuous by enforcing continuity along shared boundary
curves of the local approximants.
The methods that we rely on to approximate a discontinuous geometry are covered in great detail in the
literature dealing with CAGD methods for curves and surfaces. References include [Farin '95, '97], [Faux &
Pratt '79], [Piegl '91a, '91b], and [Piegl & Tiller '96].
3.2. Computing the initial Coons patch
The initial local approximant is used to smooth rough data, guide the choices of interpolation points, and
serve as a reference for lling in gaps. A user has to specify four continuous curves whose end points meet
to form a single closed curve { the boundary of a Coons patch. The four boundary curves can span across
multiple original surface patches; they can even be above or below the given geometry.
In order to obtain a reasonable surface grid for the Coons patch implied by the four boundary curves,
we use a discrete Coons patch construction. First, we compute points on the boundary curves distributed
13
uniformly with respect to arc length. We then associate parameter values (uI;0; vI;0); (uI;N ; vI;N ); (u0;J ; v0;J );
and (uM;J ; vM;J ); I = 0; :::; M , J = 0; :::; N , dening the uniformly distributed points on the boundary curves
in 3D Euclidean space. The points xI;J = (xI;J ; yI;J ; zI;J ) on the discrete Coons patch are thus dened as
xI;J = [ (1 uI;J ) uI;J ] x0;J + [ xI;0 xI;N ] (1 vI;J )
[(1
uI;J
uI;J
xM;J
vI;J
x0;0 x0;N (1 vI;J ) ;
xM;0 xM;N
vI;J
(4)
where uI;J ; J = 0; :::; N; varies linearly between uI;0 and uI;N and vI;J ; I = 0; :::; M; varies linearly between
v0;J and vM;J ; respectively. In general, the points xI;J do not lie on the given surface patches.
3.3. Projecting the Coons patch onto the original surfaces
In order to project each point xI;J on the Coons patch onto the original surfaces one must know the
approximate surface normal at xI;J , which is used as projection direction. We approximate the unit normal
vector at xI;J by
(x
xI 1;J ) (xI;J +1 xI;J 1 )
(5)
nI;J I +1;J
(x
x
) (x
x
) :
I +1;J
1;J
I;J +1
I;J
The points xI;J ; their associated normal vectors nI;J ; and an absolute oset distance d dene points on an
upper and a lower oset surface of the initial Coons approximant. The points on the upper oset surface
are denoted by aI;J and the ones on the lower oset surface by bI;J :
aI;J
xI;J + d nI;J
and
bI;J
xI;J
d nI;J :
(6)
We relate the oset distance d to the extension of the Coons patch by setting
1 jjxM;0 x0;0jj + jjxM;N xM;0jj + jjx0;N xM;N jj + jjx0;0 x0;N jj:
d =
(7)
8
The choice of d is very important, since it determines the set of original surfaces to be considered for the nal
local approximation. It is not clear at this point what is the best value for d given an arbitrary geometry.
The oset surface construction is shown in Figure 6.
14
x 0, N
a I,J
x M, N
n I,J
x I,J
x 0,0
x M, 0
b I,J
15
bounding box
Due to existing discontinuities, gaps, in the original surfaces the projection strategy might not yield any
intersection points for certain line segments aI;J bI;J . We must estimate \articial projections" to obtain a
complete (M +1) (N +1) array of points required later in the construction of a local B-spline approximant.
We use a bivariate scattered data approximation technique, called Hardy's reciprocal multiquadric method,
see [Franke '82].
Each intersection point pI;J , obtained by intersecting line segment aI;J bI;J with the surface triangles,
can be written as a linear combination of aI;J and bI;J ; i.e.,
pI;J = p(tI;J ) = (1 tI;J ) aI;J + tI;J bI;J ;
tI;J 2 [0; 1]:
(10)
The values tI;J are computed (and stored) when projecting points on the surface triangulation. These
values remain unchanged, even if intersection points are mapped onto the real parametric surfaces. Hardy's
reciprocal multiquadric method is used to compute a bivariate function t(u; v) that interpolates all parameter
values tI;J corresponding to intersection points that have been found. We must consider these conditions:
tI;J
= t(uI;J ; vI;J ) =
j 2f0;:::;N g i2f0;:::;M g
ci;j R
+ (uI;J
I
) + (vI;J
ui;j 2
2 f0; :::; M g;
vi;j 2
(11)
2 f0; :::; N g;
where R and
are xed parameters and only those values tI;J ; uI;J ; ui;j ; vI;J ; and vi;j are considered for
which an intersection point has been found. Denoting the \mean parameter spacing" in the two parameter
directions by u = 1=2M PMI=0(uI +1;0 uI;0) + (uI +1;N uI;N ) and v = 1=2N PNJ=0 (v0;J +1 v0;J ) +
(vM;J +1 vM;J ); we have found that the values R = 0:5(u + v ) and
= 0:001 yield good results. Further
investigation is necessary regarding appropriate choices for these parameters.
This global approach, considering all projections that have been found, is generally too inecient.
Therefore, we localize Hardy's reciprocal method by considering only a relatively small number of found
projections to determine an \articial projection." If there is no intersection between a line segment aI;J bI;J
and the surface triangulations, we use the K closest found projections. For this purpose, we identify the K
found projections whose associated index tuples are closest to the index tuple (I; J ). We have found that
values for K between ve and ten yield good projection estimates. Thus, one has to solve the linear system
tk
K
X
i=1
ci R
+ (uk
ui 2
) + (vk
vi 2
= 1; :::; K;
(12)
where (uk ; vk ) and (ui; vi ) are parameter values for which projections are known. One must solve such a
linear system for each missing projection.
Having determined parameter values tI;J for all line segments aI;J bI;J for which no projections are
known, we obtain each needed \articial projection" as the linear combination
zI;J = (1 tI;J ) aI;J + tI;J bI;J :
(13)
17
The union of all points yI;J and zI;J denes an (M + 1) (N + 1) curvilinear mesh which we use for the
construction of a local B-spline surface approximant.
3.5. Constructing a local surface approximant
We use the (M + 1) (N + 1) points yI;J and zI;J to dene a cubic B-spline surface interpolating these
points and locally approximating the given surfaces. We denote this B-spline surface as
s(u; v)
n X
m
X
j =0 i=0
(14)
where di;j is a B-spline control point, Ni4(u) and Nj4(v) are the normalized B-spline basis functions of order
four, and m = 3M and n = 3N . The (normalized) knot vectors are dened by values i (i < i+1 ) and j
(j < j+1 ) and have quadruple knots at both ends and triple knots in the interior, i.e.,
u
v
(15)
For more details regarding B-splines, see, e.g., [Bartels et al. '87], [Farin '97], and [Piegl & Tiller '96]. Here,
we are using the indexing scheme used in [Bartels et al. '87]. We are currently using a uniform knot spacing,
i.e., i = i=M and j = j=N .
Our construction yields local B-spline approximants degenerating to C 1 -continuous, piecewise bicubic
Bezier surfaces. The control points di;j are derived by rst using a C 1 cubic interpolation scheme for all
rows and columns of points to be interpolated and, second, applying C 1 continuity conditions to obtain the
four interior Bezier control points of each bicubic patch constituting a single B-spline approximant. The
interior Bezier control points of all bicubic patches are dened by the equations
d3i1;3j+1
d3i1;3j 1
=
=
d3i1;3j + d3i;3j+1
d3i1;3j + d3i;3j 1
d3i;3j
d3i;3j :
and
(16)
Roughly speaking, the error between a locally approximating B-spline surface s(u; v) and the given geometry
is the maximum of the minimum distances between points on the approximant and the original geometry.
The existence of discontinuities and overlapping surfaces in the given geometry makes a precise denition of
error impossible. We estimate the maximum distance by a discrete error measure. We use the points
eI;J
fI;J
gI;J
=
=
=
18
to compute this discrete error measure. An approximating B-spline surface most likely has its greatest
deviation from the given geometry in the interior of its constituting bicubic Bezier patches due to the
oscillation characteristics of bicubic spline surfaces.
We compute shortest (perpendicular) distances between points on the B-spline approximants and the
original surfaces by solving the implied bivariate minimization problem to identify closest points. We do
not compute shortest distances for all points eI;J ; fI:J ; and gI;J ; whenever one of these points is associated
with a gap in the given geometry we do not compute a closest point for it. If the resulting error estimate
is too large for a particular B-spline approximant, the resolution parameters M and N are increased and a
new B-spline approximant is computed. In principle, there is no guarantee that this process will converge
for arbitrary geometries. Therefore, this iteration is terminated when a maximum resolution is reached. In
practice, however, one does not have to worry about this problem as long as the user species a \reasonable"
set of boundary curves for the initial Coons patch that is projected onto the geometry.
3.7. Connecting the local B-spline approximants
Topologically, all B-spline approximants are four-sided entities that can have at most four neighbors. Two
B-spline surfaces are neighbors when they share a common boundary curve. Bifurcations (more than two
surfaces sharing the same boundary curve) in the set of all B-spline approximants are not allowed. In
summary, the B-spline approximants must satisfy these topological conditions:
Each boundary curve is shared by at most two B-spline approximants.
A corner point of a B-spline approximant can be common to any number of
approximants.
If a corner point of B-spline approximant is shared by a second approximant
then this point is also a corner point of the second approximant (full-face
interface property).
All B-spline approximants used in the nal approximation must be compatible, i.e., they must be
bicubic B-spline surfaces, must have the same number of control points, and must have the same knots along
common boundary curves. For an arbitrary conguration, this implies that one must use one global number
of control points in both parameter directions, one global knot vector used in both parameter directions,
and one global order.
However, it is sucient for practical grid generation purposes to know the connectivity among all B-spline
approximants and to know that the distance between two neighbor B-spline approximants is smaller than
some predened tolerance. In this context, a distance is implied for two neighbor B-spline approximants by
the physically existing gap between the two distinct boundary curves that, topologically, dene the common
boundary. As long as the gaps between all neighbor B-spline approximants are negligible, then one can use
19
them directly for the generation of a mesh. In the context of mesh generation, we must emphasize that an
initial mesh is generated for the set of approximating B-spline surfaces and that this mesh is nally projected
onto the original surfaces { unless an initial mesh point is in a gap region of the given geometry.
The conditions that must be satised by the B-spline approximants in order to obtain an overall tangent
plane continuous approximation, also called gradient-continuous approximation, are described in [Faux &
Pratt '79]. Essentially, the conditions are coplanarity conditions for certain B-spline control points along
shared boundary curves and around shared corner points of B-spline approximants.
This approximation scheme for the \repair" of discontinuous geometries is explained in much more detail
in [Hamann '94] and [Hamann & Jean '94, '96].
3.8. Examples
Figures 8 through 11 show single B-spline surfaces approximating various geometries with discontinuities.
One can see that the approximating surfaces are lying partially above and partially below the original surfaces.
The approximating B-spline surfaces were obtained by specifying combinations of points and curves on the
original geometries. Figures 8 and 9 show the line segments used to obtain sample points.
20
Figures 12 and 13 show real-world geometries and their approximations (car body and aircraft conguration). Both gures show the original surfaces (top) and their approximations (bottom) consisting of
multiple B-spline surfaces.
4. SURFACE-SURFACE INTERSECTION
{ UNDERLYING PRINCIPLES AND BEST PRACTICES
A good surface-surface intersection (SSI) algorithm should have the following characteristics:
Accuracy. Grid generation for problems with high-gradient regions (such as
viscous
uid
ow) require a high degree of precision; a good algorithm must
yield precise results.
Simplicity. The only action required by the user should be the specication
At present, no single algorithm possesses all of these properties. This is due to the fact that an optimal
algorithm for a particular intersection problem depends on the type of surfaces involved. For example, the
intersection of two planes is a line, while the intersection of two quadrics can be a curve of degree four. The
representation of the surfaces must also be considered (i.e., implicit, polyhedral, or parametric). The reader
can nd a good survey of several types of intersection algorithms in [Hoschek & Lasser '93].
The intersection algorithm. The SSI algorithm we are describing can operate on surface triangulations, on analytically dened surfaces such as NURBS, or combinations thereof, see [Jean & Hamann '98]. If
the intersection is performed on surface triangulations, then the renement step described below is skipped,
and the piecewise linear curve produced from the intersection of triangles is the end result. If an analytical
surface description is known for one or both of the surfaces involved then the renement step is included.
Surface triangulations are frequently encountered in the form of unstructured surface grids and are rapidly
becoming a standard for data exchange using the StereoLithography format (see [3D Systems, Inc. '89]).
These are the basic steps of the algorithm:
1. Triangulate the surfaces to be intersected.
2. Store each triangulation in a space partitioning tree structure.
3. Intersect the trees to obtain a list of intersecting regions.
4. Intersect the individual triangles within each set of intersecting regions to obtain a collection of line segments.
24
mismatches due to numerical error. A separate list of associated uv parameter values and uv connectivity
(connectivity in parameter space) is maintained to allow renement of the calculated intersection curves.
Triangle intersection. The rst step in the intersection process is to intersect the triangulations of
the two surfaces being considered. The result of this process will be a set of line segments which, when
arranged properly, will provide a piecewise linear approximation to the intersection curves. The end points
of the line segments will be used later as an initial guess for the sample points on the true intersection curves.
The line segment information is used to determine the topology of the intersection curves and to order the
sample points on the curves.
The method intersects two triangles by rst performing a bounding box test to see if there is the
possibility of the triangles intersecting. If this test is passed, then the edges of the rst triangle are intersected
with the plane dened by the second triangle and vice versa. The points resulting from the edge-plane
intersections are then tested to determine if they lie inside the respective triangles. Figure 15 illustrates the
test which determines whether a point lies inside a triangle. If the area of each of the subtriangles shown is
positive then the point is inside the triangle.
3. Two unique points are found, i.e., the intersection is a line segment.
The SSI method only considers intersections which result in line segments.
Intersection preprocessing using a tree structure. The number of triangles needed to represent
a surface may be quite large. The bounding box test discussed above is very fast. However, each triangle
of the rst surface must be compared with each triangle of the second surface. If steps were not taken to
reduce the number of comparisons, this step would dominate the running time of the algorithm. There is a
need to eciently cull triangles which will not be involved in the intersection process. This is achieved by
storing the triangles in a tree structure. The tree partitions the space occupied by the triangles and provides
quick access to the set of triangles which inhabit a particular region. The tree type we use is a k-d tree (see
[Samet '90] and [Bentley '75]). Given N triangles, the k-d tree will have at most 2N nodes with N leaf
nodes, each containing exactly one triangle. A node is composed of a bounding box and an integer tag. The
bounding box is specied by two points in space and is just large enough to contain the bounding boxes of
all its children; the bounding box of a leaf node is just large enough to contain its associated triangle. We
use a tag for leaf nodes to identify the triangle which is contained in the leaf.
A separate tree is constructed for each surface. One tree is chosen { it does not matter which one { as
the base tree and the remaining tree is referred to as the target. The two trees are intersected as follows:
1. Pick a leaf node in the base tree.
2. Intersect base leaf with target tree using recursive bounding box tests.
3. Associate each base leaf with each target leaf that intersects it. If the base leaf
does not intersect any target leaf then the base leaf is not considered.
4. Repeat this procedure for each leaf in the base tree.
The result of the intersection is a set of associations which encompass all possible triangle intersections
for the given surfaces. Note that target leaves may be associated with multiple base leaves. However, each
base leaf appears only once. This relationship is depicted in Figure 16. Note that a two-dimensional quadtree
is used to simplify the gure. The k-d tree is a binary tree and can be searched in logarithmic time. Hence,
for two surfaces represented by M and N triangles, the tree intersection can be performed in M log2 (N )
time.
27
28
7. If the number of PointUses associated with the present Point is two, step to
the other PointUse associated with the Point (PointUse!next) and go to step
4; otherwise, continue below.
8. Store the ordered list of sample points for renement.
9. Repeat.
Should this algorithm terminate and leave certain Segments unused, then one or more of the intersection
curves are closed. Closed curves are a special case and are treated separately. Closed curves are found by
picking a random starting PointUse from the remaining \unused" PointUses and proceeding with the same
basic algorithm. The dierence is that the algorithm terminates when the curve is traced back to its starting
point.
Renement. Once all possible curves have been traced, the result is an ordered set of sample points
for each intersection curve. In general, these points lie on the triangulation, or, to be more specic, on the
piecewise linear surface approximations, but not on the exact analytical surface. The renement procedure
described below maps the points to the surfaces and matches them, within a given tolerance, to the \true"
intersection.
P 3 + S(u 3,v 3)
d3
A2
A1
r
d1
d2
A3
P 1 + S(u 1,v 1)
P 2 + S(u 2,v 2)
Figure 18. Stencil of data required to obtain intersection point on exact surface.
The rst step in the renement process is the mapping of the intersection points onto each surface.
Each intersection point on the triangulation has references to the triangles containing it. Figure 18 shows
30
the stencil of data required to map a point r (inside a triangle) to the exact underlying surface. The procedure
to do this follows these steps:
1. Find vectors d1, d2, and d3 emanating from r and stopping at the respective
triangle vertices P1, P2, and P3 .
2. Calculate the sub-triangle areas A1, A2, and A3 .
3. Normalize the sub-triangle areas by dividing Ai by the total triangle area A1 +
A2 + A3 .
4. The normalized sub-triangle areas Ai are the barycentric coordinates of r with
respect to the original triangle dened by P1 , P2 , and P3 . Denoting
the
P3
P3
parameter values of Pi by (ui ; vi ), we compute i=1 Ai ui; i=1 Ai vi , which
is the parameter value that we use to compute a point on the exact surface
replacing r.
Fn
x
p0
Fp
r(w, t)
q0
Fq
s(u, v)
31
1. Denote the two \images" of r on the two underlying parametric surfaces s(u; v)
and r(w; t) by q0 and p0; let p0 = s(u0; v0) and q0 = r(w0 ; t0), where u0, v0,
w0 , and t0 are the associated parameter values.
2. Calculate the unit normals np and nq at p0 and q0.
3. Let Fp and Fq be the tangent planes at p0 and q0.
4. Calculate the distance values dp and dq for the distances between Fp (Fq ) and
the origin:
dp = np r(w0 ; t0 );
dq = nq s(u0 ; v0 ):
(18)
5. Construct a plane Fn which is orthogonal to both Fp and Fq and passes through
p0 . The unit normal nn of Fn and its distance from the origin dn are:
np nq
jjnp nq jj ;
(19)
= nn r(w0 ; t0 ):
(20)
nn =
dn
32
7. The point x must be mapped back to the exact surfaces and new points p0 and
q0 calculated. We compute the dierence vectors p0 = x p0 and q0 = x q0
and compute the values
and
rw = rw np;
rt = rt np
(22)
su = su nq ;
sv = sv nq ;
(23)
where rw , rt, su, and sv are the partial derivative vectors (not normalized)
at p0 and q0 . Considering that for innitesimally small increments the two
equations rw w + rtt = p0 and suu + sv v = q0 hold, we can compute the
increments for the parameter values as
rt p0 ; t = rw p0 ;
w =
(24)
rt rw
rw rt
sv q0 ; v = su q0 :
(25)
u =
sv su
su sv
The updated values of p0 and q0 are thus given by
p0 = r(w0 + w; t0 + t);
q0 = s(u0 + u; v0 + v):
(26)
Convergence of this method is very good, even for \poor" initial values of p0 and q0. The curve dened
by the triangle intersections may or may not meet the requested tolerance. Intersection points can be added
or deleted as necessary. Additional intersection points are obtained using the renement algorithm with
starting points based on the known intersection points. The nal representation of the curve depends on
the requirements of a particular application. Common representations are piecewise linear or cubic curve
representations in physical and/or parameter space.
5. RESEARCH ISSUES AND SUMMARY
In conclusion, we summarize the presented techniques, describe possible improvements, and point out remaining research issues.
Surface renement and reparametrization. We have given techniques for rening the parametrization of a NURBS surface. The surface approximation method performs best when the interior surface geometry more or less follows the geometry of the boundary curves. Future work could be directed at the analysis
33
of geodesic curvature distribution of isoparametric curves on the surface and using it as an interrogation
tool. Data reduction is another research issue. In some cases, this is achieved as a side eect. Torsion
characteristics of the boundary curves are not exploited. Torsion could be incorporated into the scheme in
the same way as curvature and arc length to nd \key interpolation points" where torsion may be a factor.
Approximation of discontinuous geometries. The interactive method for the approximation of
discontinuous geometries allows the \replacement" of entire 3D geometries while preserving original boundary
curves of given surfaces, if so desired. The method can be used to approximate geometries with gaps,
transverse surface overlaps, and undesired surface intersections. The nal approximation is a set of bicubic
B-spline surfaces determining an overall continuous surface approximation { with negligible gaps between
neighbor B-spline surfaces. One should explore whether it is possible to reduce the required user input
further, i.e., whether one can construct local approximants automatically without having a user specify the
boundary curves of the initial Coons approximants. Currently, the resulting B-spline surfaces approximating
the given discontinuous geometry are stored as NURBS surfaces { with all control point weights being one.
Choosing control point weights in a more \clever way" might allow to generate equally good approximants
with fewer control points.
Surface-surface intersection. The SSI algorithm discussed above is only one of many possible approaches to solving this dicult problem. The advantages of this algorithm are its speed and accuracy and
the ability to operate automatically. The method relies on triangles which are locally planar approximations
to the underlying surface; therefore, the algorithm can have diculties when resolving intersection curve
topologies near critical points, where critical points occur when the normals of both intersecting surfaces are
exactly or nearly collinear. In the region around critical points, the intersection of the surface triangulations
may not accurately re
ect the intersection of the underlying surfaces, hence causing the algorithm to fail.
6. ACKNOWLEDGMENTS
This work was supported by the National Grid Project consortium and the National Science Foundation
under contract EEC-8907070 to Mississippi State University. Special thanks go to all members of the research
and development team of the National Grid Project, which was performed at the NSF Engineering Research
Center for Computational Field Simulation, Mississippi State University. Part of the work was carried out
by the CAGD research group at Arizona State University.
34
7. REFERENCES
Anderson, J., Khamayseh, A. and Jean, B. A. (1997), Adaptive resolution renement, Technical Report, Los
Alamos National Laboratory, Los Alamos, NM.
Bartels, R. H., Beatty, J. C. and Barsky, B. A. (1987), An Introduction to Splines for Use in Computer
Graphics and Geometric Modeling, Morgan Kaufmann Publishers, Inc., Los Altos, CA.
Bentley, J. (1975), Multidimensional binary search trees used for associative searching, Communications of
the ACM 18(9).
Coons, S. A. (1974), Surface patches and B-spline curves, in: Barnhill, R. E. and Riesenfeld, R. F., eds.,
Computer Aided Geometric Design, Academic Press, San Diego, CA, pp. 1{16.
Crampin, M., Guifo R. and Read, G. A. (1985), Linear approximation of curves with bounded curvature
and a data reduction algorithm, Computer Aided Design 17(6), pp. 257{261.
Farin, G. (1995), NURB Curves and Surfaces, A K Peters, Ltd., Wellesley, MA.
Farin, G. (1997), Curves and Surfaces for Computer Aided Geometric Design, fourth edition, Academic
Press, San Diego, CA.
Faux, I. D. and Pratt, M. J. (1979), Computational Geometry for Design and Manufacture, Ellis Horwood
Publishers, Ltd., New York, NY.
Foley, T. (1986), Local control of interval tension using weighted splines, Computer Aided Geometric Design
3(4), pp. 225{230.
Foley, T. (1987), Interpolation with interval and point tension controls using cubic weighted -splines, ACM
Trans. on Math. Software 13(1), pp. 68{96.
Foley T. and Nielson G. M. (1989), A survey of applications of an ane invariant norm, in: Lyche, T. and
Schumaker, L. L., eds., Mathematical Methods in Computer Aided Geometric Design, Academic Press,
San Diego, CA, pp. 445{467.
Franke, R. (1982), Scattered data interpolation: Tests of some methods, Math. Comp. 38, pp. 181{200.
Fuhr, R. D. and Kallay, M. (1982), Monotone linear rational spline interpolation, Computer Aided Geometric
Design 9, pp. 313{319.
George, P. L. (1991), Automatic Mesh Generation, Wiley & Sons, New York, NY.
Hamann, B. (1994), Construction of B-spline approximations for use in numerical grid generation, Applied
Mathematics and Computation 65(1{3), pp. 295{314.
Hamann, B. and Jean, B. A. (1994), Interactive techniques for correcting CAD/CAM data, in: Weatherill,
N. P., Eiseman, P. R., Hauser, J. and Thompson, J. F., eds., Numerical Grid Generation in Computational
Fluid Dynamics and Related Fields, Pineridge Press Ltd., Swansea, U.K., pp. 317{328.
Hamann, B. and Jean, B. A. (1996), Interactive surface correction based on a local approximation scheme,
Computer Aided Geometric Design 13(4), pp. 351{368.
Hosaka, M. (1992), Modeling of Curves and Surfaces in CAD/CAM, Springer-Verlag, New York, NY.
Hoschek, J. and Lasser, D. (1993), Fundamentals of Computer Aided Geometric Design, A K Peters, Ltd.,
Wellesley, MA.
Jean, B. A. and Hamann, B. (1998), An ecient surface-surface intersection algorithm based on surface
triangulations and space partitioning trees, to appear in Mathematical Engineering in Industry.
Kim, T.-W. (1993), Knot placement for NURB interpolation, M.S. thesis, Department of Computer Science
and Engineering, Arizona State University, Tempe, AZ.
Knupp, P. M. and Steinberg, S. (1993), Fundamentals of Grid Generation, CRC Press, Boca Raton, FL.
Piegl, L. A. (1991a), On NURBS: A survey, IEEE Computer Graphics and Applications 11(1), pp. 55{71.
Piegl, L. A. (1991b), Rational B-spline curves and surfaces for CAD and graphics, in: Rogers, D. F. and
Earnshaw, R. A., eds., State of the Art in Computer Graphics, Springer-Verlag, New York, NY, pp. 225{
269.
Piegl, L. A. and Tiller, W. (1996), The NURBS Book, second edition, Springer-Verlag, New York, NY.
Samet, H (1990), The Design and Analysis of Spatial Data Structures, Addison Wesley, New York, NY.
Thompson, J. F., Warsi, Z. U. A. and Mastin, C. W. (1985), Numerical Grid Generation, North-Holland,
New York, NY.
3D Systems, Inc. (1989), StereoLithography Interface Specication.
Yu, T. and Soni, B. K. (1995), Application of NURBS in numerical grid generation, Computer Aided Design
27, pp. 147{157.
35
8. FURTHER INFORMATION
The following journals, magazines, and conference proceedings frequently cover topics related to the problems
discussed in this chapter: Computer-Aided Design (ELSEVIER), Computer Aided Geometric Design (ELSEVIER), Journal of Computational Physics (Academic Press), Transactions on Graphics (ACM), Transactions on Visualization and Computer Graphics (IEEE), The Visual Computer (Springer-Verlag), Computer Graphics and Applications (IEEE), SIGGRAPH proceedings (ACM), and Supercomputing proceedings
(ACM/IEEE). In addition, the SIAM Conference on Geometric Design, which is organized every other year,
is an excellent source of information.
36