CSE 477 / G. Farin
Bilinear Bezier  surfaces

We show some bilinear Bezier surfaces, using the Mathematica BSplineSurface function.

(* a control mesh: *)
bb={{{0,0,0},{1,0,0}},{{0,1,0},{1,1,1}}};

center=Sum[Sum[bb[[i,j]],{i,2}],{j,2}]/4;
Do[bb[[i,j]]=bb[[i,j]]-center,{i,2},{j,2}];
dists=Table[Norm[bb[[i,j]]-center],{i,2},{j,2}];
radius=Max[dists];


netplot=Graphics3D[{PointSize[Large],Red,Map[Point,bb],Gray,Line[bb],Line[Transpose[bb]]}];
surf[u_,v_]:= Sum[Sum[bb[[i,j]]*BernsteinBasis[1,i-1,u]*BernsteinBasis[1,j-1,v],{i,2}],{j,2}];

surfplot=ParametricPlot3D[surf[x,y],{x,0,1},{y,0,1},Axes->False,Mesh->False];
Show[{surfplot,netplot},Boxed->False,ViewPoint->{-2,-4,5},PlotRange-> 0.5radius]

Next, repeat but display only a region of the surface, using RegionFunction.

surfplot=ParametricPlot3D[surf[x,y],{x,0,1},{y,0,1},RegionFunction->Function[{x,y},x^2+y^2<.2],Axes->False, Mesh->False];
Show[{surfplot},Boxed->False,ViewPoint->{0,-2,2},PlotRange-> 0.5radius]