0% found this document useful (0 votes)
62 views10 pages

1988 - Rendering Trimmed NURBS With Adaptive Forward Differencing

Uploaded by

zxwx1111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views10 pages

1988 - Rendering Trimmed NURBS With Adaptive Forward Differencing

Uploaded by

zxwx1111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

~I~ Computer Graphics, Volume 22, Number 4, August 1988

Rendering Trimmed NURBS with Adaptive Forward


Differencing
Michael Shanrz and Sheue-Ling Chang

Sun Microsystems, Inc.


2500 Garcia Avenue
Mountain View, CA 94043

Abstract Introduction
Trimmed non-uniform rational B-splines have become a Several methods have been used previously for rendering
very useful surface representation form in the mechanical tr/mmed NURB surfaces. The de Boor Cox algorithm [4] is
CAD industry. Previous rendering methods use the de Boor frequently used for evaluating a B-spline curve or surface at
algorithm to evaluate the surface at equal increments in a particular point in parameter space. Also, subdivision
parameter space. This yields polygons which are then ren- techniques using knot insertion have been described by
dered. Alternatively the Oslo algorithm and Boehm's knot Boehm [2] and Cohen and others (the Oslo algorithrn)[6].
insertion algorithms are used in a subdivision approach. In The Oslo algorithm is capable of simultaneously inserting
this paper a new method is presented for rendering trimmed multiple knots in an efficient manner. A simple proof of the
NURB surfaces of arbitrary order using the adaptive forward Oslo Algorithm is given by Prautzsch[13], and a more
differencing (AFD) technique. This method extends the efficient way of using the Oslo algorithm is given by Lyehe
AFD technique to higher order, efficiently computes the and Morken[12]. Lee [10] gives an algorithm for evaluating
basis matrix for each span, calculates the shading approxi- the derivatives of a NURB at a point in parameter space by
mation functions for rational surfaces, and trims and image using knot insertion. Boehm [3] later derived a more
maps NURB surfaces. Trimming is accomplished by using efficient scheme for the simultaneous evaluation of all sur-
AFD to scan convert the trimming curves in parameter face derivatives at a point in parameter space.
space, thus producing the intersection points between the Nonuniform B-spline curves and surfaces can be rendered by
trim curves and an isoparametric curve across the surface. A tesselation to piecewise linear vectors or planar polygons by
winding rule is used to determine the regions bounded by the evaluating at intervals in parameter space. They may also be
curve which are then rendered with AFD. The method is subdivided to produce vector or polygon vertices or subdi-
suitable for both hardware and software implementations, vided to individual pixels. Each of these methods has cer-
however, higher order surfaces require very high precision tain drawbacks. Subdividing using knot insertion down to
due to the forward difference nature of the algorithm. the pixel level is very expensive. Piecewise planar methods,
while fast, yield lower quality renderings if done coarsely
and make image mapping and trimming more difficult.
CR Categories and Subject Descriptors: 1.3,3 [Computer The approach presented in this paper involves obtaining the
Graphics]: Picture/Image Generation - Display algorithms; functional description of each span by computing the basis
1.3.7 [Computer Graphics]: Three-dimensional Graphics function of the span, then rendering the span using the adap-
and Realism - Color, shading, shadowing, and texture. tive forward difference technique together with a Hermite
shading function approximation.
Additional Key Words and Phrases: image synthesis, shad- In this paper the AFD technique is extended to higher orders
ing, adaptive forward differencing, graphics VLSI, and used to evaluate the NURB surfaces and their associated
parametric surfaces, B-splines, NURBS. trimming curves incrementally. A recursive relation is
derived for obtaining the coefficients of the basis functions
for a given knot vector, and a method is given for computing
Permission to copy without fee all or part of this material is granted shading function approximations for a rational surface. AFD
provided that the copies are not made or distributed for direct is also used to evaluate the NURB trimming curves in
commercial advantage, the ACM copyright notice and the title of the parameter space "scanline" order to provide the parameter
publication and its date appear, and notice is given that copying is by bounds for rendering curves across the surface. Figure 3
permission of the Association for Computing Machinery. To copy shows a result produced with these techniques, an image of
otherwise, or to republish, requires a fee and/or specific permission.
trimmed NURB surfaces with image mapping and shading.

©1988 ACM-0-89791-275-6/88/008/0189 $00.75

189
/ SIGGRAPH '88, Atlanta, August 1-5, 1988

Summary of the AFD Technique


A previous paper[3] describes an adaptive forward differenc- The above linear operators can be applied to a cubic function
ing technique for rendering trimmed, image mapped, f (t) = aB 3(t )+bB z(t )+c.Bl(t)+dB o(t )
parametric surfaces. A similar technique for rendering
parametric surfaces was also proposed by Rockwood[4], tO transform f (t ) into f "(t ) = a "B3+b "B z+c "B t+d'B o.
which computes the minimum possible steps for each sur- The E transformation performs a forward step operation
face and then renders the surface with ordinary forward dif- f'(t)=f(t+l) :
ferencing. A brief comparison between the two techniques
and the error accumulation problem were mentioned in the
discussion section.
The AFD method unifies the processes of reeursive subdivi-
sion [1] and forward differencing [2] for curves and surfaces The L operator can reduce the step size by f ' ( t ) = f (t/2) :
in the R4 space (homogeneous coordinates x , y , z , w ) . A linear
substitution transforms a parametric function f ( t ) into
f ( a t + b ) or f ( s , t ) into f(as+b,ct+d). The geometric effect of _ 0 1/2-1,'8 1
linear substitution is to translate and scale a segment or patch [a :J - o° 1/4
"~igjO
within the curve or surface containing it. Any segment of a
curve can be mapped to any other segment of the same curve and the L -~ operator can double the step size by
by some linear substitution, and likewise for patches. Let L
be a linear substitution it2 and R be (t+l)/2. L and R are the
operators associated with recursive subdivision; they act on a
segment C to yield the "left" and "right" halves LC and RC
of C, see Figure 1. g is a linear substitution t+l, which acts
on a segment C to yield its "right neighbor" EC. The pro-
[!!ii!1
cess of applying a sequence of E operators to render a curve
segment is known as forward differencing. Extending AFD to Higher Order
The A F D technique can be generalized to arbitraryorder by
extending these matrices.
The forward difference matrix for one span of a NURB sur-
face of arbitrary order is given by
LC ~ RC
A = [FD] [DU] [CU] [P] [CV]r [DV] r [FD] r
where P is the matrix of control points for the given span of
the N U R B , CU and CV are the basis matrices in the u, v
LLC RLC E~ LRC___~. RRC directions defined by the u and v knot vectors, D U and D V
are the initial scaling matrices, FD is a matrix which con-
Figure 1. Relationship of linear substitutions L, R and E. verts polynomial basis (i.e. polynomial power series) into
forward difference basis, and A is the resulting forward
A disadvantage of forward differencing is that it may not difference matrix. The matrix A has v columns and u rows
traverse C with uniform velocity. Recarsive subdivision when the NURB surface has order u and v in the u and v
avoids this difficulty by stopping at different depths in dif- directions.
ferent parts of the recursion tree. The adaptive forward dif-
ferencing technique transfers this advantage of recursive 1. Computing NURB polynomial basis coefficients
subdivision to forward differencing by inserting an occa- The next major section will discuss a recursive method for
sional L or L-~ (the substitution 20 into the stream of E ' s obtaining the polynomial basis matrices CU and CV.
whenever the velocity is too great or too small respectively.
This has the effect of changing the level in the recursion tree 2. Initial scaling matrix
while forward-differencing across it. While any basis will
do for the AFD technique, the forward difference basis The DU and D V matrices are used to scale polynomial

Bo= 1, B 1= t, Bz= t t ~
2
..B, = t(t'71)(t-2) "'" (t-n+l)

is best suited. The forward step E, the adjust-down L, and


the adjust-up L -1 operators of this basis of order 4 are:
n!

DUff
[!ooo
coefficients in the u and v direction to the appropriate initial
forward step size. For nth order this matrix is simply

du 0 0
0 du 2 0
0 0 du ~
. .

, / 2 -1,'8 1 / | L-1 = The scaling matrix can be trivially extended to higher order
o 1/4 - l ~ j by filling in the jth diagonal elements with duJ, where du is
the amount of scaling.

190
~ ComputerGraphics,Volume22, Number4, August 1988

3. Converting polynomial to forward difference 5. The adjust down operation


T h e FD matrix converts from polynomial to forward differ- To decrease the distance between two consecutive curves, an
ence basis. For a cubic this is the well known matrix adjust down operation is performed on [A]. Let W be the
matrix which adjusts down the polynomial basis coefficients
° by half, i.e. w is a scaling matrix with a scaling factor of 0.5.

~1/2 0 0
W= 0 0 0
We note here that the F D matrix for higher order can be o 1/8
computed from an expression
a o + a l u ,-I- a 2 u 2 + ... + a d ud = The adjust-down operation is extended to higher order by
u... ( u - d + l ) L = [FD ] [W] [FD-~].
b ° + b l u +b2 + "'" +bd d!
where the [FD-I] matrix converts the forward difference
which relates a set of forward difference basis coefficients
coefficients into polynomial basis, the [W] matrix scales the
<b~> to the corresponding polynomial basis coefficients
polynomial coefficients by 0.5, and [FD] converts the scaled
<aj > :
result back into forward difference basis again. For order 5
b 0= a 0 the adjust down matrix is

'I'
b~ = Ig Ig(-lI~-~Cl k~ a~
j = l l *=O
1
J

where C~ i----L--
k !(i-k)t
arid d = degree Ii °°°
0
0
0
0
118
0
-3/32|
1/16 ]

Thus the elements in matrix FD can be defined as


6. The adjust up operation

[00000!j
i
FO~j= E(-1)~-~c~k j The adjust-up matrix can be similarly extended by
k=0

FD=
11000i]
For example the FD matrix for order 5 is

• 0l l t2 6 ,4
L-1= [FD I [UI [FD-1], where U = 00

[!ooo
00636
0002 To increase the distance between two curves the matrix A is
transformed by L-t. For order 5 the adjust up matrix is
The resulting forward difference matrix A can then be calcu-
lated by concatenating all the matrices appropriately.
210
A =[FD] [DUI [CU] [P] [CV]r [DV]r [FD] r L-I= 0 4 4
008
000163
4. The f o r w a r d step operation
Notice that above order 4 the adjust down matrix contains
The forward step operation [E] is mathematically a linear values which are not powers of two. Up to order nine, the
substitution of v + l for the parameter v. Practically it is used elements can all be represented as the sum of two powers of
to advance from the current curve to the next or from the two.
current pixel to the next. This operation can be extended
trivially to higher order. In the forward difference basis a
forward step is performed for all coefficients by adding the
i+l coefficient to the ith coefficient Thus the [E] matrix can Obtaining NURB basis functions
be generalized as Trimmed NURBS have become a useful surface representa-
E i j = 1 if i=j or j=i+l, otherwise 0 tion form in the MCAD industry[l]. Uniform splines have
constant basis functions throughout the spans, i.e. the basis
The forward step matrix for nth order is matrix is the same for all spans. Non-uniform splines
instead have a different basis function for each span defined
I,°° 101 .., oil recursively by a knot vector. A B-spline curve is a piece-
wise polynomial curve

. . . . 0 f ( ~ ) = E p~M(")
i

where the coefficients P i of the B-spline functions Nik(u) are


called control points or de Boor points. The functions N~(u)

191
/ SIGGRAPH '88, Atlanta, August 1-5, 1988

are piecewise polynomial of order k defined over a knot vec- Rational Shading Approximation
tor • • • < u 0 < u 1 < u 2 < • - - by a recursive relation A shading function approximation method for non-rational
surfaces was presented in a previous paper by the authors
Nil(u)=0 if u e [ul,u~÷l]
[15]. This method uses Hermite approximation to approxi-
N i l ( u ) - - 1 if u e [ul,ui+l] mate the normalized shading functions N'L and N ' H with
two bicubic functions.
N~(u) "-ul N~_lfu) + u.~-. N~l(u ) The shading approximation algorithm for rational surfaces is
Ui+k-l--I~i Ui+k--Ui+1
very similar to that described previously. The derivation o f
B o e h m ' s triangular scheme operates on the knot vectors and the shading function approximation for rational surfaces is
control points to give the values and the derivatives o f the included in Appendix B.
coordinate functions xyzw. This scheme can then be used to The calculation of derivatives o f rational functions are gen-
obtain the polynomial coefficients for each span o f the sur- erally more complex. The implementations o f the two algo-
face and to calculate the normal vectors and the bicubic Her- rithms are the same except at the low level routines where
mite approximations o f the shading function for a surface. the derivatives are computed. Here only the differences
An alternative method is presented here which operates on between the two are outlined.
the knot vectors to give the basis matrices o f each span For a non-rational surface
which then convert the control points for the span to polyno-
mial or forward difference basis. x ( u , v ) = UXV, y (u,v ) = UYV, z(u,v )= UZV

To render the surface with the A F D technique, the parameter the low level derivatives are
u for a current span (ut,um) is redefined to range between 0.0
ax - u ' x v ,
~u T~x
v = uxv', °2x ~ = u"xv,
~u.---
and 1.0 by a linear substitution u' = ut+lu + (1-u)ul so that

N~(u) (ut-ui)+(ut+l-ut)u N~_i(u) 32x = u x v ' , °3x - u"xv" ~3x - u'xv-


ui+k-l-ui Ova Ou20v- , Ou3v2
+ (Ui÷k--ut~(Ut+l--Ut)UNik~l (u) (l) For a rational patch,
Igi+k--lAi+l UXV UYV UZV
x(u,v)= ~ , y(u,v)= ~,z(u,v)= Uwv
Given the basis functions represented in polynomial power
series, let C~j denote the jth coefficient o f the ith basis func- the derivatives are more complicated as follows:
tion N~(u) o f order k: OX x uw--.~'u
k-I ~u w2
Nik(u ) = ~E~Cikd u~ (2)
j=O O:X 1 2
--0u
2 - ~T(w x~,-wxw.-2ww.x.+2xw.w.)
The coefficients C.,j
~. can be defined recursively in terms of
the lower order ones as O2X 1 2
av 2 - ~ - ( w x ~ - w x w ~ - 2 w w ~ x , +2xw, w. )
c : j = ~ c : : _ ~, + b C:~ l + ~ C:Z~_i + d C:Z~ (3)
a2X
Ut+l--U I Ui--U i ~| T ( w 2x . , - w x , w , - w x , w . - w x w . , +2xw. w, )
where a =- - b =- - Ou ~v
ui +k-l--lgi I~i+k_l--Ui
~3X
Ul+l--tlI Ui+k--Ul H l(u ,v) _ 3X~'(u'v)w'w
C= d Ou~av w3
I~i÷k--Mi+l I~i+k--Ui+1
This equation is used to obtain the N U R B basis matrix C U ~3X H 2(u ,v) w.
= -3X~(u,v)--
~u~v 2 w3 w
and C V in the u, v directions from the u, v knot vectors. The
derivation in (3) can be proved by observing that N~(a) is a where
product o f a linear function times a polynomial. Substituting
equation (2) into equation (1) gives the following equation H 1(u ,v ) = ~v(W 2x~-wxw~,-2ww.x.+2xw, w.)
(ut--ui)+(ul+l--ul)u +-2 k 1
N~(u)= ZCi~ .J
Ui+k-l --lgi j ~o H 2( u,v ) = ~0- ( w 2x ~ , - w x w ~ - 2 w w , ~ +2xw, w~)
( ui +~-u~ )-( ut +~-ut )u ~2 _~_~
+ ~ i + I d u~ (4) The two spherical surfaces shown in figure 4 are rational
Ui+k--l/i+t j~
biquadratic surfaces. The shading functions are computed
from which the derivation follows trivially. using the method described in this section.
In Appendix A a recurrence formula is given for efficiently
computing the f o r w a r d d i f f e r e n c e b a s i s matrix for a N U R B
span. This recursive equation is similar to the previous one.
The above two methods allow the basis matrices C U and C V
to he derived independently of the control point mesh.
These matrices are concatenated with the control point
arrays to give the forward difference matrices o f the coordi-
nate functions and the shading functions for the span.

192
~ ComputerGraphics,Volume22, Number4, August1988

Trimming NURB Surfaces Discussion


Once the forward difference coefficients of the current span
are obtained, the trimming curves are scan converted in u,v 1. Reducing Adjustment Overhead
space using AFD to increment the curves to find their inter- While rendering a surface, the decision to adjust up, adjust
sections with the curve S(uo,v). This curve is then rendered down, or forward step from the current curve to the next
between intersections v~o and v ~ using AFD in the v direc- curve is made based on an estimate of the maximum distance
tion. Then we step to the next curve with a forward step in between the two curves, d ( v ) = f ( u + S u , v ) - f ( u , v ) . This dis-
the u direction. tance is an isopararnetric function of v. By converting the
The AFD method allows polynomial parametric surfaces to distance function into Bezier basis and using the convex hull
be rendered in parameter space order rather than in scanline property, the maximum distance between two curves can be
order. This greatly reduces the difficulty of trimming since calculated. Cook catalogs the conversion matrices between
the trim curves can be scan converted in parameter space several different basis in[7]. The overhead per curve for
order using the same techniques that are well known for scan converting between the two bases can be reduced by keeping
converting polygons. The trimming curves are nth order, a dual matrix B of the forward difference matrix A :
closed, NURB curves. Our trimming algorithm operates in 4
A = [FD ] [DUI [CU] [PI [CV]r [DV] r [FD ]r
steps.
B = [FD] [DU] [CU] [PI [CV]r [DV] r [BZ]r
1) The NURB trim curves are converted to piecewise Bez-
ier by knot insertion. where [BZ] converts from polynomial basis into Bezier basis.
2) The Bezier sections are subdivided so they are all Matrix A is converted to forward difference basis in both u
monotonically decreasing in the u parameter direction. and v directions and B is in forward difference basis in u and
Bezier basis in v. The first row of A contains the coordinates
3) The Bezier sections are converted to forward difference
of the current curve in f o r w a r d difference basis for used in
basis.
AFD to render the curve. The second row of B contains the
4) They are sorted in u parameter order by their minimum difference function d(v) in B e z i e r basis for used in the
u value. adjustment decision making. A and B matrices are syn-
5) For each AFD forward step in the u direction (from chronized in the u direction, i.e. adjusted up or down or for-
curve to curve) the active trim curve sections are ward stepped at the same time, so that AFD can step from
forward-stepped down to find intersections with the one curve to the next while keeping the distance function
new curve (vmin, vmax). The appropriate portions of available in Bezier basis.
the surface curve are drawn based on the trim curve
winding rule. 2. Degenerate Surfaces
Figure 5 shows a nut composed of NURB surfaces trimmed Shown in Figure 4 are two spherical surfaces both defined as
using the above technique. The rim portion of the nut is non-uniform rational B-spline surfaces. The shading approx-
formed by a cone trimmed with two sets of trimming curves imation method discussed in this paper was applied directly
Figure 2 uses the rim example to illustrate the trimming to the non-degenerate surface on the left. The one on the
algorithm. right contains a degenerate edge with three coincident con-
trol points. A degenerate surface may have vanishing
NURB surface s(u, v) derivatives, which complicates the computation of the Her-
mite approximation to the normalized normal vector func-
tion. In this case, the vanishing derivatives were replaced
using special case approximation before the shading method
was applied.

3. Computation Complexity
,, The de Boor algorithm is popular for evaluating points on a
vlrrl.ln max
NURB surface, or inserting knots in a subdivision technique
for surface rendering. A full version of the de Boor algo-
rithm for evaluating a point on a surface of order k requires
(k-1)k(k+l)/2 multiplies and twice as many adds. This makes

7)7 it expensive to evaluate many points on a surface or to subdi-


vide the surface down to pixel size in order to render a high
quality image. Boehm's triangular scheme gives the values
and derivatives of a B-spline function. This scheme can be
used to obtain the polynomial coefficients for each span of
the surface. Each triangular operation requires k(k-1)/2 mul-
tiplies and k(k-l)/22 adds for an order k function, assuming
u=uo " ~ - vmax knot j the knot differences have been precomputed. A full version
of B o e h m ' s triangular scheme requires two triangle opera-
Figure 2. A NURB surface trimmed by a NURB curve. tions to compute all the derivatives of a single variable B-

193
SIGGRAPH '88, Atlanta, August 1-5, 1988

spline function, which is k(k-l) multiplies and adds. For a 5. Transparency and Anti-aliasing
bi-variate function, it would require 4k triangle operations to Redundant pixel painting in AFD constitutes the major obs-
compute all the derivatives, which is 4k2(k-l) multiplies and tacle in rendering transparent objects. Quick solutions to get
adds. Given the derivatives, k z multiplies are required to around the redundant pixel problem would be either to
compute the polynomial coefficient matrix. The method tesselate a transparent object into polygons or to keep a
presented here takes approximately 4k + 4(k-1)(k-2) + buffer for object identification at each pixel to eliminate
(k-1)(k-2)(21c-3)/6 multiplies and adds to compute a basis redundancy. However, the object-id buffer still can not han-
function of order k, assuming the knot differences have been dle a folded surface. A new twin-curve buffer algorithm is
precomputed. This method requires the computation of all under development by the author to tackle this problem. Still
the basis functions in the u, v direction. Given the basis more work and testing are required.
functions, it takes two kxk matrix multiplies to produce a
One very successful anti-aliasing technique is based on dic-
polynomial coefficient matrix, which is 2k3 multiplies and
ing to produce micropolygona [1] followed by skittered sub-
~z(k-1) adds per span. The computational complexity of the
sampling and averaging. Previous methods for dicing used
two methods is similar. Boehm's method operates on the
screen space derivatives to determine how finely to dice, and
control points directly instead of computing the basis func-
ordinary forward differencing to do the actual dicing. The
tions for each span, and thus has more memory requirement.
AFD technique may have potential as a method for dicing
since screen space step size is the condition which controls
4. Error Analysis adjust up, adjust down, or forward step. Further investiga-
Although forward differencing is the fastest possible way to tion in this area is needed.
sample a large numbers o f points on a surface, it tends to be
more vulnerable to errors than other evaluation methods.
After performing k forward step operations on a cubic func-
tion f(t)--aBa(t)-bbBz(t)+cBt(t)-bdBo(t), the four coefficients
become .a ' = a k(k-1)(k-2)
~ "+O----~---+CX. c,=ak(~+bk+c,
_k(k-1) . .+a, Conclusion
b'=ak+b, and a'=a. The error accumulation in each In this paper a technique for rendering nonuniform rational
coefficient is formulated as B-spline surfaces is described. The A F D technique is gen-
eralized to higher order, and a recursive relation is derived
k (k- 1)(k-2) +eb ~ + e c k -be d for efficiently computing the basis function coefficients of a
Ea'=e~- 6
NURB surface. An approximation method for computing
E c" = e a ~ - ~ - b e b k -bee the shading functions of a rational surface is developed and
A F D is applied to the problem of trimming NURB surfaces
Eb • = eak+el~ with NURB trim curves using a method similar to polygon
Ean -- ~a scanline algorithms. A F D based rendering methods for
NURBS give the quality of subdivision methods with the
where e,,eb,ec and ed are the initial errors in the coefficients efficiency of forward difference techniques. Image mapping
and E,,E~,Ec and Ed are the errors accumulated after k steps. and NURB trimming are also facilitated. Figure 6 shows a
In fixed point arithmetic with all the coefficients having clevice rendered using these techniques.
equal number of fractional bits, the term eak(k-l)(k-2)16 con- The shading approximations and the re.cursive relation for
tributes the most to the error, which can be as much as 30 computing basis functions are equally applicable to other
bits for k=21°. For higher order functions the error can accu- rendering techniques such as polygon tesselation, ordinary
mulate even more rapidly. Both OFD and AFD techniques forward differencing, or recursive subdivision.
suffer error propagation problems, however, the AFD error is
Further work should be done on evaluating the accuracy of
always bounded by the O F D error. The number of steps
the Herrnite approximation functions for shading and possi-
required by OFD to forward across a curve is always greater
than or equal to that of AFD, because OFD uses the bly extending these methods to higher order.
minimum step size while A F D can adjust up step size
whenever needed and thus reducing the number of steps. An
adjust-up operation cuts the number of forward steps in half,
and at the same time requires an n-bit left-shift in the ease o f
a degree-n function. It is clear from the dominating error Acknowledgement
term in the following relation that the AFD error with k for- The authors would like to thank Lewis Knapp and David
ward steps following an adjust-up is always smaller than the Elrod for aquiring the NURBS data bases and writing the
OFD error with 2k forward steps. database reader software. Thanks to Tony Wyant for provid-
ing the digitized images for mapping, and to Sue Carrie for
e, 2k(2k-l)(2k-2) >2ae° k (k-1)(k-2)
6 6 helpful discussions on error analysis. We are grateful to
Lewis Knapp for reviewing early drafts of this paper and for
A section of error analysis on the OFD technique can also be many helpful discussions. Special thanks to Automation
found in Rockwood's paper. Technology Products for providing trimmed NURB data.

194
4~ ComputerGraphics,Volume22, Number4, August 1988

Appendix A Appendix B:
This appendix derives the NURB forward difference basis This appendix describes how to compute the derivitaves for
function for a single span from the knot vectors. the Hermite shading function approximations for the r a t i o n a l
W e can redefine the B-splint function N~ in forward differ- case. A rational bicubic patch is defined by
ence basis as X ( u , v ) = -U X V x (u ,v)
w(u,v)
UYV y(u,v)
YCu,v) =
+ .-- + B~_~ u (u- 1)(u-2)...(u--(k-2)) UWV- w(u,v)
(k-Dr UZV z (u,v )
zcu,v) = = - -
UWV w(u,v)
and
where x(u,v), y(u,v), z(u,v) and w(u,v) are the nonrational
B:, [1 ui~u<u~+t and j=0 polynomial functions describing the coordinates of a patch.
J,I = 0 otherwise

The jth coefficient B:j o f the NURB basis function N~ in the The normal vector N = <n+,%,n, > is given by
forward difference basis for the ith span of a curve of order k .~=Y.Z.-Y,Z., %=z.x,-z,x., n,=x. Y,-X. Y.
is given by
The derivatives o f the unnorrnalized normal vector function
BEd = J• Bi~-t
d-I + t . / _ , , ) n ~ 2 1 j Bi+l,i_1
k-i + (.j-ui+~)Bi+lj
. k-1
are given by
U i+k-l--t~i gi-+.k--Ui+l
3n~
au = r . z . + Y.ZZ~- r ~ z . - r . z . ,
Derivation:
F r o m the B-spline basis definition we notice that N~(u) 3n.
is the sum o f two products o f a linear equation times a ~, = r . z , + Y . Z . - r . z . -rvz+
polynomial. a2n~
N~(u )=(au+b )Ni~-t + (a"u +b')N~.it ~uOv - Y.~,Z. + Y . Z . + Y . Z ~

W e proceed by firstobtaining a recurrence relation for


one product and then combine the relations for the two
products. Taking au+b times each term of N: -~ gives where the low level rational terms x . , x ~ , , x . , x ~ , , x . . , etc.
Bo(au+b ) = aBou + bB o can be derived separately in terms o f the derivatives of the
nonrational functions x (u,v),y (u ,v ),z (u ,v ) and w (u ,v).
X u W - - X Wu
X ~ ~. w2

B u(u-1) [.3_q..~.u__~_+3(b+2a)] 1
X~, = - ~ - ( w x ~ , - w x w ~ , - 2 w w . x . +2xw. w . )

3aBz u (u-1)(u-2) + (b+2a)B z u (u-l) X ~ = ~ 1 (w 2x ~ , - w x w ~ - 2 w w , x~ +2xw~ w, )


3! 2t

Bj u (u-l)...(u-(j-l))(au+b) = X., = - ~1 (w 2x., - w x . w . - w x , w . - w x ~ +2x~ . w, )


j!

(j+l)aBj u ( u - 1 ) . . . ( u - j ) + (b+ja )Bj u ( u - 1 ) . . . ( u - q - 1 ) ) X~, H l(u,v) w,


= - - - 3X~ (u,v)--
(j+l)! jt W 3 W

Grouping common terms and repeating similarly for the X.,, - H2(u,v) - 3 X . ( u , v ) - - w.
w 3 W
second product gives
where

Substituting for a and b gives the equation of the recursive H l(u,v ) ffi"~(w 2x~-wxwu.u-2wwux.+2XWuWu)

~lation.
H2(u,v) = -~-(w zx~,~-wxwv,-2w%x,,+2xw, wv)

The normalized normal vector function, its derivatives and


the cross derivatives in the u and v directions are derived
exactly the same as for a nonrational patch. The normalized
normal vector function is
• z(u,v)=nzG, dy(u,v)=nyG, dz(u,v)=nsG ,

where G(u,v)=(n2~ + n ~ +n2,) -t]~

195
/ S I G G R A P H '88, Atlanta, A u g u s t 1-5, 1988
III I

References
The derivatives and the cross derivatives in the u and v
1. Richard Barrels, John Beatty, and Brian Barsky, An
directions are given by
Introduction to Splines for use in Computer Graphics
O~(u,v) anx ~ aG and Geometric Modeling, Morgan Kaufmann Publish-
=
au au ~j + ' ~ U fix ers, 1987.
2. Wolfgang Boehm, Inserting New Knots into B-Spline
av = av G+'~ "n" Curves, 12, pp. 199-201, Computer Aided Design,
1980.
aua~ = a ~ a + -E~" + ~.x + au a, 3. Wolfgang Boehm, E3ficient Evaluation of @lines, 33 ,
pp. 171-177, Computing, 1984.
aG
~-E =_.Gs (n=-an=
E + n' -any
E + ' " ~an.
-) 4. Carl de Boor, On calculating with B-splines, 6, pp. 50-
62, Journal of Approximation Theory, 1972.
aG = ._G3 an= a% an. 5.
(n=-5;:+~,--E+n,-~;-) Edwin Catmull, A Subdivision Algorithm for Computer
Display of Curved Surfaces, UTEC-CSe-74-133,
University of Utah, Computer Science, 1974.
a,,,~; GLa, J . Elaine Cohen, Tom Lyche, and Richard Riesenfeld,
Discrete B-Splines and Subdivision Techniques in
-L. [ n . - ~ + ~ a~v +n. auavj Computer-Aided Geometric Design and Computer
Graphics, 14, Computer Graphics and Image Process-
: an, an= a% a% an, an, ] ing, October 1980.
7° Robert Cook, Patch Work, Tech. Memo 118, Computer
To approximate the unit normal vector function w e n e e d Div., Lucasfilm Ltd., June 1985.
8. Robert Cook, Loren Carpenter, and Edwin Catmull,
ale, The Reyes Image Rendering Architecture, SIG-
~t,(o,o) ,f,(o,D -~-(o,o) .-~-(0,1)
GRAPH'87 Proceedings, July 1987.
~t=(Lo) ~,(LD -~-(LO) --~-O,D . James Foley and Andries Van Dam, Fundamentals of
:== Interactive Computer Graphics, p. 533, Addison-
-~-(o,o) -E(O,l) .~.(o,o) ~.~.(o,1~ Wesley Publishers, 1982.
10. E.T.Y. Lee, Ej~cient Evaluation of Splines, 329, pp.
apt.,, a~ a% a2,t, 365-371, Computing, 1982.
~-(1,0) --~-(|,1) -~-(t,O) a~v(l,ll
11. Sheue-Ling Lien, Michael Shantz, and Vaughan Pratt,
Adaptive Forward Differencing for Rendering Curves
and Surfaces, SIGGRAPH'87 Proceedings, July 1987.
12. Tom Lyche and Knut Morken, Making the OsIo Algo-
rithm More Ef~cient, 23, pp. 663-675, SIAM J. Numer.
Anal, 1986.
13. Hartmut Prautzsch, A Short Proof of the Oslo Algo-
rithm, 1, Computer Aided Geometric Design, 1984.
14. Alyn Rockwood, A Generalized Scanning Technique
for Display of Parametrically Defined Surfaces, 7,
IEEE CG&A, August 1987.
15. Michael Shantz and Sheue-Ling Lien, Shading Bicubic
Patches, SIGGRAPH'87 proceedings, July 1987.

196
~ ComputerGraphics,Volume22, Number4, August 1988

Figure 3. A sphere subtracted by a cylinder tangent to the sphere surface. The


image is shaded with two light sources.

Figure 4. Two rational biquadratic surfaces shaded with a 4th order non-rational
shading approximation function. Left) Non-degenerate surface. Right) Degenerate
surface with one degenerate edge. Two light sources were used.

197
SIGGRAPH '88, Atlanta, August 1-5, 1988

Figure 5. Nut composed of trimmed planes cylinders and cones. The beveled rim
portion is a trimmed cone.

Figure 6. Trimmed, image mapped, NURB clevice.

198

You might also like