0001 function [faces,vertices] = mesh_emse2mat3d(vertex,patch)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 vertices = zeros(length(vertex),3);
0023 for i=1:length(vertex),
0024 vertices(i,1) = vertex(i).location1;
0025 vertices(i,2) = vertex(i).location2;
0026 vertices(i,3) = vertex(i).location3;
0027 end
0028
0029 faces = zeros(length(patch),3);
0030 for i=1:length(patch),
0031
0032 v = patch(i).vertex1; flag = 0;
0033 for j=1:length(vertex),
0034 if isequal(v, vertex(j).address)
0035 faces(i,1) = j; flag = 1; break;
0036 end
0037 end
0038 if (flag==0) fprintf('...error in patch(%d).vertex1!\n',i); break;end
0039
0040 v = patch(i).vertex2; flag = 0;
0041 for j=1:length(vertex),
0042 if isequal(v, vertex(j).address)
0043 faces(i,2) = j; flag = 1; break;
0044 end
0045 end
0046 if (flag==0) fprintf('...error in patch(%d).vertex2!\n',i); break;end
0047
0048 v = patch(i).vertex3; flag = 0;
0049 for j=1:length(vertex),
0050 if isequal(v, vertex(j).address)
0051 faces(i,3) = j; flag = 1; break;
0052 end
0053 end
0054 if (flag==0) fprintf('...error in patch(%d).vertex3!\n',i); break;end
0055 end
0056
0057
0058
0059
0060