Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

convexHull

Delaunay 三角剖分的凸包

说明

示例

C = convexHull(DT) 返回 Delaunay 三角剖分的凸包的顶点。

示例

[C,v] = convexHull(DT) 还会返回凸包约束的面积或体积。

示例

全部折叠

计算并绘制二维 Delaunay 三角剖分的凸包。

基于一组二维点创建 Delaunay 三角剖分。

rng default;
x = rand([10,1]);
y = rand([10,1]);
DT = delaunayTriangulation(x,y);

计算凸包。

C = convexHull(DT);

绘制三角剖分并用红色突出显示凸包。

plot(DT.Points(:,1),DT.Points(:,2),'.','MarkerSize',10)
hold on
plot(DT.Points(C,1),DT.Points(C,2),'r') 

Figure contains an axes object. The axes object contains 2 objects of type line. One or more of the lines displays its values using only markers

计算并绘制三维 Delaunay 三角剖分的凸包。

基于一组三维点创建 Delaunay 三角剖分。

rng('default');
P = rand([25,3]);
DT = delaunayTriangulation(P);

计算凸包及其约束的体积。

[C,v] = convexHull(DT);

显示体积并绘制凸包。

v
v = 0.3943
trisurf(C,DT.Points(:,1),DT.Points(:,2),DT.Points(:,3), ...
       'FaceColor','cyan')

Figure contains an axes object. The axes object contains an object of type patch.

输入参数

全部折叠

Delaunay 三角剖分,指定为标量 delaunayTriangulation 对象。

数据类型: delaunayTriangulation

输出参数

全部折叠

凸包顶点,以顶点 ID 的列向量或矩阵形式返回。

  • DT 为二维三角剖分时,C 是一个列向量,其中包含凸包周围的顶点 ID 序列。顶点 ID 是 Points 属性中顶点的行号。

  • DT 为三维三角剖分时,C 是一个三列矩阵,其中包含凸包中三角形顶点的连接列表。

数据类型: double

凸包的面积或体积,以标量形式返回。

数据类型: double

扩展功能

基于线程的环境
使用 MATLAB® backgroundPool 在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool 加快代码运行速度。

版本历史记录

在 R2013a 中推出