BSplineCurve
BSplineCurve[{pt1,pt2,…}]
is a graphics primitive that represents a nonuniform rational B-spline curve with control points pti.
Details and Options
- BSplineCurve is also known as basis spline curve or nonuniform rational B-spline (NURBS) curve.
- BSplineCurve can be used in both Graphics and Graphics3D (two‐ and three‐dimensional graphics).
- The positions of control points can be specified either in ordinary coordinates as {x,y} or {x,y,z}, or in scaled coordinates as Scaled[{x,y}] or Scaled[{x,y,z}].
- In two dimensions, Offset and ImageScaled can be used to specify coordinates.
- The following options can be given:
-
SplineDegree Automatic degree of polynomial basis SplineKnots Automatic knot sequence for spline SplineWeights Automatic control point weights SplineClosed False whether to make the spline closed - By default, BSplineCurve uses cubic splines.
- The option setting 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 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 SplineWeights->Automatic, all control points are chosen to have equal weights, corresponding to a polynomial B-spline curve.
- Curve thickness can be specified using Thickness or AbsoluteThickness, as well as Thick and Thin.
- Curve dashing can be specified using Dashing or AbsoluteDashing, as well as Dashed, Dotted, etc.
- Curve shading or coloring can be specified using CMYKColor, GrayLevel, Hue, Opacity, or RGBColor.
- Individual coordinates and lists of coordinates in BSplineCurve can be Dynamic objects.
Examples
open allclose allBasic Examples (1)
Scope (12)
Curve Specification (5)
Curve Styling (4)
Coordinate Specification (3)
Generalizations & Extensions (4)
Knot Sequence (3)
By default, knots are generated in such a way that the curve is smooth overall:
By repeating knots, you can decrease the smoothness of the curve:
"Unclamped" generates uniform knots, and the curve will not go through the endpoints:
Unclamped knots combined with SplineClosed will make a uniform periodic B-spline curve:
Applications (5)
Interpolation (2)
Choose six points to be interpolated:
Compute distances between control points:
Compute normalized parameters wrt the distances (chord length parametrization):
A cubic B-spline curve with clamped knots will be used:
Set up the square basis matrix to solve:
Solve the linear system to get control points:
Show the interpolating curve with the original data:
Choose 3D points to be interpolated:
Compute distances between control points:
Compute normalized parameters wrt the distances (chord length parametrization):
A cubic B-spline curve with clamped knots will be used:
Set up the square basis matrix to solve:
Least Square Fitting (1)
Sample a list of points to be approximated with random noise:
Define a function to generate clamped knots for a given number of control points and degrees:
Define the basis matrix for least squares:
A cubic B-spline curve with 12 control points will be used for fitting:
Properties & Relations (6)
A B-spline curve with degree 1 is equivalent to a line:
A B-spline curve is affine invariant:
A B-spline curve lies in the union of convex hulls of subsets of control points:
In 3D, a B-spline curve with planar control points lies in the plane:
BSplineBasis can be used to build up B-spline curve objects:
The individual basis functions have bounded support:
Changing the knots affects the basis functions just as it does the BSplineCurve:
A B-spline curve generated from the average of two sets of control points:
Text
Wolfram Research (2008), BSplineCurve, Wolfram Language function, https://reference.wolfram.com/language/ref/BSplineCurve.html.
CMS
Wolfram Language. 2008. "BSplineCurve." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BSplineCurve.html.
APA
Wolfram Language. (2008). BSplineCurve. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BSplineCurve.html