www.pudn.com > B-Interpolation.rar > testSurfApp.m, change:2006-08-26,size:549b


%Test the surface approximation routine 
 
Dx=[0 1 2 3 4 5 6 7;0 1 2 3 4 5 6 7;0 1 2 3 4 5 6 7;0 1 2 3 4 5 6 7]; % data points 
Dy=[0 0 0 0 0 0 0 0;1 1 1 1 1 1 1 1;2 2 2 2 2 2 2 2;3 3 3 3 3 3 3 3]; 
Dz=[1 1 2 2 3 3 4 4;2 2 3 3 4 4 3 3;3 3 3 4 5 2 2 1;2 2 2 3 1 0 0 0]; 
ku=4; 
kv=3; 
nu=8; 
nv=4; 
iCtrlu = 6; 
iCtrlv = 4; 
 
[Px,Py,Pz,U,V] = BsplineSurfApp(Dx,Dy,Dz,ku,kv,nu,nv,iCtrlu,iCtrlv); 
 
CP = cat(3,Px',Py',Pz'); 
CP = shiftdim(CP,2); 
 
num = 80; 
 
plotNUBSsurface(ku-1,kv-1,U,V,CP,num); 
 
plot3(Dx,Dy,Dz,'.','MarkerSize',15); 
hold off