Tuesday, 22 May 2012

Non-uniform rational B-spline

Non-uniform rational base spline (NURBS) is a algebraic archetypal frequently acclimated in computer cartoon for breeding and apery curves and surfaces which offers abundant adaptability and attention for administration both analytic (surfaces authentic by accepted algebraic formulae) and modeled shapes.

History


Development of NURBS began in the 1950s by engineers who were in charge of a mathematically absolute representation of freeform surfaces like those acclimated for address hulls, aerospace exoteric surfaces, and car bodies, which could be absolutely reproduced whenever technically needed. Prior representations of this affectionate of apparent alone existed as a individual concrete archetypal created by a designer.

The antecedents of this development were Pierre Bézier who formed as an architect at Renault, and Paul de Casteljau who formed at Citroën, both in France. Bézier formed about alongside to de Casteljau, neither alive about the plan of the other. But because Bézier appear the after-effects of his work, the boilerplate computer cartoon user today recognizes splines — which are represented with ascendancy credibility lying off the ambit itself — as Bézier splines, while de Casteljau’s name is alone accepted and acclimated for the algorithms he developed to appraise parametric surfaces. In the 1960s it became bright that non-uniform, rational B-splines are a generalization of Bézier splines, which can be admired as uniform, non-rational B-splines.

At aboriginal NURBS were alone acclimated in the proprietary CAD bales of car companies. Later they became allotment of accepted computer cartoon packages.

Real-time, alternate apprehension of NURBS curves and surfaces was aboriginal fabricated accessible on Silicon Cartoon workstations in 1989. In 1993, the aboriginal alternate NURBS modeller for PCs, alleged NöRBS, was developed by CAS Berlin, a baby startup aggregation allied with the Technical University of Berlin. Today a lot of able computer cartoon applications accessible for desktop use action NURBS technology, which is a lot of generally accomplished by amalgam a NURBS engine from a specialized company.

Use


NURBS are frequently acclimated in computer-aided architecture (CAD), accomplishment (CAM), and engineering (CAE) and are allotment of abundant industry advanced acclimated standards, such as IGES, STEP, ACIS, and PHIGS. NURBS accoutrement are aswell begin in assorted 3D modelling and action software packages.

They acquiesce representation of geometrical shapes in a bunched form. They can be calmly handled by the computer programs and yet acquiesce for simple animal interaction. NURBS surfaces are functions of two ambit mapping to a apparent in three-dimensional space. The appearance of the apparent is bent by ascendancy points.

In general, alteration NURBS curves and surfaces is awful automatic and predictable. Ascendancy credibility are consistently either affiliated anon to the curve/surface, or act as if they were affiliated by a elastic band. Depending on the blazon of user interface, alteration can be accomplished via an element’s ascendancy points, which are a lot of accessible and accepted for Bézier curves, or via college akin accoutrement such as spline clay or hierarchical editing.

A apparent beneath construction, e.g. the bark of a motor yacht, is usually composed of several NURBS surfaces accepted as patches. These patches should be adapted calm in such a way that the boundaries are invisible. This is mathematically bidding by the abstraction of geometric continuity.

Higher-level accoutrement abide which account from the adeptness of NURBS to actualize and authorize geometric chain of altered levels:

Positional chain (G0)

holds whenever the end positions of two curves or surfaces are coincidental. The curves or surfaces may still accommodated at an angle, giving acceleration to a aciculate bend or bend and causing torn highlights.

Tangential chain (G1)

requires the end vectors of the curves or surfaces to be parallel, cardinal out aciculate edges. Because highlights falling on a tangentially connected bend are consistently connected and appropriately attending natural, this akin of chain can generally be sufficient.

Curvature chain (G2)

further requires the end vectors to be of the aforementioned breadth and amount of breadth change. Highlights falling on a curvature-continuous bend do not affectation any change, causing the two surfaces to arise as one. This can be visually accustomed as “perfectly smooth”. This akin of chain is actual advantageous in the conception of models that crave abounding bi-cubic patches basic one connected surface.

Geometric chain mainly refers to the appearance of the consistent surface; back NURBS surfaces are functions, it is aswell accessible to altercate the derivatives of the apparent with account to the parameters. This is accepted as parametric continuity. Parametric chain of a accustomed amount implies geometric chain of that degree.

First- and second-level parametric chain (C0 and C1) are for applied purposes identical to positional and borderline (G0 and G1) continuity. Third-level parametric chain (C2), however, differs from curvature chain in that its parameterization is aswell continuous. In practice, C2 chain is easier to accomplish if compatible B-splines are used.

The analogue of the chain 'Cn' requires that the nth acquired of the curve/surface () are according at a joint.1 Note that the (partial) derivatives of curves and surfaces are vectors that accept a administration and a magnitude. Both should be equal.

Highlights and reflections can acknowledge the absolute smoothing, which is contrarily about absurd to accomplish after NURBS surfaces that accept at atomic G2 continuity. This aforementioned assumption is acclimated as one of the apparent appraisal methods whereby a ray-traced or reflection-mapped angel of a apparent with white stripes absorption on it will appearance even the aboriginal deviations on a apparent or set of surfaces. This adjustment is acquired from car prototyping wherein apparent superior is inspected by blockage the superior of reflections of a neon-light beam on the car surface. This adjustment is aswell accepted as "Zebra analysis".

Technical specifications


A NURBS ambit is authentic by its order, a set of abounding ascendancy points, and a bond vector. NURBS curves and surfaces are generalizations of both B-splines and Bézier curves and surfaces, the primary aberration getting the weighting of the ascendancy credibility which makes NURBS curves rational (non-rational B-splines are a appropriate case of rational B-splines). Whereas Bézier curves advance into alone one parametric direction, usually alleged s or u, NURBS surfaces advance into two parametric directions, alleged s and t or u and v.

By evaluating a Bézier or a NURBS ambit at assorted ethics of the parameter, the ambit can be represented in Cartesian two- or three-dimensional space. Likewise, by evaluating a NURBS apparent at assorted ethics of the two parameters, the apparent can be represented in Cartesian space.

NURBS curves and surfaces are advantageous for a amount of reasons:

They are invariant beneath affine2 as able-bodied as perspective3 transformations: operations like rotations and translations can be activated to NURBS curves and surfaces by applying them to their ascendancy points.

They action one accepted algebraic anatomy for both accepted analytic shapes (e.g., conics) and free-form shapes.

They accommodate the adaptability to architecture a ample array of shapes.

They abate the anamnesis burning if autumn shapes (compared to simpler methods).

They can be evaluated analytic bound by numerically abiding and authentic algorithms.

In the next sections, NURBS is discussed in one ambit (curves). It should be acclaimed that all of it can be ambiguous to two or even added dimensions.

Control points


The ascendancy credibility actuate the appearance of the curve. Typically, anniversary point of the ambit is computed by demography a abounding sum of a amount of ascendancy points. The weight of anniversary point varies according to the administering parameter. For a ambit of amount d, the weight of any ascendancy point is alone nonzero in d+1 intervals of the connected space. Aural those intervals, the weight changes according to a polynomial action (basis functions) of amount d. At the boundaries of the intervals, the base functions go calmly to zero, the accuracy getting bent by the amount of the polynomial.

As an example, the base action of amount one is a triangle function. It rises from aught to one, afresh avalanche to aught again. While it rises, the base action of the antecedent ascendancy point falls. In that way, the ambit interpolates amid the two points, and the consistent ambit is a polygon, which is continuous, but not differentiable at the breach boundaries, or knots. College amount polynomials accept appropriately added connected derivatives. Note that aural the breach the polynomial attributes of the base functions and the breadth of the architecture accomplish the ambit altogether smooth, so it is alone at the knots that aperture can arise.

The actuality that a alone ascendancy point alone influences those intervals area it is alive is a awful adorable property, accepted as bounded support. In modeling, it allows the alteration of one allotment of a apparent while befitting added locations equal.

Adding added ascendancy credibility allows bigger approximation to a accustomed curve, although alone a assertive chic of curves can be represented absolutely with a bound amount of ascendancy points. NURBS curves aswell affection a scalar weight for anniversary ascendancy point. This allows for added ascendancy over the appearance of the ambit after disproportionately adopting the amount of ascendancy points. In particular, it adds cone-shaped sections like circles and ellipses to the set of curves that can be represented exactly. The appellation rational in NURBS refers to these weights.

The ascendancy credibility can accept any dimensionality. One-dimensional credibility just ascertain a scalar action of the parameter. These are about acclimated in angel processing programs to tune the accuracy and blush curves. Three-dimensional ascendancy credibility are acclimated abundantly in 3D modeling, area they are acclimated in the accustomed acceptation of the chat 'point', a area in 3D space. Multi-dimensional credibility ability be acclimated to ascendancy sets of time-driven values, e.g. the altered positional and rotational settings of a apprentice arm. NURBS surfaces are just an appliance of this. Anniversary ascendancy 'point' is in fact a abounding agent of ascendancy points, defining a curve. These curves allotment their amount and the amount of ascendancy points, and amount one ambit of the connected space. By interpolating these ascendancy vectors over the added ambit of the connected space, a connected set of curves is obtained, defining the surface.

editThe bond vector

The bond agent is a arrangement of connected ethics that determines area and how the ascendancy credibility affect the NURBS curve. The amount of knots is consistently according to the amount of ascendancy credibility additional ambit amount bare one. The bond agent divides the parametric amplitude in the intervals mentioned before, usually referred to as bond spans. Anniversary time the connected amount enters a new bond span, a new ascendancy point becomes active, while an old ascendancy point is discarded. It follows that the ethics in the bond agent should be in nondecreasing order, so (0, 0, 1, 2, 3, 3) is accurate while (0, 0, 2, 1, 3, 3) is not.

Consecutive knots can accept the aforementioned value. This afresh defines a bond amount of aught length, which implies that two ascendancy credibility are activated at the aforementioned time (and of advance two ascendancy credibility become deactivated). This has appulse on chain of the consistent ambit or its college derivatives; for instance, it allows the conception of corners in an contrarily bland NURBS curve. A amount of ancillary knots is sometimes referred to as a bond with a assertive multiplicity. Knots with complication two or three are accepted as bifold or amateur knots. The complication of a bond is bound to the amount of the curve; back a college complication would breach the ambit into break locations and it would leave ascendancy credibility unused. For first-degree NURBS, anniversary bond is commutual with a ascendancy point.

The bond agent usually starts with a bond that has complication according to the order. This makes sense, back this activates the ascendancy credibility that accept access on the aboriginal bond span. Similarly, the bond agent usually ends with a bond of that multiplicity. Curves with such bond vectors alpha and end in a ascendancy point.

The alone bond ethics are not allusive by themselves; alone the ratios of the aberration amid the bond ethics matter. Hence, the bond vectors (0, 0, 1, 2, 3, 3) and (0, 0, 2, 4, 6, 6) aftermath the aforementioned curve. The positions of the bond ethics influences the mapping of connected amplitude to ambit space. Rendering a NURBS ambit is usually done by dispatch with a anchored stride through the connected range. By alteration the bond amount lengths, added sample credibility can be acclimated in regions area the curvature is high. Another use is in situations area the connected amount has some concrete significance, for instance if the connected is time and the ambit describes the motion of a apprentice arm. The bond amount lengths afresh construe into dispatch and acceleration, which are capital to get appropriate to anticipate accident to the apprentice arm or its environment. This adaptability in the mapping is what the byword non compatible in NURBS refers to.

Necessary alone for centralized calculations, knots are usually not accessible to the users of clay software. Therefore, abounding clay applications do not accomplish the knots editable or even visible. It's usually accessible to authorize reasonable bond vectors by searching at the aberration in the ascendancy points. Added contempo versions of NURBS software (e.g., Autodesk Maya and Rhinoceros 3D) acquiesce for alternate alteration of bond positions, but this is decidedly beneath automatic than the alteration of ascendancy points.

editOrder

The adjustment of a NURBS ambit defines the amount of adjacent ascendancy credibility that access any accustomed point on the curve. The ambit is represented mathematically by a polynomial of amount one beneath than the adjustment of the curve. Hence, second-order curves (which are represented by beeline polynomials) are alleged beeline curves, third-order curves are alleged boxlike curves, and fourth-order curves are alleged cubic curves. The amount of ascendancy credibility accept to be greater than or according to the adjustment of the curve.

In practice, cubic curves are the ones a lot of frequently used. Fifth- and sixth-order curves are sometimes useful, abnormally for accepting connected college adjustment derivatives, but curves of college orders are about never acclimated because they advance to centralized after problems and tend to crave disproportionately ample adding times.

editConstruction of the base functions

The base functions acclimated in NURBS curves are usually denoted as , in which corresponds to the -th ascendancy point, and corresponds with the amount of the base function.4 The connected assurance is frequently larboard out, so we can address . The analogue of these base functions is recursive in . The degree-0 functions are piecewise connected functions. They are one on the agnate bond amount and aught everywhere else. Effectively, is a beeline departure of and . The closing two functions are non-zero for bond spans, overlapping for bond spans. The action is computed as

From basal to top: Beeline base functions (blue) and (green), their weight functions and and the consistent boxlike base function. The knots are 0, 1, 2 and 2.5

rises linearly from aught to one on the breach area is non-zero, while avalanche from one to aught on the breach area is non-zero. As mentioned before, is a triangular function, nonzero over two bond spans ascent from aught to one on the first, and falling to aught on the additional bond span. College adjustment base functions are non-zero over agnate added bond spans and accept appropriately college degree. If is the parameter, and is the -th knot, we can address the functions and as

and

The functions and are absolute if the agnate lower adjustment base functions are non-zero. By consecration on n it follows that the base functions are non-negative for all ethics of and . This makes the ciphering of the base functions numerically stable.

Again by induction, it can be accepted that the sum of the base functions for a accurate amount of the connected is unity. This is accepted as the allotment of accord acreage of the base functions.

Linear base functions

Quadratic base functions

The abstracts appearance the beeline and the boxlike base functions for the knots {..., 0, 1, 2, 3, 4, 4.1, 5.1, 6.1, 7.1, ...}

One bond amount is appreciably beneath than the others. On that bond span, the aiguille in the boxlike base action is added distinct, extensive about one. Conversely, the abutting base functions abatement to aught added quickly. In the geometrical interpretation, this agency that the ambit approaches the agnate ascendancy point closely. In case of a bifold knot, the breadth of the bond amount becomes aught and the aiguille alcove one exactly. The base action is no best differentiable at that point. The ambit will accept a aciculate bend if the neighbour ascendancy credibility are not collinear.

editGeneral anatomy of a NURBS curve

Using the definitions of the base functions from the antecedent paragraph, a NURBS ambit takes the afterward form:5

In this, is the amount of ascendancy credibility and are the agnate weights. The denominator is a normalizing agency that evaluates to one if all weights are one. This can be apparent from the allotment of accord acreage of the base functions. It is accepted to address this as

in which the functions

are accepted as the rational base functions.

editGeneral anatomy of a NURBS surface

A NURBS apparent is acquired as the tensor artefact of two NURBS curves, appropriately application two absolute ambit and (with indices and respectively)6:

with

Manipulating NURBS objects


A amount of transformations can be activated to a NURBS object. For instance, if some ambit is authentic application a assertive amount and N ascendancy points, the aforementioned ambit can be bidding application the aforementioned amount and N+1 ascendancy points. In the action a amount of ascendancy credibility change position and a bond is amid in the bond vector. These manipulations are acclimated abundantly during alternate design. If abacus a ascendancy point, the appearance of the ambit should break the same, basic the starting point for added adjustments. A amount of these operations are discussed below.7

editKnot insertion

As the appellation suggests, bond admittance inserts a bond into the bond vector. If the amount of the ambit is , again ascendancy credibility are replaced by new ones. The appearance of the ambit stays the same.

A bond can be amid assorted times, up to the best complication of the knot. This is sometimes referred to as bond clarification and can be accomplished by an algorithm that is added able than again bond insertion.

editKnot removal

Knot abatement is the about-face of bond insertion. Its purpose is to abolish knots and the associated ascendancy credibility in adjustment to get a added bunched representation. Obviously, this is not consistently accessible while application the exact appearance of the curve. In practice, a altruism in the accurateness is acclimated to actuate whether a bond can be removed. The action is acclimated to apple-pie up afterwards an alternate affair in which ascendancy credibility may accept been added manually, or afterwards importing a ambit from a altered representation, area a aboveboard about-face action leads to bombastic ascendancy points.

editDegree elevation

A NURBS ambit of a accurate amount can consistently be represented by a NURBS ambit of college degree. This is frequently acclimated if accumulation abstracted NURBS curves, e.g. if creating a NURBS apparent interpolating amid a set of NURBS curves or if accumulation adjoining curves. In the process, the altered curves should be brought to the aforementioned degree, usually the best amount of the set of curves. The action is accepted as amount elevation.

editCurvature

The a lot of important acreage in cogwheel geometry is the curvature . It describes the bounded backdrop (edges, corners, etc.) and relations amid the aboriginal and additional derivative, and thus, the absolute ambit shape. Having bent the derivatives it is simple to compute or approximated as the arclength from the additional acquired . The absolute ciphering of the curvature with these equations is the big advantage of parameterized curves adjoin their polygonal representations.A amount of transformations can be activated to a NURBS object. For instance, if some ambit is authentic application a assertive amount and N ascendancy points, the aforementioned ambit can be bidding application the aforementioned amount and N+1 ascendancy points. In the action a amount of ascendancy credibility change position and a bond is amid in the bond vector. These manipulations are acclimated abundantly during alternate design. If abacus a ascendancy point, the appearance of the ambit should break the same, basic the starting point for added adjustments. A amount of these operations are discussed below.7

editKnot insertion

As the appellation suggests, bond admittance inserts a bond into the bond vector. If the amount of the ambit is , again ascendancy credibility are replaced by new ones. The appearance of the ambit stays the same.

A bond can be amid assorted times, up to the best complication of the knot. This is sometimes referred to as bond clarification and can be accomplished by an algorithm that is added able than again bond insertion.

editKnot removal

Knot abatement is the about-face of bond insertion. Its purpose is to abolish knots and the associated ascendancy credibility in adjustment to get a added bunched representation. Obviously, this is not consistently accessible while application the exact appearance of the curve. In practice, a altruism in the accurateness is acclimated to actuate whether a bond can be removed. The action is acclimated to apple-pie up afterwards an alternate affair in which ascendancy credibility may accept been added manually, or afterwards importing a ambit from a altered representation, area a aboveboard about-face action leads to bombastic ascendancy points.

editDegree elevation

A NURBS ambit of a accurate amount can consistently be represented by a NURBS ambit of college degree. This is frequently acclimated if accumulation abstracted NURBS curves, e.g. if creating a NURBS apparent interpolating amid a set of NURBS curves or if accumulation adjoining curves. In the process, the altered curves should be brought to the aforementioned degree, usually the best amount of the set of curves. The action is accepted as amount elevation.

editCurvature

The a lot of important acreage in cogwheel geometry is the curvature . It describes the bounded backdrop (edges, corners, etc.) and relations amid the aboriginal and additional derivative, and thus, the absolute ambit shape. Having bent the derivatives it is simple to compute or approximated as the arclength from the additional acquired . The absolute ciphering of the curvature with these equations is the big advantage of parameterized curves adjoin their polygonal representations.

Example: a circle


Non-rational splines or Bézier curves may almost a circle, but they cannot represent it exactly. Rational splines can represent any cone-shaped section, including the circle, exactly. This representation is not unique, but one achievability appears below:

x y z weight

1 0 0 1

1 1 0

0 1 0 1

−1 1 0

−1 0 0 1

−1 −1 0

0 −1 0 1

1 −1 0

1 0 0 1

The adjustment is three, back a amphitheater is a boxlike ambit and the spline's adjustment is one added than the amount of its piecewise polynomial segments. The bond agent is . The amphitheater is composed of four division circles, angry calm with bifold knots. Although bifold knots in a third adjustment NURBS ambit would commonly aftereffect in accident of chain in the aboriginal derivative, the ascendancy credibility are positioned in such a way that the aboriginal acquired is continuous. In fact, the ambit is always differentiable everywhere, as it have to be if it absolutely represents a circle.

The ambit represents a amphitheater exactly, but it is not absolutely parametrized in the circle's arc length. This means, for example, that the point at does not lie at (except for the start, average and end point of anniversary division circle, back the representation is symmetrical). This is obvious; the x alike of the amphitheater would contrarily accommodate an exact rational polynomial announcement for , which is impossible. The amphitheater does accomplish one abounding anarchy as its constant goes from 0 to , but this is alone because the bond agent was arbitrarily called as multiples of .