简体   繁体   English

使用3D点绘制光滑表面

[英]Plotting smooth surface using 3D points

This is the surface I need to create using 3D points in matlab. 这是我需要在matlab中使用3D点创建的表面。

I have huge dense set of 3D points and I want to create a smooth surface using these points. 我有很多密集的3D点,我想用这些点创建一个光滑的表面。 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,y和z阵列的形式,其中一些如下所示。

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: 这些点的3D图如下所示:

PIC2

You could compute the convex hull and plot using trisurf(). 您可以使用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()函数创建带阴影的曲面图,将阴影更改为插值模式并选择合适的颜色图(粉红色)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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