DRAWPARTIALPATCH draw surface patch, with 2 parametrized surfaces. usage : drawSurfPatch(u, v, zuv) where u, v, and zuv are three matrices the same size, u and corresponding to each parameter, and zuv being equal to a function of u and v. drawSurfPatch(u, v, zuv, p0) If p0 is specified, two lines with u(p0(1)) and v(p0(2)) are drawn on the surface --------- author : David Legland INRA - TPV URPOI - BIA IMASTE created the 24/05/2005.
0001 function drawPartialPatch(u, v, z, varargin) 0002 %DRAWPARTIALPATCH draw surface patch, with 2 parametrized surfaces. 0003 % 0004 % usage : 0005 % drawSurfPatch(u, v, zuv) 0006 % where u, v, and zuv are three matrices the same size, u and 0007 % corresponding to each parameter, and zuv being equal to a function of u 0008 % and v. 0009 % 0010 % drawSurfPatch(u, v, zuv, p0) 0011 % If p0 is specified, two lines with u(p0(1)) and v(p0(2)) are drawn on 0012 % the surface 0013 % 0014 % 0015 % --------- 0016 % 0017 % author : David Legland 0018 % INRA - TPV URPOI - BIA IMASTE 0019 % created the 24/05/2005. 0020 % 0021 0022 % HISTORY 0023 % 2005-06-08 add doc. 0024 % 2007-01-04 remove unused variables and change function name 0025 % 2010-03-08 code cleanup, use drawPolyline3d 0026 0027 % prepare figure 0028 hold on; 0029 0030 % draw the surface interior 0031 surf(u, v, z, 'FaceColor', 'g', 'EdgeColor', 'none'); 0032 0033 % draw the surface boundaries 0034 drawPolyline3d(u(1,:), v(1,:), z(1,:)) 0035 drawPolyline3d(u(end,:), v(end,:), z(end,:)) 0036 drawPolyline3d(u(:,end), v(:,end), z(:,end)) 0037 drawPolyline3d(u(:,1), v(:,1), z(:,1)) 0038 0039 % eventually draw two perpendicular lines on the surface 0040 if ~isempty(varargin) 0041 pos = varargin{1}; 0042 drawPolyline3d(u(pos(1),:), v(pos(1),:), z(pos(1),:)); 0043 drawPolyline3d(u(:,pos(2)), v(:,pos(2)), z(:,pos(2))); 0044 end