vol=surfvolume(node,face,option) calculate the enclosed volume for a closed surface author: Qianqian Fang, <q.fang at neu.edu> input: node: node coordinates face: surface triangle list output: vol: total volume of the enclosed space -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
0001 function vol=surfvolume(node,face,option) 0002 % 0003 % vol=surfvolume(node,face,option) 0004 % 0005 % calculate the enclosed volume for a closed surface 0006 % 0007 % author: Qianqian Fang, <q.fang at neu.edu> 0008 % 0009 % input: 0010 % node: node coordinates 0011 % face: surface triangle list 0012 % 0013 % output: 0014 % vol: total volume of the enclosed space 0015 % 0016 % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) 0017 % 0018 0019 face=face(:,1:3); 0020 0021 ed=surfedge(face); 0022 if(~isempty(ed)) 0023 error('open surface is detected, you have to close it first, consider meshcheckrepair() with meshfix option'); 0024 end 0025 0026 [no,el]=fillsurf(node,face); 0027 0028 vol=elemvolume(no,el); 0029 vol=sum(vol);