---
title: "BSplineSurface"
language: "en"
type: "Symbol"
summary: "BSplineSurface[array] is a graphics primitive that represents a nonuniform rational B-spline surface defined by an array of x, y, z control points."
keywords: 
- basis spline
- B-spline
- spline surface
- polynomial spline
- rational spline
- uniform spline
- non-uniform spline
- NURBS
- NURBS surface
- surface
- quadratic spline
- cubic spline
- quartic spline
- quintic spline
- knot sequence
- knot vector
- CAD format
- vector 3D graphics
- b-spline triangle
canonical_url: "https://reference.wolfram.com/language/ref/BSplineSurface.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Splines"
    link: "https://reference.wolfram.com/language/guide/Splines.en.md"
  - 
    title: "Graphics Objects"
    link: "https://reference.wolfram.com/language/guide/GraphicsObjects.en.md"
related_functions: 
  - 
    title: "Polygon"
    link: "https://reference.wolfram.com/language/ref/Polygon.en.md"
  - 
    title: "BSplineCurve"
    link: "https://reference.wolfram.com/language/ref/BSplineCurve.en.md"
  - 
    title: "BezierCurve"
    link: "https://reference.wolfram.com/language/ref/BezierCurve.en.md"
  - 
    title: "ParametricPlot3D"
    link: "https://reference.wolfram.com/language/ref/ParametricPlot3D.en.md"
  - 
    title: "BSplineFunction"
    link: "https://reference.wolfram.com/language/ref/BSplineFunction.en.md"
  - 
    title: "BSplineBasis"
    link: "https://reference.wolfram.com/language/ref/BSplineBasis.en.md"
---
# BSplineSurface

BSplineSurface[array] is a graphics primitive that represents a nonuniform rational B-spline surface defined by an array of $x,y,z$ control points.

## Details and Options

* ``BSplineSurface`` is also known as basis spline surface and nonuniform rational B-spline (NURBS) surface.

* ``BSplineSurface`` can be used in ``Graphics3D`` (three-dimensional graphics).

* The positions of control points can be specified either in ordinary coordinates as ``{x, y, z}``, or in scaled coordinates as ``Scaled[{x, y, z}]``.

* The following options can be given:

|                |           |                                    |
| -------------- | --------- | ---------------------------------- |
| SplineDegree   | Automatic | degree of polynomial basis         |
| SplineKnots    | Automatic | knot sequence in each dimension    |
| SplineWeights  | Automatic | control point weights              |
| SplineClosed   | False     | whether to make the surface closed |

* By default, ``BSplineSurface`` uses bicubic splines, corresponding to degree $\{3,3\}$.

* The option ``SplineDegree -> d`` specifies maximal degree ``d`` in each direction. ``SplineDegree -> {d1, d2}`` specifies different maximal degrees in the two directions within the surface.

* By default, knots are chosen to be uniform and to make the surface reach the control points at the edges of the array.

* ``SplineKnots -> {list1, list2}`` specifies sequences of knots to use for the rows and columns of the array of control points.

* 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.

* ``SplineWeights`` are automatically chosen to be 1, corresponding to a polynomial B-spline surface.

* ``FaceForm`` and ``EdgeForm`` can be used to specify how the interiors and boundaries of ``BSplineSurface`` objects should be rendered.

* You can use graphics directives such as ``GrayLevel``, ``RGBColor``, and ``Opacity`` to specify how ``BSplineSurface`` objects should be rendered.

* You can specify surface material properties using the graphics directives ``Specularity`` and ``Opacity``.

* You can use ``FaceForm[front, back]`` to specify different properties for front and back faces.

* Individual coordinates and lists of coordinates in ``BSplineSurface`` can be ``Dynamic`` objects.

---

## Examples (21)

### Basic Examples (1)

A B-spline surface for an array of control points:

```wl
In[1]:= cpts = Table[{i, j, RandomReal[{-1, 1}]}, {i, 5}, {j, 5}];

In[2]:= b = Graphics3D[BSplineSurface[cpts]]

Out[2]= [image]
```

Show the control points together with the B-spline surface:

```wl
In[3]:= Show[Graphics3D[{PointSize[Medium], Red, Map[Point, cpts], Gray, Line[cpts], Line[Transpose[cpts]]}], b]

Out[3]= [image]
```

### Scope (17)

#### Graphics (11)

##### Specification (5)

A B-spline surface:

```wl
In[1]:= Graphics3D[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]]

Out[1]= [image]
```

---

B-spline surface with the same control points and different degrees:

```wl
In[1]:= pts = Table[{i, (-1) ^ i}, {i, 6}];

In[2]:= Table[Graphics3D[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}, SplineDegree -> d]], {d, 1, 4}]

Out[2]= {[image], [image], [image], [image]}
```

---

By default, a B-spline surface is open:

```wl
In[1]:= Graphics3D[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]]

Out[1]= [image]
```

A closed B-spline surface automatically adds the first control points at the end:

```wl
In[2]:= Graphics3D[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}, SplineClosed -> True]]

Out[2]= [image]
```

---

Knots can be explicitly specified to control the smoothness of a surface:

```wl
In[1]:= pts = {{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}};

In[2]:= Graphics3D[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}, SplineKnots -> {{0, 0, 0, 1, 1, 2}, {0, 0, 0, 1, 1, 2}}, SplineWeights -> {{1, 1 / Sqrt[2], 1}, {1 / Sqrt[2], 1, 1 / Sqrt[2]}, {1, 1 / Sqrt[2], 1}}]]

Out[2]= [image]
```

---

Weights can be specified to each point:

```wl
In[1]:= pts = {{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}};

In[2]:= Graphics3D[{BSplineSurface[pts, SplineWeights -> {{1, 1 / Sqrt[2], 1}, {1 / Sqrt[2], 1, 1 / Sqrt[2]}, {1, 1 / Sqrt[2], 1}}], PointSize[Medium], Red, Map[Point, pts], Gray, Line[pts], Line[Transpose[pts]]}]

Out[2]= [image]
```

##### Styling (4)

B-spline surface edges with different thicknesses:

```wl
In[1]:= Table[Graphics3D[{EdgeForm[Thickness[i]], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {i, {Tiny, Small, Medium, Large}}]

Out[1]= {[image], [image], [image], [image]}

In[2]:= Table[Graphics3D[{EdgeForm[t], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {t, {Thin, Thick}}]

Out[2]= {[image], [image]}
```

---

Thickness in scaled size:

```wl
In[1]:= Table[Graphics3D[{EdgeForm[Thickness[i]], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {i, {.005, .05, .1}}]

Out[1]= {[image], [image], [image]}
```

Thickness in printer's points:

```wl
In[2]:= Table[Graphics3D[{EdgeForm[AbsoluteThickness[i]], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {i, {1, 5, 10}}]

Out[2]= {[image], [image], [image]}
```

---

Dashed surface edges:

```wl
In[1]:= Table[Graphics3D[{EdgeForm[Dashing[i]], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {i, {Tiny, Small, Medium, Large}}]

Out[1]= {[image], [image], [image], [image]}

In[2]:= Table[Graphics3D[{EdgeForm[d], BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {d, {Dotted, Dashed, DotDashed}}]

Out[2]= {[image], [image], [image]}
```

---

Colored surfaces:

```wl
In[1]:= Table[Graphics3D[{c, BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}]}], {c, {Red, Green, Blue, Yellow}}]

Out[1]= {[image], [image], [image], [image]}
```

##### Coordinates (2)

Use ``Scaled`` coordinates:

```wl
In[1]:= Graphics3D[BSplineSurface[{{Scaled[{1, 1, 0}], Scaled[{1, 2, 0}], Scaled[{0, 1, 1}]}, {Scaled[{1, -1, 0}], Scaled[{0, 1, 0}], Scaled[{-1, 1, 0}]}, {Scaled[{1, -1, 0}], Scaled[{-1, -1, 6}], Scaled[{-1, 3, 0}]}}], PlotRange -> 2, Boxed -> True]

Out[1]= [image]
```

---

Use ``ImageScaled`` coordinates in 3D:

```wl
In[1]:= Graphics3D[BSplineSurface[{{ImageScaled[{1, 1, 0}], ImageScaled[{1, 2, 0}], ImageScaled[{0, 1, 1}]}, {ImageScaled[{1, -1, 0}], ImageScaled[{0, 1, 0}], ImageScaled[{-1, 1, 0}]}, {ImageScaled[{1, -1, 0}], ImageScaled[{-1, -1, 6}], ImageScaled[{-1, 3, 0}]}}], PlotRange -> 2, Boxed -> True]

Out[1]= [image]
```

#### Regions (6)

Embedding dimension:

```wl
In[1]:= RegionEmbeddingDimension[BSplineSurface[{{{Subscript[a, 1], Subscript[a, 2]}, {Subscript[a, 3], Subscript[ca, 4]}, {Subscript[a, 5], Subscript[a, 6]}}, {{Subscript[b, 1], Subscript[b, 2]}, {Subscript[b, 3], Subscript[b, 4]}, {Subscript[b, 5], Subscript[cb, 6]}}, {{Subscript[c, 1], Subscript[c, 2]}, {Subscript[c, 3], Subscript[c, 4]}, {Subscript[c, 5], Subscript[c, 6]}}}]]

Out[1]= 3
```

Geometric dimension:

```wl
In[2]:= RegionDimension[BSplineSurface[{{{Subscript[a, 1], Subscript[a, 2]}, {Subscript[a, 3], Subscript[ca, 4]}, {Subscript[a, 5], Subscript[a, 6]}}, {{Subscript[b, 1], Subscript[b, 2]}, {Subscript[b, 3], Subscript[b, 4]}, {Subscript[b, 5], Subscript[cb, 6]}}, {{Subscript[c, 1], Subscript[c, 2]}, {Subscript[c, 3], Subscript[c, 4]}, {Subscript[c, 5], Subscript[c, 6]}}}]]

Out[2]= 2
```

---

Point membership test:

```wl
In[1]:= {RegionMember[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}], {1, 1, 0}], RegionMember[BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}], {1, 2, 3}]}

Out[1]= {True, False}
```

---

Area:

```wl
In[1]:= ℛ = BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}];

In[2]:= {Area[ℛ], RegionMeasure[ℛ]}

Out[2]= {4.75197, 4.75197}
```

Centroid:

```wl
In[3]:= c = RegionCentroid[ℛ]

Out[3]= {0.0129413, 0.19209, 0.335623}

In[4]:= Graphics3D[{{Yellow, ℛ}, {Red, Point[c]}}]

Out[4]= [image]
```

---

Distance from a point:

```wl
In[1]:= ℛ = BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}];

In[2]:= {RegionDistance[ℛ, {1, 1, 0}], RegionDistance[ℛ, {0, 0, 0}]}

Out[2]= {4.132432866707431`*^-10, 0.319211}
```

---

Signed distance from a point:

```wl
In[1]:= ℛ = BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}];

In[2]:= {SignedRegionDistance[ℛ, {1, 1, 0}], SignedRegionDistance[ℛ, {0, 0, 0}]}

Out[2]= {4.132432866707431`*^-10, 0.319211}
```

---

A B-spline surface is bounded:

```wl
In[1]:= ℛ = BSplineSurface[{{{1, 1, 0}, {1, 2, 0}, {0, 1, 1}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 2}, {-1, 0, 0}}}];

In[2]:= BoundedRegionQ[ℛ]

Out[2]= True
```

Get its range:

```wl
In[3]:= rr = RegionBounds[ℛ]

Out[3]= {{-1., 1.}, {-1., 1.49986}, {2.8727378164271886`*^-16, 1.}}

In[4]:= Graphics3D[{{EdgeForm[Directive[Dashed, Red]], Opacity[0.1], Yellow, Cuboid@@Transpose[rr]}, ℛ}]

Out[4]= [image]
```

### Options (2)

#### SplineKnots (1)

Create a 3D disk using ``BSplineSurface`` :

```wl
In[1]:= Graphics3D[BSplineSurface[{{{1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 0}, {-1, 0, 0}}}, SplineKnots -> {{0, 0, 0, 1, 1, 2}, {0, 0, 0, 1, 1, 2}}, SplineWeights -> {{1, 1 / Sqrt[2], 1}, {1 / Sqrt[2], 1, 1 / Sqrt[2]}, {1, 1 / Sqrt[2], 1}}]]

Out[1]= [image]
```

#### SplineWeights (1)

Create a 3D disk using ``BSplineSurface`` :

```wl
In[1]:= Graphics3D[BSplineSurface[{{{1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, {{1, -1, 0}, {0, 0, 0}, {-1, 1, 0}}, {{0, -1, 0}, {-1, -1, 0}, {-1, 0, 0}}}, SplineKnots -> {{0, 0, 0, 1, 1, 2}, {0, 0, 0, 1, 1, 2}}, SplineWeights -> {{1, 1 / Sqrt[2], 1}, {1 / Sqrt[2], 1, 1 / Sqrt[2]}, {1, 1 / Sqrt[2], 1}}]]

Out[1]= [image]
```

### Applications (1)

Pipe section using a B-spline surface with weights:

```wl
In[1]:=
pts = {{{0.5, 0, -0.5}, {0, 0, -0.5}, {0, 1, -0.5}, {0.5, 1, -0.5}, {1, 1, -0.5}, {1, 0, -0.5}, {0.5, 0, -0.5}}, 
{{0.5, 0, 0.7}, {0, 0, 0.7}, {0, 1, 0.7}, {0.5, 1, 0.7}, {1, 1, 0.7}, {1, 0, 0.7}, {0.5, 0, 0.7}}, 
{{0.5, 0, 0.9}, {0, 0, 0.9}, {0, 1, 1.5}, {0.5, 1, 1.5}, {1, 1, 1.5}, {1, 0, 0.9}, {0.5, 0, 0.9}}, 
{{0.5, -0.1, 1}, {0, -0.1, 1}, {0, 0.5, 2}, {0.5, 0.5, 2}, {1, 0.5, 2}, {1, -0.1, 1}, {0.5, -0.1, 1}}, 
{{0.5, -0.3, 1}, {0, -0.3, 1}, {0, -0.3, 2}, {0.5, -0.3, 2}, {1, -0.3, 2}, {1, -0.3, 1}, {0.5, -0.3, 1}}, 
{{0.5, -1.5, 1}, {0, -1.5, 1}, {0, -1.5, 2}, {0.5, -1.5, 2}, {1, -1.5, 2}, {1, -1.5, 1}, {0.5, -1.5, 1}}};w = {{1, .5, .5, 1, .5, .5, 1}, {1, .5, .5, 1, .5, .5, 1}, {1, .5, .5, 1, .5, .5, 1}, {1, .5, .5, 1, .5, .5, 1}, {1, .5, .5, 1, .5, .5, 1}, {1, .5, .5, 1, .5, .5, 1}};
uk = {0, 0, 0, 1 / 4, 1 / 2, 3 / 4, 1, 1, 1};
vk = {0, 0, 0, 1 / 4, 1 / 2, 1 / 2, 3 / 4, 1, 1, 1};

In[2]:=
Graphics3D[{
	FaceForm[Yellow, Blue], 
	BSplineSurface[pts, SplineKnots -> {uk, vk}, SplineDegree -> 2, SplineWeights -> w, SplineClosed -> {False, True}]}, ViewPoint -> {Right, Front}, Boxed -> False]

Out[2]= [image]
```

## See Also

* [`Polygon`](https://reference.wolfram.com/language/ref/Polygon.en.md)
* [`BSplineCurve`](https://reference.wolfram.com/language/ref/BSplineCurve.en.md)
* [`BezierCurve`](https://reference.wolfram.com/language/ref/BezierCurve.en.md)
* [`ParametricPlot3D`](https://reference.wolfram.com/language/ref/ParametricPlot3D.en.md)
* [`BSplineFunction`](https://reference.wolfram.com/language/ref/BSplineFunction.en.md)
* [`BSplineBasis`](https://reference.wolfram.com/language/ref/BSplineBasis.en.md)

## Related Guides

* [`Splines`](https://reference.wolfram.com/language/guide/Splines.en.md)
* [Graphics Objects](https://reference.wolfram.com/language/guide/GraphicsObjects.en.md)

## History

* [Introduced in 2008 (7.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn70.en.md)