Once you know de Casteljau's algorithm for Bézier surfaces, de Boor's algorithm for B-spline surface and its modification for NURBS surfaces is only a small step away. In fact, with the local modification property in hand, de Boor's algorithm looks very similar to de Casteljau's algorithm. If the equation of a B-spline surface is rewritten as follows:
then for a fixed i, the curve in the parenthesis is simply a B-spline curve defined by the control points on row i. To simplify our discussion, let q_{i}(v) be defined as follows:
Therefore, q_{i}(v) is a point corresponding to v on the B-spline curve defined by the control points of row i. If v is in knot span [v_{d},v_{d+1}), then only q+1 control points on row i are involved in the computation of q_{i}(v), where q is the degree of N_{j,q}(v). These control points are p_{i,d}, p_{i,d-1}, ..., p_{i,d-q}, if v is not equal to v_{d}. Otherwise, if v is equal to v_{d}, a knot of multiplicity t, then the involved control points are p_{i,d-t}, p_{i,d-t-1}, ..., p_{i,d-q}. Therefore, using the control points from column d-q to column d-t, where t is zero if v is not a knot, we can apply de Boor's algorithm to each row to obtain m+1 new points q_{0}(v), q_{1}(v), ..., q_{m}(v). This is shown in the following diagram.
Plugging these new points back into the surface equation we have the following
Therefore, p(u,v) is a point on the B-spline curve defined by q_{0}(v), q_{1}(v), ..., q_{m}(v). As a result, to find p(u,v), what we need to do is to find the point on this curve that corresponds to u. Hence, de Boor's algorithm can be used again for this purpose.
Let u be in knot span [u_{c},u_{c+1}). From the local modification property, only p+1 control points will participate the computation, where p is the degree of the B-spline curve. Thus, if u is not equal to u_{c}, the involved points are q_{c}(v), q_{c-1}(v), ...., q_{c-p}(v). Otherwise, if u is equal to u_{c}, a knot of multiplicity s, the involved points are q_{c-s}(v), q_{c-s-1}(v), ..., q_{c-p}(v). Based on this observation, even though each row of control points can produce a q_{i}(v), not all of them are needed. In fact, only p+1 rows are needed. This is illustrated by the following diagram:
In summary, given u in [u_{c},u_{c+1}) and v in [v_{d},v_{d+1}), p(u,v), for row i in the range of c-p and c-s, applying de Boor's algorithm to control points p_{i,d-q}, p_{i,d-q+1}, ..., p_{i,d-t} yields a new point q_{i}(v). Then, apply de Boor's algorithm to q_{c-p}(v), q_{c-p+1}(v), ..., q_{c-s}(v) and the result is p(u,v)!
The following summarizes this finding:
The following figure shows an example. This B-spline surface is defined by 5×5 control points and knot vector (in both directions) { 0, 0, 0, 0, 0.5, 1, 1, 1, 1 }. Thus, the degree in both directions is 3.
In this figure, both u and v are not knots and u is less than 0.5 while v is larger than 0.5. For this v, since it is in [0.5, 1), only control points p_{i,1}, p_{i,2}, p_{i,3} and p_{i,4} are involved in de Boor's algorithm computation. Since u is in [0,0.5), in the u-direction, only row 0, row 1, row 2 and row 3 are used. In the figure, the red polylines are for computing q_{i}(v)'s, while the only blue polyline is for determining the point (red sphere) on the surface.