edgeAttachments
连接到指定边缘的三角形或四面体
说明
示例
二维德劳内三角剖分
创建一个德劳内三角剖分并对其绘图。
x = [0 1 1 0 0.5]'; y = [0 0 1 1 0.5]'; TR = delaunayTriangulation(x,y); triplot(TR)
计算与起点 (0,0) 和终点 (0.5,0.5) 所定义的边相连的三角形的标识。这两个点的顶点标识分别是 1 和 5。
ID = edgeAttachments(TR,1,5); ID{:}
ans = 1×2
4 1
ConnectivityList
属性指示各个三角形中的顶点。第四个三角形由顶点 (0.5,0.5)、(0,0) 和 (1,0) 定义,第一个三角形由顶点 (0,1)、(0,0) 和 (0.5,0.5) 定义。
TR.ConnectivityList
ans = 4×3
4 1 5
4 5 3
5 2 3
5 1 2
TR.Points
ans = 5×2
0 0
1.0000 0
1.0000 1.0000
0 1.0000
0.5000 0.5000
三维三角剖分
加载二维三角剖分数据并创建三角剖分表示。
load tetmesh
TR = triangulation(tet,X);
通过起始和终止顶点标识选择两条边。
startID = [15; 21]; endID = [936; 716];
了解边的连接情况,并检查连接到各条边的三角形的标识。
ID = edgeAttachments(TR,startID,endID); ID{1}
ans = 1×6
927 2060 3438 3423 2583 4690
ID{2}
ans = 1×5
2652 3946 3953 4665 4218
输入参数
TR
— 三角剖分表示法
标量三角剖分对象
三角剖分表示法,指定为标量 triangulation
或 delaunayTriangulation
对象。
数据类型: triangulation
| delaunayTriangulation
startID
— 起始顶点标识
列向量
每条边的起始顶点标识,指定为列向量。顶点标识号是 Points
属性中与该顶点对应的行号。
数据类型: double
endID
— 终止顶点标识
列向量
每条边的终止顶点标识,指定为列向量。顶点标识号是 Points
属性中与该顶点对应的行号。
数据类型: double
E
— 边矩阵
两列矩阵
边矩阵,指定为两列矩阵。每行包含一条边的起始和终止顶点标识。顶点标识号是 Points
属性中与该顶点对应的行号。
数据类型: 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)