Home > matGeom > geom3d > drawSurfPatch.m

drawSurfPatch

PURPOSE ^

DRAWSURFPATCH Draw a 3D surface patch, with 2 parametrized surfaces.

SYNOPSIS ^

function drawSurfPatch(u, v, z, varargin)

DESCRIPTION ^

DRAWSURFPATCH Draw a 3D 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, and corresponding tangent are also shown.


   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 24/05/2005.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function drawSurfPatch(u, v, z, varargin)
0002 %DRAWSURFPATCH Draw a 3D 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, and corresponding tangent are also shown.
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

Generated on Wed 16-Feb-2022 15:10:47 by m2html © 2003-2019