1 function p = plot_bnd_alu3d_hexa(M, params)
2 %
function p = plot_bnd_alu3d_hexa(M)
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.
12 % Bernard Haasdonk 15.3.2006
14 if ~isfield(params,
'shrink_factor')
15 params.shrink_factor = 1;
18 if ~isfield(params,
'face_value')
19 params.face_value = M.faces(1,:);
22 % compute cog of faces
23 cog = cog_faces_alu3d_hexa(M);
25 % compute vertices of faces
26 [XX,YY,ZZ] = coord_faces_alu3d_hexa(M);
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;
37 p = patch(XX,YY,ZZ,params.face_value);
39 % TO BE ADJUSTED TO NEW SYNTAX