({{, (RefLink[BSplineFunction, paclet:ref/BSplineFunction])[{(Subscript[pt, 1]),(Subscript[pt, 2]),…}] 
represents a B-spline function for a curve defined by the control points (Subscript[pt, i]).}, {, (RefLink[BSplineFunction, paclet:ref/BSplineFunction])[array]
represents a B-spline function for a surface or high-dimensional manifold. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[BSplineFunction, paclet:ref/BSplineFunction]) is also known as basis spline, nonuniform rational B-spline (NURBS).

(RefLink[BSplineFunction, paclet:ref/BSplineFunction])[…][u] gives the point on a B-spline curve corresponding to parameter u.

(RefLink[BSplineFunction, paclet:ref/BSplineFunction])[…][u,v,…] gives the point on a general B-spline manifold corresponding to the parameters u, v, ….

The embedding dimension for the curve represented by (RefLink[BSplineFunction, paclet:ref/BSplineFunction])[{(Subscript[pt, 1]),(Subscript[pt, 2]),…}] is given by the length of the lists (Subscript[pt, i]).

(RefLink[BSplineFunction, paclet:ref/BSplineFunction])[array] can handle arrays of any depth, representing manifolds of any dimension.

The dimension of the manifold represented by (RefLink[BSplineFunction, paclet:ref/BSplineFunction])[array] is given by (RefLink[ArrayDepth, paclet:ref/ArrayDepth])[array]-1. The lengths of the lists that occur at the lowest level in the array define the embedding dimension.

(RefLink[BSplineFunction, paclet:ref/BSplineFunction])[array,d] creates a B-spline function of d variables.

The parameters u, v, … by default run from 0 to 1 over the domain of the curve or other manifold.

The following options can be given:

By default, (RefLink[BSplineFunction, paclet:ref/BSplineFunction]) gives cubic splines.

The option setting (RefLink[SplineDegree, paclet:ref/SplineDegree])->d specifies that the underlying polynomial basis should have maximal degree d.

By default, knots are chosen uniformly in parameter space, with additional knots added so that the curve starts at the first control point and ends at the last one.

With an explicit setting for (RefLink[SplineKnots, paclet:ref/SplineKnots]), the degree of the polynomial basis is determined from the number of knots specified and the number of control points.

With the default setting (RefLink[SplineWeights, paclet:ref/SplineWeights])->(RefLink[Automatic, paclet:ref/Automatic]), all control points are chosen to have equal weights, corresponding to a polynomial B-spline function.

With the setting (RefLink[SplineClosed, paclet:ref/SplineClosed])->{(Subscript[c, 1]),(Subscript[c, 2]),…}, the boundaries are connected in directions i for which (Subscript[c, i]) is (RefLink[True, paclet:ref/True]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Construct a B-spline curve using a list of control points:

pts={{1,1},{2,3},{3,-1},{4,1},{5,0}};

f=BSplineFunction[pts]

Apply the function to find a point on the curve:

f[.5]

Plot the B-spline curve with the control points:

Show[Graphics[{Red,Point[pts],Green,Line[pts]},Axes->True],ParametricPlot[f[t],{t,0,1}]]

Construct a B-spline surface closed in the u-direction:

pts=Table[{ Cos[2Pi u/6]Cos[v],Sin[2Pi u/6]Cos[v],v},{u,6},{v,-1,1,1/2}];

f=BSplineFunction[pts,SplineClosed->{True,False}]

Show the surface with the control points:

Show[Graphics3D[{PointSize[Medium],Red,Map[Point,pts]}],Graphics3D[{Gray,Line[pts],Gray,Line[Transpose[pts]]}],ParametricPlot3D[f[u,v],{u,0,1},{v,0,1}]]

OpenersExampleSection1(Spacer1)Scope  (4)

Create a vector-valued function of dimension 2:

f=BSplineFunction[RandomReal[1,{10,2}]]

f[.5]

ParametricPlot[f[u],{u,0,1}]

Create a vector-valued function of dimension 3:

pts=Table[{i,RandomReal[10],RandomReal[10]},{i,10}];

g=BSplineFunction[RandomReal[1,{10,3}]]

g[.5]

ParametricPlot3D[g[u],{u,0,1}]

Generate a two-variable function:

f=BSplineFunction[RandomReal[1,{10,10,1}]]

f[0.5,0.5]

Plot3D[f[x,y],{x,0,1},{y,0,1}]

Generate a three-variable function:

f=BSplineFunction[RandomReal[1,{5,5,5,1}]]

f[.5,.5,.5]

ContourPlot3D[f[u,v,w],{u,0,1},{v,0,1},{w,0,1},Mesh->None]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (1)

(RefLink[SparseArray, paclet:ref/SparseArray]) can be used with (RefLink[BSplineFunction, paclet:ref/BSplineFunction]):

pts=SparseArray[{i_,j_}/;Abs[i-j]<3:>Cos[Abs[i-j]],{6,6}]

f=BSplineFunction[pts,2]

Plot3D[f[u,v],{u,0,1},{v,0,1}]

OpenersExampleSection3(Spacer1)Options  (2)

OpenersExampleSubsection0(Spacer1)SplineDegree  (2)

Make line segments:

pts=RandomReal[1,{10,2}];

ParametricPlot[BSplineFunction[pts,SplineDegree->1][u],{u,0,1}]

Make a quadratic B-spline curve:

ParametricPlot[BSplineFunction[pts,SplineDegree->2][u],{u,0,1}]

Degrees can be specified in each parametric direction separately:

pts=RandomReal[1,{7,5,1}];

Plot3D[BSplineFunction[pts,SplineDegree->{1,3}][u,v],{u,0,1},{v,0,1},Mesh->None]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[BezierFunction, paclet:ref/BezierFunction])  ▪  (RefLink[InterpolatingFunction, paclet:ref/InterpolatingFunction])  ▪  (RefLink[BSplineBasis, paclet:ref/BSplineBasis])  ▪  (RefLink[BSplineCurve, paclet:ref/BSplineCurve])  ▪  (RefLink[BSplineSurface, paclet:ref/BSplineSurface])  ▪  (RefLink[Piecewise, paclet:ref/Piecewise])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Splines, paclet:guide/Splines])}, {▪(RefLinkPlain[Curve Fitting & Approximate Functions, paclet:guide/CurveFittingAndApproximateFunctions])}})}})