1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
function [node, face] = extrudesurf(no, fc, vec)
%
% [node,face]=extrudesurf(no,fc,vec)
%
% create a enclosed surface mesh by extruding an open surface
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
%
% output:
% node: 3D node coordinates for the generated surface mesh
% face: triangular face patches of the generated surface mesh, each
% row represents a triangle denoted by the indices of the 3 nodes
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%
nlen = size(no, 1);
if (length(vec) > 1)
node = [no; no + repmat(vec(:)', nlen, 1)];
else
node = [no; no + vec * nodesurfnorm(no, fc)];
end
face = [fc; fc + nlen];
edge = surfedge(fc);
sideface = [edge edge(:, 1) + nlen; edge + nlen edge(:, 2)];
face = [face; sideface];
[node, face] = meshcheckrepair(node, face);
|