tags:

views:

789

answers:

5

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.

A: 

Functions surf and meshgrid might help.

High Performance Mark
meshgrid is *not* mesh generation
Ngu Soon Hui
A: 
  • 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.
ManWithSleeve
sftool is definitely not what I want, whereas the TPAPS seems more applicable to obtain a general big thin surface rather than meshed surfaces.
Ngu Soon Hui
+3  A: 

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:

gnovice
Persson's pure Matlab DistMesh might be of interest as well: http://persson.berkeley.edu/software.htmlfor heavy duty meshing, however, I would write the code to a csv file and do a system call to Shewchuk's triangle, however:http://www.cs.cmu.edu/~quake/triangle.html
shabbychef
A: 

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

shabbychef
A: 

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.

Luigi Giaccari

related questions