neighbors
三角形或四面体的相邻对象
说明
示例
三维三角剖分
在三维三角剖分中查找相邻的四面体。
创建三维三角剖分。
load tetmesh
TR = triangulation(tet,X);
计算三角剖分的每个元素的相邻四面体的 ID。
N = neighbors(TR);
显示第五个四面体的相邻对象的 ID。
N(5,:)
ans = 1×4
2360 1539 2 1851
检查第一个相邻对象的顶点 ID。
TR.ConnectivityList(N(1),:)
ans = 1×4
1093 891 893 858
二维德劳内三角剖分
在二维德劳内三角剖分中查找相邻的三角形。
创建二维德劳内三角剖分。
rng('default')
x = rand([10,1]);
y = rand([10,1]);
TR = delaunayTriangulation(x,y);
查找第一个三角形的相邻对象。NaN
表示该三角形位于三角剖分的边界上,并且只有两个相邻对象。
N = neighbors(TR,1)
N = 1×3
4 8 5
检查第三个相邻对象的顶点 ID。
TR.ConnectivityList(N(3),:)
ans = 1×3
3 8 2
输入参数
TR
— 三角剖分表示法
标量三角剖分对象
三角剖分表示法,指定为标量 triangulation
或 delaunayTriangulation
对象。
数据类型: triangulation
| delaunayTriangulation
ID
— 三角形或四面体 ID
标量 | 列向量
三角形或四面体 ID,指定为标量或列向量,其元素对应于三角剖分对象中的单个三角形或四面体。每个三角形或四面体的 ID 是 ConnectivityList
属性的对应行号。
如果三角形或四面体具有一个或多个边界面,则在 N
中将不存在的相邻对象表示为 NaN
的值。
数据类型: double
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
版本历史记录
在 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)