[cutpos,cutvalue,facedata]=qmeshcut(elem,node,value,cutat)
Fast tetrahedral mesh slicer, by Qianqian Fang, <fangq at nmr.mgh.harvard.edu>
elem: an integer array with dimensions of NE x 4, each row contains the indices of all the nodes for each tetrahedron node: node coordinates, 3 columns for x, y and z respectively value: a scalar array with the length of node numbers, can have multiple columns cutat: cutat can have different forms: if cutat is a 3x3 matrix, it defines a plane by 3 points: cutat=[x1 y1 z1;x2 y2 z2;x3 y3 z3] if cutat is a vector of 4 element, it defines a plane by a*x+b*y+c*z+d=0 and cutat=[a b c d] if cutat is a single scalar, it defines an isosurface inside the mesh at value=cutat if cutat is a string, it defines an implicit surface at which the cut is made. it must has form expr1=expr2 where expr1 expr2 are expressions made of x,y,z,v and constants if cutat is a cell in the form of {'expression',scalar}, the expression will be evaluated at each node to produce a new value and an isosurface is produced at the levelset where new value=scalar; the expression can contain constants and x,y,z,v
the outputs of this subroutine can be easily viewed using
patch('Vertices',cutpos,'Faces',facedata,'FaceVertexCData',cutvalue,'FaceColor','interp');
This function is not included in iso2mesh 0.5.1. You can get it via CVS. It will be included in the next release of this toolbox. One can also download an early version of qmeshcut.m from Matlab File Exchange.
This function is Octave compatible.