MATLAB 帮助中心
从二维三角剖分创建 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: [7×2 double] NumRegions: 1 NumHoles: 1
三角剖分,指定为二维 triangulation 对象或二维 delaunayTriangulation 对象。
输出 polyshape,以 polyshape 对象形式返回。
顶点标识,以整数向量形式返回。vertexID 中的每个元素对应于 Points 属性中三角剖分顶点的行号。vertexID 的长度等于 polyshape 对象的 Vertices 属性中的行数。
Points
Vertices
数据类型: double
double
在 R2018b 中推出
polyshape | triangulation | delaunayTriangulation
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处