De Casteljau's algorithm can be extended to handle Bézier surfaces. More precisely, de Casteljau's algorithm can be applied several times to find the corresponding point on a Bézier surface p(u,v) given (u,v). This page describes such as extension, which is based on the concept of isoparametric curves discussed in the previous page.
Recall that the equation of a Bézier surface
can be rewritten as the following
For i = 0, 1, ..., m define q_{i}(v) as follows:
For a fixed v, we have m+1 points q_{0}(v), q_{1}(v), ..., q_{m}(v). Each q_{i}(v) is a point on the Bézier curve defined by control points p_{i0}, p_{i1}, ..., p_{in}. Plugging these back into the surface equation yields
This means p(u,v) is a point of the Bézier curve defined by m+1 control points q_{0}(v), q_{1}(v), ..., q_{m}(v). Thus, we have the following conclusion:
To find point p(u,v) on a Bézier surface, we can find m+1 points q_{0}(v), q_{1}(v), ..., q_{m}(v) and then from these points find p(u,v).
This conclusion gives us a simple way for computing p(u,v) given (u,v). Here is why. Since each q_{i}(v) is a point on the Bézier curve defined by the i-th row of control points: p_{i0}, p_{i1}, ..., p_{in}. Therefore, for the i-th row and a given v, we can apply de Casteljau's algorithm for Bézier curve to compute q_{i}(v). After m+1 applications of de Casteljau's algorithm (i.e., one for each row), we shall have q_{0}(v), q_{1}(v), ..., q_{m}(v) in hand. Then, applying de Casteljau's algorithm to these m+1 control points again with u yields the final point p(u,v) on the surface!
The following diagram illustrates this concept. The given surface is a degree (2,2) Bézier surface defined by a 3x3 control net. Suppose u = 2/3 and v = 1/3. To determine q_{0}(1/3), we take the 0-th row of control points p_{00}, p_{01} and p_{02} and apply de Casteljau's algorithm to this Bézier curve with v = 1/3. Repeat this for the first row and the second row with v = 1/3. This yields three intermediate control points q_{0}(1/3), q_{1}(1/3) and q_{2}(1/3). Finally, apply de Casteljau's algorithm to these three new control points with u = 2/3. The result is p(2/3,1/3) which is colored in yellow in the figure.
The following is an example with the given Bézier surface displayed. The control points are shown in white. This control net has four rows and five columns and hence is a degree (3,4) Bézier surface. For each row, the intermediate polylines used for the computation of de Casteljau's algorithm is shown in red. The four intermediate control points q_{0}, q_{1}, q_{2} and q_{3} are shown in the figure. The intermediate polylines used for the computation of this application of de Casteljau's algorithm are shown in blue and the final point p(u,v) on the surface is shown as a red sphere.
Finally, the following summarizes this algorithm: