MbSplineSurface NURBS Surface
Class MbSplineSurface is declared in the surf_spline_surface.h file.
The NURBS surface (NonUniform Rational B-Spline surface) MbSplineSurface is defined by control points SArray<MbCartPoint3D> points[i][j], i = 0, 1, …, vcount − 1, j = 0, 1, …, ucount − 1, conventionally located at the nodes of a rectangular grid with ucount columns and vcount rows, by the weights of the control points given in the table weight[i][j], by the order of B-splines along the first surface parameter udegree, by the order of B-splines along the second surface parameter vdegree, by the knot vector along the first parameter uknots, by the knot vector along the second parameter vknots, and by the flags of the surface periodicity in the first and second parameters uclosed and vclosed. The surface also has some additional data that is optional and is used to speed up the surface methods.
The order of B-splines along the surface parameters coincides with the order of the divided difference used to compute the corresponding B-splines. The knot vectors uknots and vknots are nondecreasing sequences of real numbers and define the domain of the surface parameters and its shape. Let the knot vector uknots contain uknotsCount elements, and let the number of points in each row of the rectangular grid be equal to ucount. For a NURBS surface that is nonperiodic in the first parameter, the numbers of elements in the sets are related by the equality ucount + degree = uknotsCount. For a periodic NURBS surface, the numbers of elements in the sets are related by the equality knotsCount + 2 degree − 1 = knotsCount.
In the PointOn( double u, double v, MbCartPoint3D & s ) method, the radius vector of the surface s is described by the vector function
where \(N_i^{vdegree}(v)\) and \(N_j^{udegree}(u)\) are B-splines.
Fig. 1 shows segments connecting neighboring control points points[i][j].
Fig. 1
Fig. 1 illustrates the conventional arrangement of the control points at the nodes of a rectangular grid. The NURBS surface constructed on the same control points is shown in Fig. 2:
Fig. 2
The curves on the surface s(const, v) and s(u, const) with parameters u = const or v = const are B-curves of degree udegree and vdegree respectively. In the first parameter, the surface has order udegree, and in the second parameter, the surface has order vdegree. The domain of the parameters of a nonperiodic NURBS surface is a rectangle: uknots[udegree − 1] ≤ u ≤ uknots[ucount], vknots[vdegree − 1] ≤ v ≤ vknots[vcount].
The surface can be periodic both in the first parameter and in the second parameter. For a periodically closed surface, the knot vectors uknots and vknots have udegree − 1 and vdegree − 1 additional elements respectively. The domain of the parameters of a NURBS surface that is periodic in both parameters is a rectangle: uknots[udegree − 1] ≤ u ≤ uknots[ucount + udegree − 1], vknots[vdegree − 1] ≤ v ≤ vknots[vcount + vdegree − 1].
Each surface can construct its NURBS copy by the virtual method NurbsSurface( const MbNurbsParameters & uParam, const MbNurbsParameters & vParam ).