Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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?

  1. Create surface mesh: [FV.faces,FV.vertices] = isosurface(VOLUME);
  2. Quadruple the number of faces with refinepatch as many times as necessary: FV = refinepatch(FV);
  3. Reduce the number of faces/vertices to 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 plotmeshfrom iso2mesh to compare the meshes).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top