Question

Is there any subroutine, in MATLAB, that takes in a list of points, and return me a good mesh that I can use to show to my colleagues, such as this?

alt text

Actually, all I need is just a simple 2D mesh generator that takes in a series of X, Y coordinates (that defines the boundary of the area), and give me back a list of elements that can mesh that area well. I can do the rest by using MATLAB command to interpolate the Z value.

Edit : I am not interested to use MATLAB to produce the above looking plot. I am interested in using a MATLAB library to obtain a list of elements so that when I plot those element myself (not in MATLAB itself; but in my own C# program), I can obtain this meshed surface.

PS: I know there is this DistMesh, but I am looking for something simpler - something built-in direct in MATLAB perhaps. And no, meshgrid is not mesh generation.

Was it helpful?

Solution

It sounds like you want to create a finite element mesh, starting with a set of points defining a boundary of a region and then generating a triangular mesh that creates more points within that region. I don't think there's a "simple" solution for this problem.

The closest "built-in" solution would probably be the Partial Differential Equation Toolbox, specifically some of the Geometry Algorithms like INITMESH and REFINEMESH.

The link you gave to DistMesh appears to be another good solution. There are also a few submissions on the MathWorks File Exchange that you could take a look at:

OTHER TIPS

  • That picture looks exactly like the one from the griddata documentation. The example in there looks like what you want.
  • SFTOOL will easily make the picture that you show.
  • A thin-plate spline, e.g., TPAPS, should also do the job.

I think the user-created 'gridfit' is the best I've come across for a single surface, much better/prettier than griddata.

Mesh generation as in Delaunay Triangulation + Steiner Points? There is a builtin Delaunay function in MATLAB.

If your surface is the z=f(x,y) form you can use:

http://www.advancedmcode.org/how-to-plot-a-coloured-surface-from-3d-scatter.html

If your surface is concave look for surface reconstruction on the same website.

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