Nurbs Ellipse
Nurbs Ellipse
Nurbs Ellipse
CURVE
Emiliyan Petkov, Liuben Cekov
University of Veliko Turnovo, Computer Systems and Technologies Department, Veliko Turnovo 5000,
2 Teodosii Turnovski str., tel.062 649831, e-mail: [email protected]
Technical University - Gabrovo, Computer Systems and Technologies Department, Gabrovo 5300,
4 Hadgi Dimitar str., tel. 066 223456, e-mail: [email protected]
Abstract: This paper offers one method for constructing an arc of ellipse – one of the conic sections, by NURBS – one of the most
popular mathematical model for representing curves and surfaces in CAGD. It also gives the analytical equations of this conic and
explains its relation with a quadratic rational Bezier curve. The developed technique is given by mathematically proved algorithms.
Introduction r
Computer-Aided Geometric Design (CAGD) is the base of
projection and construction in a number of industrial
∑M w B i i i ,r (t )
settings. CAGD is concerned with representations, β (t ) = i =0
r
(1.1)
constructions, deformations and approximations of curves
and surfaces. There is an aspiration for opening new and
∑w B
j =0
j j ,r (t )
more efficient tools for expanding the functionality of the
graphics systems. n
Bi ,r (t ) = t i (1 − t ) , i = 0,… , n and
r −1
We have a goal to provide new possibilities and bigger and
flexibility in designing graphic models of real objects by i
investigation of new methods, algorithms and graphics tools. t ∈ [0,1] is the polynomial of Bernstein.
Because very often the borders of the objects have forms of
conic sections, we concentrate our work on building methods β (t ) passes trough the first and the last control points and
allowing interactive modeling by ellipses, parabolas and the tangents in these points have the directions of the first
hyperbolas, as well as ellipsoids, paraboloids, hyperboloids and the last lines of the control polygon [4].
and etc. So, this task is a part of a bigger research for 1.2 General model of a NURBS curve
representing and constructing the all quadratic curves and In [5, p. 55] is given definition of a B-spline function of
surfaces by appropriate models and techniques. They should degree r . But the most often used are the normalized B-
be prepared for implanting in graphics systems. splines:
In this report we examine one of these curves – the ellipse, t − ti ti + r +1 − t
and with parabola and hyperbola we do the same in other N i ,r
(t ) =
ti + r − ti N i , r −1
(t ) +
ti + r +1 − ti +1 N (t ) ,
i +1, r −1
papers.
One of the most popular mathematical model in CAGD for 1 ti ≤ t ≤ ti +1
representing curves and surfaces is NURBS (Non-Uniform
Rational B-Spline). That is why we want to represent the N i,0 0 t ∉ [t , t ]
(t ) = (1.2)
ellipse by a NURBS curve. i i +1
The mathematical base of the problem is given in section 1 Now one rational B-spline curve defined upon non-uniform
and 2 and it is based on the references [3,5,7]. In section 3 knot-vector in homogenous coordinates is given by
we publish the result of our research.
r −1
1. Mathematics background ∑M w N i i i ,r
(t )
(1.3)
NURBS curves is a modification of the rational B-spline γ (t ) = i =0
n −1
curves. They are obtained when special set of knots are
chosen. The knots form a numerical vector (known as knot-
∑w N
j =0
j j ,r
(t )
vector) and they are necessary to define the B-spline
function. Every curve approximates points in 2D or 3D. where M i ( xi , yi ) are control points with weights
These points are called control points and form the control
polygon. There is a relation between Bezier-Bernstein basis wi , i = 0,… , n , tj are m +1 knots for
and B-spline basis as well.
1.1 General model of a rational Bezier curve
Here is the parametric equation of one rational Bezier curve
t j ≤ t j +1 , j = 0,… , m − 1 and N i ,r (t ) is the B-spline
their weights wi are given: The definition, all characteristics and geometric properties of
the NURBS curves can be seen in [3]. Only the most
important property concerning this research will be given is an arc of ellipse. For the prove of it, you can look at [3, p.
here. 293].
Property 1.1 NURBS curve with no interior knots is a Varying w1 yields a family of conic arcs and one more
rational Bezier curve, since the N i ,r reduce to Bi ,r . convenient way to select a conic form is to specify a third
NURBS curves contain non-rational B-spline and non- point on the conic, which is attained at some parameter value
rational Bezier curves as special cases. t = 0.5 . This point is called the shoulder point of the conic
The advantage of using rational curves is that they
interpolate conic sections correctly [1,2,3,4]. It means that by
(Figure 1a). Substitution of t = 0.5 into Eq. (1.1) yields
these curves correct representation of ellipses, hyperbolas 1 w ,
S= P + 1 M1
and parabolas is possible. 1 + w1 1 + w1
1.3 Analytical representation of an ellipse (2.1)
The conic sections are the non-degenerate curves generated
by the intersections of a plane with one or two nappes of a where P is the midpoint of the cord M 0 M 2 . Let s be a
cone. These objects are very good examined [7]. They are new parameter that gives a linear interpolation between P
specified in three types of curves: elliptical, parabolic and
hyperbolic. and M 1 . Then for some value of s we have
The analytical representation of an ellipse in standard w1 s
position into orthogonal coordinate system S = (1 − s ) P + sM 1 ⇒ s = ⇒ w1 =
{ }
Oxy = O, e1 , e2 is given by the following equations
1 + w1
(2.2)
1− s
2
x y2 A circular arc of sweep angle les than 180° is also
ε : 2 + 2 = 1, a, b > 0 , (1.4)
a b represented by Eq. (1.1). For symmetry M 0 M 1M 2
x = a.cos α (Figure 1a) must be an isosceles triangle, with
ε : , α ∈ [ 0; 2π ] . (1.5)
y = b.sin α M 0 M 1 = M 1M 2 . Let θ = M 1M 2 P . From
2. Representing an arc of ellipse by a Bezier curve symmetry the arc M 2S is the same as SM 0 , hence the
There are a lot of techniques for building an arc of ellipse in
CAGD, but one of the most popular belongs to Farin Gerald
angle SM 2 P bisects θ. From Eq. (2.2) and the
[1] and Les Piegl [3]. They represent the arc of conic (that is properties of bisectors it follows that
defined by its endpoints and the tangents at them plus an s PS PM 2 e
intermediate point) by rational Bezier curve. w1 = = = = = cos θ (2.3)
1 − s SM 1 M 1M 2 f
They examine the quadratic rational Bezier curve for
representing an arc of conic by looking at Eq. (1.1). When
3. Building the arc of ellipse by a NURBS curve
n = 2 all conic sections could be represented because they On the base of the mathematics background we did above,
are quadratic curves as well. The parameters which influence
the representation of an arc of ellipse we shall do by finding
the form of the cure (when n = 2) are wi , i = 0,1,2 . the right place and order of the control points in the
quadratic NURBS model of a curve.
Usually, w0 = w2 = 1 are selected. It is called normal
parameterisation. Now, the form of the curve depends on
w1 ∈ ( −∞; +∞ ) . If −1 < w1 < 1 the form of the curve
Fig. 1 – a) representing an arc of circle by a Bezier curve; b)an arc of the ellipse ε;
c)an arc of the circle c represented by a Bezier curve
The conics always lie in one plain. So, let l be a plain and characterizes positive direction of visiting the points of l .
Let ε given by Eq. (1.4) be in standard position (Figure 1b).
{
K l = O, e1 , e2 } ( e = e ) a right oriented orthogonal
1 2 3.1 Determining the direction of the arc
(when α s − α e > 2π ) that builds the ellipse when α Pl could be obtained from the point Pc by the following
transformation:
changes its value from α s to α e .
a 0
Let α s determine a point Ps ( xs , ys ) from ε with a Pl = TPc , T = (3.1)
0 b
radius-vector rs , and αe determine a point Pe ( xe , ye ) 3.5 Building the arc γc by using the unit circle c
from ε with a radius-vector re . We know (from [7], pp. 22- We shall give a technique for constructing an arc defined by
αs and α e ( α s , α e ∈ ( −∞; +∞ ) ) of the unit circle c .
24), that 1) the vectors rs and re are lineal independent
We set the condition α s < α e , i.e. for building only a
xs ys x ys
⇔ ∆= ≠ 0 ⇔ rang s = 2 and 2) positive arc. The whole arc will be divided into segments,
xe ye xe ye everyone of them will be not more than 90°.
(r , r )
Lets first examine the special case when
the couple is right and characterizes positive
s e α s − α e ≤ π / 2 , looking at a Figure 1c. We know that
direction of visiting ⇔ ∆ > 0, and it is left and
OPs = OPe = 1 . Let the tangents at Ps and Pe
characterizes negative direction of visiting ⇔ ∆ < 0.
Therefore, if αs < αe we have positive direction of intersects themselves at P1 . Then Ps , P1 , Pe are the control
points of the quadratic rational Bezier curve that interpolates
visiting the points of the arc, if αs > αe we have negative
x = a cos α s
direction, and if αs = αe - the arc does not exist. Ps we the arc precisely. Ps , Pe ∈ ε ⇒ Ps : s
ys = b sin α s
shall call start point, Pe - end point, αs - start angle and
x = a cos α e
αe - end angle. and Pe : e . Let ws , w1 , we be the weights
Heuristic 3.1 Positive arc from ε (Figure 1b) we shall call ye = b sin α e
the curve obtained by the movement of radius-vector r in of those three points. We want ws = we = 1 - for normal
positive direction from Ps to Pe when ∆>0 for parameterisation. Now, it is easy to calculate P1 . We obtain
α ∈ [α s ; α e ] . Negative arc from ε we shall call the x = cos (α s + β / 2 ) .d
P1 : 1 . For finding w1 we do
curve obtained by the movement of radius-vector r in y1 = sin (α s + β / 2 ) .d
negative direction from Ps to Pe when ∆<0 for the following:
α ∈ [α s ; α e ] . Let Ps Pe ∩ OP1 = Pm and P1 Pe Pm = θ (Figure 1c),
Fig. 2 – a) full ellipse; b) from -70° to 405° arc and the positions of the end points are changed; c) from 0° to 360° arc
Conclusion
We explained one technique for constructing NURBS References
elliptical arcs, that is useful for the computer-aided 1. Farin Gerald. From Conies to NURBS: A Tutorial and
geometric design. It makes the computer algorithms for Survey. IEEE CG&A, pp. 78-86, 1992.
representing this kind of curves effective and fast. The 2. Lee E. T. Y. Rational quadratic Bezier representation for
algorithms are developed to represent the conic of the lowest conics. Geometric Modelling: Algorithms and New Trends.
degree NURBS curve and fewest control points. For more Philadelphia: SIAM, pp. 3-19, 1987.
flexibility increasing the number of the control points and 3. Piegl Les, W. Tiller. The NURBS Book. Springer, USA,
constructing arcs for angles less than 0° and more than 360° 1997.
is possible. So designers could model elliptical forms with 4. Rogers David F., J. Alan Adams. Mathematical Elements
ease. for Computer Graphics, 2nd edition. McGraw-Hill, 1989.
In addition, a programming model for NURBS conic curves 5. Боянов Борислав. Лекции по числени методи. Дарба,
could be seen in [6]. С., 1995.
Our work is being expanded with developing new effective 6. Петков Емилиян. NURBS коники – програмен модел.
techniques for representing an arc of parabola and an arc of Международна научна конференция “УниТех’04”,
hyperbola by NURBS curves. In this way we shall have all Габрово. Сборник доклади, Том 1, стр. 359-363, 2004.
three generatrix curves that we need for representing the nine 7. Христов Милен. Аналитична геометрия. Астарта,
quadratic surfaces by NURBS. Велико Търново, 2003.