Home > vbmeg > functions > common > utility > vb_reducepatch.m

vb_reducepatch

PURPOSE ^

reduce patch function

SYNOPSIS ^

function [new_F, new_V] = vb_reducepatch(F, V, R)

DESCRIPTION ^

 reduce patch function
 This is created to switch reduce patch algorithm by VBMEG.
 Please change global value 'reduce_algorithm' in vbmeg.m if you want to
 switch it and re-run vbmeg.m
 [Usage]
    [new_F, new_V] = vb_reducepatch(F, V, R);
    [NFV]          = vb_reducepatch(F, V, R);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [new_F, new_V] = vb_reducepatch(F, V, R)
0002 % reduce patch function
0003 % This is created to switch reduce patch algorithm by VBMEG.
0004 % Please change global value 'reduce_algorithm' in vbmeg.m if you want to
0005 % switch it and re-run vbmeg.m
0006 % [Usage]
0007 %    [new_F, new_V] = vb_reducepatch(F, V, R);
0008 %    [NFV]          = vb_reducepatch(F, V, R);
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         % MATLAB reducepatch
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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005