0001 function [new_F, new_V] = vb_reducepatch(F, V, R)
0002
0003
0004
0005
0006
0007
0008
0009
0010 global reduce_algorithm;
0011
0012 if strcmpi(reduce_algorithm, 'CGAL')
0013
0014 [a, tmp_name] = vb_get_file_parts(tempname);
0015 evalin('base', ['ISO2MESH_SESSION=''' tmp_name ''';']);
0016
0017 if R < 1
0018 [new_V, new_F] = meshresample(V, F, R);
0019 else
0020 ratio = R/size(F,1);
0021 [new_V, new_F] = meshresample(V, F, ratio);
0022 end
0023
0024 evalin('base', 'clear ISO2MESH_SESSION');
0025 else
0026
0027 [new_F, new_V] = reducepatch(F, V, R);
0028 end
0029
0030 if nargout == 1
0031 NFV = struct;
0032 NFV.faces = new_F;
0033 NFV.vertices = new_V;
0034 new_F = NFV;
0035 new_V = [];
0036 end