Main Content

holes

polyshape 孔边界转换为 polyshape 对象数组

说明

示例

polyout = holes(polyin)polyshape 对象数组的形式返回 polyshape 对象的孔边界。polyout 中的元素数等于 polyin 中的孔边界数。

示例

全部折叠

创建包含两个实心区域和两个孔的多边形。将孔边界转换为 polyshape 对象数组。

P = [0 0; 0 2; 2 2; 2 0; NaN NaN; 0.5 0.5; 0.5 1.5; 1.5 1.5; 1.5 0.5; ...
    NaN NaN; 3 0.5; 3.5 1.5; 4 0.5; NaN NaN; 3.25 0.6; 3.75 0.6; 3.5 1];
polyin = polyshape(P);
plot(polyin)
xlim([-0.5 4.5])
ylim([-0.5 2.5])

polyout = holes(polyin)
polyout = 
  2x1 polyshape array with properties:

    Vertices
    NumRegions
    NumHoles

plot(polyout)
xlim([-0.5 4.5])
ylim([-0.5 2.5])

输入参数

全部折叠

输入 polyshape,指定为标量。

数据类型: polyshape

版本历史记录

在 R2017b 中推出

另请参阅

| | |