Main Content

holes

polyshape 구멍 경계를 polyshape 객체로 구성된 배열로 변환

설명

예제

polyout = holes(polyin)polyshape 객체의 구멍 경계를 polyshape 객체로 구성된 배열로 반환합니다. polyout 내 요소 개수는 polyin의 구멍 경계 수와 동일합니다.

예제

모두 축소

2개의 채워진 영역과 2개의 구멍을 포함하는 다각형을 만듭니다. 구멍 경계를 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])

Figure contains an axes object. The axes object contains an object of type polygon.

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

    Vertices
    NumRegions
    NumHoles

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

Figure contains an axes object. The axes object contains 2 objects of type polygon.

입력 인수

모두 축소

입력 polyshape로, 스칼라로 지정됩니다.

데이터형: polyshape

버전 내역

R2017b에 개발됨

참고 항목

| | |