Home > vbmeg > external > iso2mesh > insurface.m

insurface

PURPOSE ^

SYNOPSIS ^

function tf=insurface(node,face,points)

DESCRIPTION ^

 tf=innersurf(node,face,points)

 test if a set of 3D points is located inside a 3D triangular surface

 author: Qianqian Fang, <q.fang at neu.edu>

 input:
    node:  node coordinates
    face:  surface triangle list
    points: a set of 3D points (Nx3 array)

 output:
    tf: a vector with the same length of points, 
        a value of 1 means the point is inside of the surface, and
        a value of 0 means the point is outside of the surface.

 -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tf=insurface(node,face,points)
0002 %
0003 % tf=innersurf(node,face,points)
0004 %
0005 % test if a set of 3D points is located inside a 3D triangular surface
0006 %
0007 % author: Qianqian Fang, <q.fang at neu.edu>
0008 %
0009 % input:
0010 %    node:  node coordinates
0011 %    face:  surface triangle list
0012 %    points: a set of 3D points (Nx3 array)
0013 %
0014 % output:
0015 %    tf: a vector with the same length of points,
0016 %        a value of 1 means the point is inside of the surface, and
0017 %        a value of 0 means the point is outside of the surface.
0018 %
0019 % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
0020 %
0021 
0022 [no,el]=fillsurf(node,face);
0023 tf=tsearchn(no,el,points);
0024 
0025 tf(~isnan(tf))=1;
0026 tf(isnan(tf)) =0;

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