Question about how the isosurface function works
4 views (last 30 days)
Kaustubh Panse on 20 Sep 2022
I'm currently working on trying to write some code to plot an isosurface, and I had a basic question about how the isosurface works.
Let say I want to plot an isosurface with isovalue = 1. However, my data doesn't have any value which is exactly = 1.00000. The data is something like 0.9899, 1.0129, etc. So theoretically my isosurface should be blank right, because I don't have any value which is exactly = 1.0000. Yet I do get an output, which is also reasonable according to my data.
I was wondering what's the in built tolerance the code has? Does it perhaps plot an isosurface for points 1.000 +- 0.001? Furthermore, can I know and control the tolerance value to which the isosurface is plotted at?
Any help would really be appreciated!
John D'Errico on 20 Sep 2022
Edited: John D'Errico on 20 Sep 2022
isosurface cannot use interpolation? Why not? All that is necessary is the ability to perform LINEAR interpolation, between pairs of points, nothing more.
For example, how does a contour plot work? Again, even though you do not have specific data points at a SPECIFIC level, you can still generate a contour plot. For example:
[X,Y] = meshgrid(0:.25:2);
Z = X.^2+Y.^2;
Do you see that the contours are actually straight line segments between a set of points? As well, do you see those segments need not fall on the grid itself? The line segments cross between pairs of points. We can get the contour itself, as the points:
CXY = contourc(0:.25:2,0:.25:2,Z,[1 1])
Read the help for contourc to see what was produced.
A simple linear interpolation is all that is necessary. And what is an isosurface, but a contour plot, in THREE dimensions?