rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
plot_bnd_alu3d_hexa.m
1 function p = plot_bnd_alu3d_hexa(M, params)
2 %function p = plot_bnd_alu3d_hexa(M)
3 %
4 % plot boundary of alu3d-mesh
5 % params can contain fields with additional parameters
6 % shrink_factor : boundary patches are shrinked with this factor
7 % (default is 1 == no shrinking, <1 is shrinking)
8 % face_value : faces are plotted with a color according to this
9 % vector. If not given, the
10 % boundary-type-assignments are used.
11 
12 % Bernard Haasdonk 15.3.2006
13 
14  if ~isfield(params,'shrink_factor')
15  params.shrink_factor = 1;
16  end;
17 
18  if ~isfield(params,'face_value')
19  params.face_value = M.faces(1,:);
20  end;
21 
22  % compute cog of faces
23  cog = cog_faces_alu3d_hexa(M);
24 
25  % compute vertices of faces
26  [XX,YY,ZZ] = coord_faces_alu3d_hexa(M);
27 
28  % perform shrinking
29  cogX = repmat(cog(1,:),4,1);
30  XX = (XX-cogX) * params.shrink_factor + cogX;
31  cogY = repmat(cog(2,:),4,1);
32  YY = (YY-cogY) * params.shrink_factor + cogY;
33  cogZ = repmat(cog(3,:),4,1);
34  ZZ = (ZZ-cogZ) * params.shrink_factor + cogZ;
35 
36  % plot patches
37  p = patch(XX,YY,ZZ,params.face_value);
38 
39 % TO BE ADJUSTED TO NEW SYNTAX
40 %| \docupdate