-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathsms.m
34 lines (32 loc) · 899 Bytes
/
sms.m
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
33
34
function newnode = sms(node, face, iter, alpha, method)
%
% newnode=sms(node,face,iter,useralpha,method)
%
% simplified version of surface mesh smoothing
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2009/10/21
%
% input:
% node: node coordinates of a surface mesh
% face: face element list of the surface mesh
% iter: smoothing iteration number
% alpha: scaler, smoothing parameter, v(k+1)=alpha*v(k)+(1-alpha)*mean(neighbors)
% method: same as in smoothsurf, default is 'laplacianhc'
%
% output:
% newnode: output, the smoothed node coordinates
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%
if (nargin < 5)
method = 'laplacianhc';
end
if (nargin < 4)
if (nargin < 3)
iter = 10;
end
alpha = 0.5;
end
conn = meshconn(face, size(node, 1));
newnode = smoothsurf(node(:, 1:3), [], conn, iter, alpha, method, alpha);