Accurate Parametrization of Conics by NURBS
Accurate Parametrization of Conics by NURBS
ne argument often given to explain the Conics, circles, spheres, and splines
popularity of NURBS (nonuniform ratio- We briefly review here how conic sections (and relat-
nal B-spline) is that it permits the ed curves and surfaces) can be modeled by splines.
definition of free-form curves and
Zigzag reparametrization surfaces (as do most spline models), Conics
It also provides an exact representa- In the early 1800s,Moebius stated that a conic can be
improves the tion of conic sections and thus of a considered the projection on IR2of a parabola defined in
large set of curves and surfaces used IR3.Using this result, we can show that a conic can also be
parametrization of a NURBS intensivelyincm: circulararcs, cir- expressed as a rational quadratic Bezier curve (and alter-
cles, cylinders, cones, spheres, sur- natively as a quadratic NURBS) .3,4 Such a curve is defined
curve or surface according faces of revolution, and so forth. by three points, PO,PI, Pz, and three weights, WO, w1,w2:
Nevertheless, few published works
to a given criterion, as discuss the mathematical properties
behind the representation of conics
illustrated here through by NURBS except for two recent
monographs by Piegl and Tiller' and
parametrization of a circle. by Farin.' This article does not pre-
tend to fill this theoretical lack but
rather intends to deal with the following problems: or by explicating the Bernstein polynomials Bg(t), B?(t),
and Bz(t):
All known NURBS representations of curves and sur-
faces based on conics have only a C1 continuity. kft E 10.11
Moreover, no technique exists that would eventually
allow us to find a parametrization with a higher level
of continuity. Ck)= 07
wo 1 - t P0+2w1 1-t tP1+w,
0 t 2 P2
(2)
The parametrization resulting from the NURBS rep-
resentation of conics can deviate significantly from
w,-2t w -wl
( 0 1
+ t 2 wo-2w1+w
( 1
the ideal arc length (that is, uniform) parametriza- Parameters wo,w1,and w2 are linked by the conic
tion. The only known solution to reduce this devia- invariant5 relationship wowl/wf which means that every
tion is to increase the number of control points of the set (WO, w1, w2)that provides the same value for the
spline (by using refinement algorithms, for instance), conic invariant also provides the same c ~ r v e . ~ , ~ , ~
but such a process converges only slowly to the uni- Moreover, because the roles of Po andPzare symmetric,
form parametrization. it is preferable to have wo = W Z .Finally, without loss of
generality, we can assume that wo= w2= 1and w1= w
The solution we propose here uses an original repa- (this condition is sometimes called the normalform of
rametrization process that we call zigzag reparametriza- the rational curve7),which leads to
tion, based on a specific family of rational polynomials.
This technique improves the parametrization by mini-
mizing a given error criterion (in our case, giving a high-
er order continuity as well as a more uniform Po+2w 1-t t P1+t2 Pz
parametrization). On the other hand, it raises the degree C ( t ) = (1-t) ( 1
)
1-2 4 1- w + 2t2 (1- w )
(3)
of the resulting NURBS (in our case, from two to four).
Circular arcs
For geometric modeling, the circular arc is undoubt-
edly the most useful particular case of conic sections.
Such an arc results when Po, PI, PZform an isoscelestri-
angle and when w = cos@(where @ is the angle between
P& and P&).3,4,6For instance, a circular arc of length
29 starting from the trigonometric origin (see Figure 2)
is obtained with the following control points:
p2 (cos24, sin2qj
2 Circular arc.
where T = tan@.
p3 (-2,o)
Pb(L0)
C+P2
C(l')=Pz
where even-indexed (respectively, odd-indexed) points
have their weights set to 1(respectively, d2/2). Cf$')=2wjP,-P2)
i
P4 - P2 = Po - Pz+2 1+cos 24 j (pz Pl 1
-
= Po - Pz + 4w2 0
Pz Pl
- (8)
where even-indexed (respectively, odd-indexed) points The substitution of Equation 8 in the expression of
have their weights set to 1(respectively,&/2). C"(1+) showsthatwecanonlygetC'(l-)=C"(l+) when
Any regular polygon can be used to define the circle, w = 0 (a 180-degree arc, which is forbidden), or w = 1
but the square and the hexagon provide the best trade- (a 0-degree arc, which is not of interest). In other words,
off among cost, accuracy, and ease of use. we cannot define a circle with a C2 continuity using a
quadratic NURBS (or a quadratic piecewise rational
Sphere. Starting from a NURBS-based representa- Bezier) .6,7 Note that w = 0 is allowed when considering
tion of a circle, we can easily obtain a NURBS-basedrep- infinite points, but in that case Equation 6 is not valid
resentation of a sphere by computing a tensor product and there is still a C1 continuityonly (see Piegl and Tiller6
of a set of circles (providingthe parallels) by a set of half- for further details).
66 November 1996
Note also that the C1 continuity is only obtained in the have to find the actual expression of O ( t ) . For that, we
Euclidian space (that is, after projection). In the associ- involve another classical parametrization of the circu-
ated homogeneous space (before projection), the con- lar arc, the half-tungentparametrization:
tinuity is not better than (? (see Piegl and Tiller6).
vs E [OJ]
Study of the parametrization
Let us take again the circular arc of length 241starting 1-T’s2 2Ts
where T = t a n @ (11)
from the trigonometric origin, illustrated in Figure 2. 1+ T2s2 ’ 1+ T2s2
For many applications, the best parametrization of a
curve is the arc length parametrization (also called uni- The main advantage of this parametrization is that it
form parametrization or constant-speed parametriza- provides a simple relationship between the arc length 8
tion) because the variation of this parameter represents and the parameters:
the exact distance on the curve from one point to anoth-
er. The most obvious need for arc length parametriza-
tion is to provide constant-speed movements in
vs E [OJ]
animation sequences. Such a parametrization is also
useful for surface design or surface rendering; for
instance, arc length parametrization minimizes distor- Therefore, ifwe can find s(t), we will get immediate-
tion when doing texture mapping. ly 0 ( t ) .Fortunately, a fundamental result of projective
In our example, this arc length parametrization is geometry, developed by Moebius,states that two param-
given by the trigonometric parametrization: etrizations of the same curve by a rational polynomial of
the same degree (Equation9 and Equation 11)are relat-
ed by a rational linear function:
a+bt
Combining Equation 3 and Equation 5 gives us the (I
3 ( a , b , c , d ) ~ I R /~ s t =-
c+dt
rational Bezier parametrization of our arc:
Lee and Lucian’’ recently extended this result to piece-
vt E [0,1] wise rational polynomial curves such as NURBS. In our
case, parameters t and s are equal at the boundaries of
(1-2(1- w)t - 2 p - w)t’ the range [OJ] . This induces a more precise expression:
1-2jl-wjt+2(1-wjt2 ’
C(t =j (9)
2Twt -2Tw(l- w)t’
e(t ) = 24t 7-
t&W2
t r j t ) =2arctan-
Obviously, this is not the case here because it would 1-t+wt
mean that the cosine function could be expressed as a
rational polynomial. When this linear relationship is not The plot of this function, for several values of (I,
fulfilled, we obtain a quantitative evaluation of the appears on the left side of Figure 6 (next page). Note
parametrization by computing the distance between the that the function becomes less straight (in fact, it oscil-
actual function 0(t) and the ideal one 29t. Using a lates around the ideal straight line) when @ increases.
Euclidian norm, this distance A(t) (sometimes called This phenomenon is more apparent on the right side of
chordal deviation) is given by the figure, which shows the deviations of 8(t) from the
ideal horizontal lines. But the best quantitative infor-
mation is given by the chordal deviation A@) plotted in
Figure 7 (next page). This means that except for very
small angles, the representation of a circular arc by a
quadratic NURBS (or a quadratic piece-wise rational
Bezier) involves a parametrization that deviates signif-
Consequently, to evaluate our parametrization, we icantly from the arc length.”
0
but several characteristicsappear desirable for this repa-
rametrization. For instance, it is important for the two
parametrizations to have the same domain of variation
( S ( 0 ) = 0 and S(1) = 1).Moreover, due to the isoscelism
1 of the control triangle, the symmetry of the parame-
trization should be conserved (S(1- t) = 1- S(t) or in
other words S’(1- t ) = S’(t)). All these constraints imply
that there remains only one degree of freedom. If we
call this parameter p and define it as the value of the
8 Zigzag derivative at the boundaries (S’(0) = S’(1) = p ) ,
reparametriza- we obtain
tion function 0.5
S(t) for p = 0, pt+(l-p)tZ
0.5, 1,2,6, and S ( t )=
16. 1-2(1- p ) t + 2 p - p)t 2
68 November 1996
~ , ( l - t ) ~+Q4 ~ , t ( l - t ) ~ Q+6W2t2(1-trQ,
, +4W3t3(l-f) Q 3 +w4t4Q4 9 Equation 18.
C(t)=
wo(l- t )4 +4w,t(l- t )3 + 6w2t2(1-t)’ +4w,t3(1- t ) + w4t4
Obviously, QO= Po and Q4 = PZbecause of the inter- extension for the reparametrization of nonsymmet-
polation of the boundaries. We also know that we can ric curves such as ellipses or parabolas.
let wo = 1 and w4 = 1for symmetry reasons, without Zigzag reparametrization can also be extended above
loss of generality.We obtain the remaining weights wlr degree 2. We do this by defining a family of rational
w2, and w3 by comparing the denominators of Equation polynomials where each member Sk(t) of degree k
18 (see Figure 9) and Equation 17 term by term. fulfills
Similarly, we obtain the remaining points QI, Qz,
and Q3
by comparing the numerators.
Finally, the zigzag reparametrization of Equation 17
provides a quartic rational Bezier (and therefore quar-
tic NURBS) defined by
3p, E I R + / -d‘S
(O)=~,
Qo =Po
dt‘
0
$Po +2w l + p 2 P1+p2P2
Therefore,each successivemember of this zigzagpoly-
Qz = 2jpz +p2w+w
i nomialfamily includes one additional parameter that
enables more precise control of the parametrization.
;=,
actual one. Substituting Equation 16 in Equation 10
expresses the chordal deviation for a circular arc on
0.0003
which we have applied the zigzag reparametrization.
11 A(t)for$= The formulation of this new chordal deviation is a func-
0.25, 0.5,0.75, 0.0002 tion of parameterp:
and 1 (in
radians).
2 arctan
& Z q p t + (1-p)tZ) - 24t
0.0001
A(t) =
I-%+
i
I+W
i pt+ I - p t
2, (23)
n
0 0.2 0.4 0.6 0.8 1
JZ
What we have here is a classical
optimizationproblem: Find the opti-
3 mal value of a parameter (in our
12 e(t) and 2.5 case, the reparametrization factorp)
W(t) for 4 = 2 that minimizes a given condition (in
0.25,0.5, 0.75, our case, the chordal deviation A(t)).
1.5
1, 1.25, and 1.5 One possibility is to minimize the Lz
1 1 norm of A(t) by employing a least-
(in radians).
0.5 0.5 squares minimization method. The
0 0 drawback of this technique (and all
0 0.5 1 0 0.5 other techniques of the same fami-
ly) is that it provides only a numeri-
cal (and not an analytical) solution. Thus, for each new
Q3 angle I$needed, the user has to restart the whole least-
13 Quasi- squares process to find the new parameterp.
uniform Another possibility is to minimize theLwnorm of A(t),
reparametriza- Qi which only requires computing the maximal chordal
tion of the deviation. This maximum has an analytical expression
triangle-based Qo that can be computed by symboliccalculation software
circle. such as Maple or Mathematica, but this expression is so
complex as to be useless in practice.
For these reasons, we propose here a third solution
that is only heuristic but, in fact, very close to the opti-
mum. If we study the variation of the maximal chordal
deviation for different values of @, we can see that this
maximum always results for a value t that belongs in
This quadratic equation has always two solutions [0.19, 0.241. If we take a value in that range ( t = 1/5
(A=4w+5>0), but only the positive solution is useful seems to work well), we are assured that the chordal
for our reparametrization: deviation at point A ( l / 5 ) will not be too far from the
maximal deviation. Therefore, we simply have to force
A(l/5) = 0, that is,
1+45+ 4w
P=
2(1+ w) (I+ 4p)sin4
- tan(4/5) = o (24)
Therefore, Equation 22 combined with Equation 19 (1
18+ 12p - + 4p)cos$
enables a C2continuous junction for circular arcs of the
70 November 1996
to get a quasi-optimal value forp:
4-2cos3 (@/5)+cos(@/5)
P= (25)
-1+ 8c0s3(@/5)--4cos($/5)