Main Content

edgeAttachments

连接到指定边缘的三角形或四面体

说明

示例

ID = edgeAttachments(TR,startID,endID) 标识连接到指定边的三角形或四面体。startIDendID 按起点和终点指定边,其中每个点由 TR.Points 中的对应行号表示。返回值 ID 通过标识号来标识三角形。

示例

ID = edgeAttachments(TR,E) 指定两列矩阵 E 中每个边的起始和终止顶点。

示例

全部折叠

创建一个德劳内三角剖分并对其绘图。

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

输入参数

全部折叠

三角剖分表示法,指定为标量 triangulationdelaunayTriangulation 对象。

数据类型: triangulation | delaunayTriangulation

每条边的起始顶点标识,指定为列向量。顶点标识号是 Points 属性中与该顶点对应的行号。

数据类型: double

每条边的终止顶点标识,指定为列向量。顶点标识号是 Points 属性中与该顶点对应的行号。

数据类型: double

边矩阵,指定为两列矩阵。每行包含一条边的起始和终止顶点标识。顶点标识号是 Points 属性中与该顶点对应的行号。

数据类型: double

扩展功能

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

版本历史记录

在 R2013a 中推出