delfix

PURPOSE ^

function [vtx_n,simp_n] = delfix(vtx,simp)

SYNOPSIS ^

function [vtx_n,simp_n] = delfix(vtx,simp)

DESCRIPTION ^

function [vtx_n,simp_n] = delfix(vtx,simp)

 Auxiliary function to remove the zero area faces
 produced by Matlab's delaunay triangulation



vtx  = The vertices matrix
simp = The simplices matrix

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [vtx_n,simp_n] = delfix(vtx,simp)
0002 %function [vtx_n,simp_n] = delfix(vtx,simp)
0003 %
0004 % Auxiliary function to remove the zero area faces
0005 % produced by Matlab's delaunay triangulation
0006 %
0007 %
0008 %
0009 %vtx  = The vertices matrix
0010 %simp = The simplices matrix
0011 
0012 
0013 simp_n = [];
0014 tri_a = [];
0015 
0016 for kk=1:length(simp)
0017    
0018    this_tri = simp(kk,:);
0019    
0020    xa = vtx(this_tri(1),1); ya = vtx(this_tri(1),2);
0021    xb = vtx(this_tri(2),1); yb = vtx(this_tri(2),2);
0022    xc = vtx(this_tri(3),1); yc = vtx(this_tri(3),2);
0023    
0024    tria = polyarea([xa;xb;xc],[ya;yb;yc]);
0025    tri_a = [tri_a ; tria];
0026    
0027    if tria > 0.00000000001       
0028       simp_n = [simp_n;this_tri];
0029    end
0030    
0031 end
0032 
0033 vtx_n = vtx;
0034 
0035 
0036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0037 % This is part of the EIDORS suite.
0038 % Copyright (c) N. Polydorides 2003
0039 % Copying permitted under terms of GNU GPL
0040 % See enclosed file gpl.html for details.
0041 % EIDORS 3D version 2.0
0042 % MATLAB version 5.3 R11
0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005