I publish this post hoping to give an answer to the more common questions I receive on my e-mail.
The first thing we’ve got to see in our points cloud is that the resulting surface is in the z=f(x,y) form. If yes, than the solution is easier than it seems, we just have to triangulate x and y coordinates, for example using delaunay, and after that plot all trhee coordinates. Notice that if points are structured (diposed on a grid) there is no need to use delaunay to build a triangular mesh that’s enough a for loop. An implementation of a structured grid genration can be found at:
http://www.mathworks.com/matlabcentral/fileexchange/23916
A complete example on how to plot the surface can be downloaded at:
http://www.mathworks.com/matlabcentral/fileexchange/23447
It also shown how to colour the final surface with assingned rgb triplets at each points.
If the surface is not in the z=f(x,y) form, things get a little more complicated. Now we have to check if the surface is in convex, if yes we can smile. All we have to do now is to tessellate the 3D points with the convhulln function and then simply use the trisurf command to plot our surface. Since the final surface is convex, the convhull function ensure a correct tesselation.
And waht if the final surface is not convex. We are entering in the more complicate field of surface recostruction. Now the recostruction is not assured to be correct and the algorithm to choose mainly depends on the kind of dataset we are facing:
- Closed surface: a crust based algorithm will be good, an implementation is on:
http://www.mathworks.com/matlabcentral/fileexchange/22185 - Open surface: open surfaces are tricky, sometimes thay are not even orientable. For those the Crust based algotihm fails because it requires a volume that with an open surface can not be defined. An algorithm for open surfaces can be get at:
http://www.mathworks.com/matlabcentral/fileexchange/22595 - Filled clouds: when we want to get a surface from points generally all the points include in the input will be part of the final surface. But sometimes cloud points are filled, they can contain a lot of internal points that are not supposed to lye on the surface. This kind of dataset requires a ball pivoting algorithm or a ballfretting one that can be found at:
http://www.mathworks.com/matlabcentral/fileexchange/23447 - Sliced data: Sliced data are somehow easier to treat because, differently from scattered points cloud, here we partially know the points disposition. I’ll be working on one of this algorithm, I will publish a link when it is finished.
