File: extrudesurf.m

package info (click to toggle)
octave-iso2mesh 1.9.8%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 11,128 kB
  • sloc: cpp: 11,982; ansic: 10,158; sh: 365; makefile: 59
file content (32 lines) | stat: -rw-r--r-- 838 bytes parent folder | download
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);