faceNormal
三角剖分单位法向量
说明
示例
曲面上的单位法向
计算并绘制球面上三角剖分各分面的单位法向量。
在球面上创建一组点。
rng default;
theta = rand([100,1])*2*pi;
phi = rand([100,1])*pi;
x = cos(theta).*sin(phi);
y = sin(theta).*sin(phi);
z = cos(phi);
使用 delaunayTriangulation
函数对球体进行三角剖分。
DT = delaunayTriangulation(x,y,z);
查找三角剖分的自由边界面,并使用它们在曲面上创建二维三角剖分。
[T,Xb] = freeBoundary(DT); TR = triangulation(T,Xb);
计算 TR
中每个三角面的中心和面法向量。
P = incenter(TR); F = faceNormal(TR);
绘制三角剖分以及中心和面法向。
trisurf(T,Xb(:,1),Xb(:,2),Xb(:,3), ... 'FaceColor','cyan','FaceAlpha',0.8); axis equal hold on quiver3(P(:,1),P(:,2),P(:,3), ... F(:,1),F(:,2),F(:,3),0.5,'color','r');
输入参数
TR
— 三角剖分表示法
标量三角剖分对象
仅用于二维三角剖分的三角剖分表示,指定为标量 triangulation
或 delaunayTriangulation
对象。
数据类型: triangulation
| delaunayTriangulation
ID
— 三角形标识
标量 | 列向量
三角形标识,指定为标量或列向量,其每个元素对应于三角剖分对象中的单个三角形。每个三角形的标识号是 ConnectivityList
属性的对应行号。
数据类型: 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)