MATLAB: Regrid isosurfaces to 2D arrays

isosurfacepatchregrid

Hi all,
I'm using isosurface to extract an isosurface from a 3D array (I'm providing x,y,z,v and the value of the isosurface that I'm looking for).
After I get the isosurface, I would like to create a gridded 2D array and plot the z values of the isosurface using pcolor (providing x_iso, y_iso, z_iso).
I'm basically trying to do the opposite of what surf does.
I can plot the isosurface, but I don't know how to create the 2D gridded array.
Does anyone know how to do this?
Thanks, Mattia

Best Answer

[x,y,z,v] = flow;
p = isosurface(x,y,z,v,-3);
x = p.vertices(:,1) ;
y = p.vertices(:,2) ;
z = p.vertices(:,3) ;
tri = p.faces ;
trisurf(tri,x,y,z) ;
Related Question