User:Dallben/NURBS rewrite
From Wikipedia, the free encyclopedia
- Note I'm working on rewriting the NURBS article and am posting my work here. I'll try and incorporate any new changes to the article into this page as new contributions become available. This note is just so that a timestamp is available. Dallben 17:39, 5 December 2006 (UTC)
NURBS, short for non-uniform, rational B-spline, is a mathematical model commonly used in computer graphics for generating and representing curves and surfaces.
Contents |
[edit] History
Development of NURBS (Non Uniform Rational Basis Spline) began in the 1950s by engineers who were in need of a mathematically exact representation of freeform surfaces like those used for car bodies and ship hulls, which could be exactly reproduced whenever technically needed. Prior representations of this kind of surface only existed as a single physical model created by a designer.
The pioneers of this development were Pierre Bézier who worked as an engineer at Renault, and Paul de Casteljau who worked at Citroën, both in France. Bézier worked nearly parallel to de Casteljau, neither knowing about the work of the other. But because Bézier published the results of his work, the average computer graphics user today recognizes splines — which are represented with control points lying on the curve itself — as Bézier splines, while de Casteljau’s name is only known and used for the algorithms he developed to evaluate parametric surfaces. In the 1960s it became clear that non-uniform, rational B-splines are a generalization of Bézier splines, which can be regarded as uniform, non-rational B-splines.
At first NURBS were only used in the proprietary CAD packages of car companies. Later they became part of standard computer graphics packages, including the OpenGL Graphics Library.
Real-time, interactive rendering of NURBS curves and surfaces were first made available on Silicon Graphics workstations in 1989. Today most professional computer graphics applications available for desktop use offer NURBS technology, which is most often realized by integrating a NURBS engine from a specialized company.
[edit] Use
NURBS are nearly ubiquitous for computer-aided design (CAD), manufacturing (CAM), and engineering (CAE) and are part of numerous industry wide used standards, such as IGES, STEP, ACIS, and PHIGS. However, there is still a lot of confusion about NURBS's advantages and usefulness for interactive modeling, due mostly to guesswork based on knowledge about a single software package and the usability of its user interface. In general, it can be said that editing NURBS curves and surfaces is highly intuitive and predictable. Control points are always connected either directly to the curve/surface or act as if they were connected by a rubberband. Depending on the type of user interface, editing can be realized via an element’s control points, which are most obvious and common for Bézier curves, or via higher level tools such as spline modeling or hierarchical editing.
Higher-level tools exist which benefit from the ability of NURBS to create and establish continuity of different levels (a significantly different definition of the term 'continuity' is given below):
- Positional continuity (C0)
- holds whenever the end positions of two curves or surfaces are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge and causing broken highlights.
- Tangential continuity (C1)
- requires the end vectors of the curves or surfaces to be parallel, ruling out sharp edges. Because highlights falling on a tangentially continuous edge are always continuous and thus look natural, this level of continuity can often be sufficient.
- Curvature continuity (C2)
- further requires the end vectors to be of the same length and rate of length change. Highlights falling on a curvature-continuous edge do not display any change, causing the two surfaces to appear as one. This can be visually recognized as “perfectly smooth”. This level of continuity is very useful in the creation of models that require many bi-cubic patches comprising one continuous surface.
First- and second-level geometric continuity (G0 and G1) are for practical purposes identical to positional and tangential (C0 and C1) continuity. Third-level geometric continuity (G2), however, differs from curvature continuity in that its parameterization is also continuous. In practice, G2 continuity is easier to achieve if uniform B-splines are used.
A different definition of the continuity 'Cn' is given in 'Computer Graphics - Principles and Practice', section 11.2. This definition is also valid for curves and surfaces with base functions higher than 3rd order (cubic). It requires that both the direction and the magnitude of the nth derivate of the curve/surface (d/du C(u)) are the same at a joint. The main difference to the definition above is the requirement of equal magnitude. In addition, G1 continuity is weakened to require only a parallel tangent vector while C1 continuity requires the same magnitude (which is claimed to be 'C2' continuity in the specification given above). The C2 continuity used in the latter definition specifies that the curvature vector is the same in direction and magnitude, which makes an important difference to the former definition when using higher order base functions (more than cubic) for the curve definition.
Higher orders of continuity are also possible with NURBS.
Highlights and reflections can reveal the perfect smoothing, which is otherwise practically impossible to achieve without NURBS surfaces that have at least C2 continuity. This same principle is used as one of the surface evaluation methods whereby a ray-traced or reflection-mapped image of a surface with white stripes reflecting on it will show even the smallest deviations on a surface or set of surfaces. This method is derived from car prototyping wherein surface quality is inspected by checking the quality of reflections of a neon-light ceiling on the car surface. This method also known as "Zebra analysis".
[edit] Technical specifications
A NURBS curve is defined by its order, a set of weighted control points, and a knot vector. NURBS curves and surfaces are generalizations of both B-splines and Bézier curves and surfaces, the primary difference being the weighting of the control points which makes NURBS curves rational (non-rational B-splines are a special case of rational B-splines). Whereas NURBS curves evolve into only one parametric direction, usually called s or u, NURBS surfaces evolve into two parametric directions, called s and t or u and v.
By evaluating a NURBS curve at various values of the parameter, the curve can be represented in cartesian two- or three-dimensional space. Likewise, by evaluating a NURBS surface at various values of the two parameters, the surface can be represented in cartesian space.
NURBS curves and surfaces are useful for a number of reasons:
- They are invariant under affine as well as perspective transformations.
- They offer one common mathematical form for both standard analytical shapes (e.g., conics) and free-form shapes.
- They provide the flexibility to design a large variety of shapes.
- They reduce the memory consumption when storing shapes (compared to simpler methods).
- They can be evaluated reasonably fast by numerically stable and accurate algorithms.
- They are generalizations of non-rational B-splines and non-rational and rational Bézier curves and surfaces.
The knot vector is a sequence of parameter values that determine where and how the control points affect the NURBS curve. The number of knots is always equal to the number of control points plus curve degree plus one. Necessary only for internal calculations, knots are usually not helpful to the users of modeling software. Therefore, many modeling applications do not make the knots editable or even visible. More recent versions of NURBS software (e.g., Alias Maya and Rhinoceros 3D) allow for interactive editing of knot positions, but this is significantly less intuitive than the editing of control points.
The values of the knot vector must be in ascending order, so (0, 0, 1, 2, 3) is valid while (0, 0, 2, 1, 3) is not. The individual knot values are not meaningful by themselves; only the ratios of the difference between the knot values matter. Hence, the knot vectors (0, 0, 1, 2, 3), (0, 0, 2, 4, 6), and (1, 1, 2, 3, 4) all produce the same curve. Further, no knot value is allowed to have so many duplicates that it occurs more times than the degree of the curve. For first-degree NURBS, each knot is paired with a control point.
The order of a NURBS curve defines the number of nearby control points that influence any given control point. The curve is represented mathematically by a polynomial of degree one less than the order of the curve. Hence, second-order curves (which are represented by linear polynomials) are called linear curves, third-order curves are called quadratic curves, and fourth-order curves are called cubic curves. The number of control points must be greater than or equal to the order of the curve.
In practice, cubic curves are the ones most commonly used. Fifth- and sixth-order curves are sometimes useful, especially for derivatives, but curves of higher orders are practically never used because they lead to internal numerical problems and tend to require disproportionately large calculation times.
While non-rational curves are not sufficient to represent a circle, these are the NURBS control points for a uniformed circle on the xy plane:
x | y | z | weight |
---|---|---|---|
1 | 0 | 0 | 1 |
1 | 1 | 0 | √2 / 2 |
0 | 1 | 0 | 1 |
−1 | 1 | 0 | √2 / 2 |
−1 | 0 | 0 | 1 |
−1 | −1 | 0 | √2 / 2 |
0 | −1 | 0 | 1 |
1 | −1 | 0 | √2 / 2 |
1 | 0 | 0 | 1 |
[edit] See also
[edit] References
- Les Piegl & Wayne Tiller: The NURBS Book, Springer-Verlag 1995–1997 (2nd ed.). The main reference for Bézier, B-Spline and NURBS; chapters on mathematical representation and construction of curves and surfaces, interpolation, shape modification, programming concepts.
- Dr. Thomas Sederberg, BYU NURBS, http://cagd.cs.byu.edu/~557/text/ch5.pdf
- Dr. Lyle Ramshaw. Blossoming: A connect-the-dots approach to splines, Research Report 19, Compaq Systems Research Center, Palo Alto, CA, June 1987
- David F. Roger: An Introduction to NURBS with Historical Perspective, Morgan Kaufmann Publishers 2001. Good elementary book for NURBS and related issues.
- Foley, van Dam, Feiner & Hughes: Computer Graphics - Principles and Practice, Addison Wesley 1996 (2nd ed.).
This article may require cleanup to meet Wikipedia's quality standards. Please improve this article if you can. (September 2006) |
[edit] External links
- About Nonuniform Rational B-Splines - NURBS
- An Interactive Introduction to Splines
- http://www.cs.bris.ac.uk/Teaching/Resources/COMS30115/all_9.pdf
- http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html
- http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/AV0405/DONAVANIK/bezier.html
- http://mathcs.holycross.edu/~croyden/csci343/notes/Lecture33_CurvesIII.ppt