Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Surface generation from 3D Co-ordinates

Subject: Surface generation from 3D Co-ordinates

From: Rachit

Date: 19 May, 2010 21:04:19

Message: 1 of 4

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

Subject: Surface generation from 3D Co-ordinates

From: Walter Roberson

Date: 19 May, 2010 21:15:45

Message: 2 of 4

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.

Subject: Surface generation from 3D Co-ordinates

From: Ralph Schleicher

Date: 19 May, 2010 22:39:23

Message: 3 of 4

"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

Subject: Surface generation from 3D Co-ordinates

From: Rachit

Date: 19 May, 2010 23:29:04

Message: 4 of 4

"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 :)

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us