Reputation: 253
I know how to use PDEtool in MATLAB. But now it is necessary for me to produce mesh on a surface.
Is there anyone who know how could I do this? Is it possible in MATLAB or not?
Upvotes: 0
Views: 1307
Reputation: 7975
I have a solution but it's a combination of mesh-functions and I don't know how good the quality of the mesh is. Also I need the vertices and faces, so what i get is a little different than what you get when using meshgrid
. However, it's still a mesh, isn't it?
[FV.faces,FV.vertices] = isosurface(VOLUME);
FV = refinepatch(FV);
n
: FV = reducepatch(FV,n);
I'm also going to have a look at iso2mesh
Edit:
With vol2surf
from iso2mesh I get a more regulary shaped mesh with less deviation (I used plotmesh
from iso2mesh to compare the meshes).
Upvotes: 0
Reputation: 6434
If you want to make a mesh plot of your surface and you know the {X,Y,Z} of your surface, you can use mesh command in MATLAB to create mesh. for example:
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(X,Y,Z,'EdgeColor','black')
If you want to use the mesh data for other reason, why don't you try DistMesh? it is briefly a simple mesh generator for MATLAB.
Upvotes: 2