帮助中心帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
从二维三角剖分创建 polyshape
polyshape
polyout = boundaryshape(TR)
[polyout,vertexID] = boundaryshape(TR)
示例
polyout = boundaryshape(TR) 从二维三角剖分的边界创建 polyshape 对象。TR 可以是 triangulation 对象或 delaunayTriangulation 对象。
polyout
TR
triangulation
delaunayTriangulation
创建 polyshape 对象 polyout 后,可以使用 polyshape 函数分析其属性或执行其他计算。例如,可以使用属性 polyout.Vertices 访问定义边界的顶点,使用命令 plot(polyout) 绘制形状。
polyout.Vertices
plot(polyout)
[polyout,vertexID] = boundaryshape(TR) 还返回向量 vertexID,它将 polyshape 的顶点映射到三角剖分的顶点。
vertexID
全部折叠
创建并绘制简单的 triangulation 对象。
P = [2.5 8.0; 6.5 8.0; 2.5 5.0; 6.5 5.0; 1.0 6.5; 8.0 6.5]; T = [5 3 1; 3 2 1; 3 4 2; 4 6 2]; TR = triangulation(T,P); triplot(TR) xlim([0 9]) ylim([4.5 8.5])
创建并绘制一个 polyshape 对象,其边界等于三角剖分的边界。
polyout = boundaryshape(TR); plot(polyout)
创建并绘制 triangulation 对象。
T = [5 1 3; 6 1 4; 5 4 1; 2 6 3; 3 6 5; 2 1 6]; P = [3 0.5; 3.5 1.5; 4 0.5; 3.25 0.6; 3.75 0.6; 3.5 1]; TR = triangulation(T,P); triplot(TR) xlim([2.8 4.2]) ylim([0.4 1.8])
创建并绘制一个 polyshape 对象,其边界等于三角剖分的边界。由于三角剖分的内部和外部闭合边界,polyout 同时包含孔边界和实心边界。
polyout = polyshape with properties: Vertices: [7x2 double] NumRegions: 1 NumHoles: 1
三角剖分,指定为二维 triangulation 对象或二维 delaunayTriangulation 对象。
输出 polyshape,以 polyshape 对象形式返回。
顶点标识,以整数向量形式返回。vertexID 中的每个元素对应于 Points 属性中三角剖分顶点的行号。vertexID 的长度等于 polyshape 对象的 Vertices 属性中的行数。
Points
Vertices
数据类型: double
double
在 R2018b 中推出
polyshape | triangulation | delaunayTriangulation
您点击的链接对应于以下 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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office