convexHull
Delaunay 三角剖分的凸包
说明
示例
二维 Delaunay 三角剖分
计算并绘制二维 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')
三维 Delaunay 三角剖分
计算并绘制三维 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')
输入参数
DT
— Delaunay 三角剖分
标量
Delaunay 三角剖分,指定为标量 delaunayTriangulation
对象。
数据类型: delaunayTriangulation
输出参数
C
— 凸包顶点
列向量 | 矩阵
凸包顶点,以顶点 ID 的列向量或矩阵形式返回。
当
DT
为二维三角剖分时,C
是一个列向量,其中包含凸包周围的顶点 ID 序列。顶点 ID 是Points
属性中顶点的行号。当
DT
为三维三角剖分时,C
是一个三列矩阵,其中包含凸包中三角形顶点的连接列表。
数据类型: double
v
— 面积或体积
标量
凸包的面积或体积,以标量形式返回。
数据类型: double
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
版本历史记录
在 R2013a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)