COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Surface generation from 3D Co-ordinates

• Email
• Follow

```I have a set of x,y and z coordinates.Can anyone guide me how can I create a surface with these points.

Thanks,

Rac
```
 0

See related articles to this posting

```Rachit wrote:
> I have a set of x,y and z coordinates.Can anyone guide me how can I
> create a surface with these points.

That will depend upon what assumptions you want made.

If the set of coordinates forms a "point cloud" and you want a possibly
non-convex surface "around" the cloud, then there are multiple solutions
unless you put some constraints on the surface finding.

If you want to find a convex surface that fits around the points, you can use
the convexhull routines and then trisurf or the like to visualize the
resulting triangles.

If the coordinates form a grid in x and y, then you may be able to use surf()
to visualize the data.

scatter3() is good for visualizing 3D points _without_ a surface.

```
 0

```"Rachit " <racpsine@gmail.com> writes:

Real name?

> I have a set of x,y and z coordinates.Can anyone guide me how can I
> create a surface with these points.

x_grid = linspace(min(x), max(x), 11);
y_grid = linspace(min(y), max(y), 11);

[x_mesh, y_mesh] = meshgrid(x_grid, y_grid);
z_mesh = griddata(x, y, z, x_mesh, y_mesh, 'v4');

surf(x_mesh, y_mesh, z_mesh, 'FaceColor', 'interp', 'FaceAlpha', 0.75);
hold('on');
plot3(x, y, z, 'o', 'MarkerEdgeColor', 'k', 'MarkerFaceColor', 'y');

--
Ralph Schleicher  <http://ralph-schleicher.de>

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools
```
 0

```"Rachit " <racpsine@gmail.com> wrote in message <ht1joj\$3nt\$1@fred.mathworks.com>...
> I have a set of x,y and z coordinates.Can anyone guide me how can I create a surface with these points.
>
> Thanks,
>
> Rac

Thank you very much guys...That is what I was looking for....

Rachit :)
```
 0