0001 function [V, F] = vb_reduce_vertex(V,F,Reduce_ratio)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 Ndipole = size(V,1);
0016 NdipoleL = F.NdipoleL ;
0017 NdipoleR = Ndipole - NdipoleL ;
0018
0019 if Reduce_ratio > 1,
0020 ReduceL = round(NdipoleL*Reduce_ratio*2/Ndipole);
0021 ReduceR = round(NdipoleR*Reduce_ratio*2/Ndipole);
0022 else
0023 ReduceL = Reduce_ratio;
0024 ReduceR = Reduce_ratio;
0025 end;
0026
0027 V0L = V(1:NdipoleL , :);
0028 V0R = V((NdipoleL+1):Ndipole , :);
0029 F0R = F.F3R ;
0030 F0L = F.F3L ;
0031 F0R = F0R - NdipoleL;
0032
0033
0034
0035 if NdipoleL > 0,
0036 [F3L,V3L] = vb_reducepatch(F0L,V0L,ReduceL);
0037 else
0038 F3L = [];
0039 V3L = [];
0040 end
0041
0042 NdipoleL = size(V3L,1);
0043
0044 if NdipoleR > 0,
0045 [F3R,V3R] = vb_reducepatch(F0R,V0R,ReduceR);
0046 F3R = F3R + NdipoleL;
0047 else
0048 F3R = [];
0049 V3R = [];
0050 end
0051
0052 V = [ V3L; V3R ];
0053
0054 F.F3L = F3L;
0055 F.F3R = F3R;
0056 F.F3 = [F3L; F3R];
0057 F.NdipoleL = NdipoleL;