简体   繁体   中英

Plotting smooth surface using 3D points

This is the surface I need to create using 3D points in matlab.

I have huge dense set of 3D points and I want to create a smooth surface using these points. The type of surface I need is shown here as an example:

PIC1

The points are in the form of x, y and z arrays & some are shown below.

x = [195.758412316115   194.820087484229    193.880003014141    192.938917413610    191.998009541608. ],
y = [153.551961825705   153.449992277448    153.348399077453    153.246913790771    153.145452172192 ...],
z = [-45.8030209004629  -45.4679110367076   -45.1377265101793   -44.8100698973253   -44.4818298688393...].

The 3D plot of these points are shown as below:

PIC2

You could compute the convex hull and plot using trisurf(). Here is an example cube:

x = [-1 1 -1 1 -1 1 -1 1]
y = [-1 -1 1 1 1 1 -1 -1]
z = [-1 -1 -1 -1 1 1 1 1]

C = convhull(x,y,z);
trisurf(C, x, y, z);

You could try surfl() function which creates a surface plot with shading, change the shading to interpolate mode and choose the suitable colormap(pink)

surfl(z)
colormap(pink)    % change color map
shading interp    % interpolate colors across lines and faces

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM