Polycut2

버전 1.1.0.0 (5.82 KB) 작성자: Paul
Remove polygon holes by connecting contours and holes
다운로드 수: 80
업데이트 날짜: 2015/10/13

라이선스 보기

POLYCUT2(lat,long) connects the contour and holes of polygons. In contrast to POLYCUT, POLYCUT2 finds an output polygon with smaller total contour length and avoids cases where the cuts interesect with the polygon contours.
Example:
% outer contour
ov = [0,0; 0,1; 2,1; 2,2; 0,2; 0,3; 3,3; 3,0];
% hole 1
iv1 = [0.5,0.3; 1.5,0.3; 1.5,0.7; 0.5,0.7];
% hole 2
iv2 = [0.5,2.3; 1.5,2.3; 1.5,2.7; 0.5,2.7];
v = [ov;nan(1,2);iv1;nan(1,2);iv2];
[v1(:,1),v1(:,2)] = polycut(v(:,1),v(:,2));
[v2(:,1),v2(:,2)] = polycut2(v(:,1),v(:,2));

% red is old method, blue is new one
figure;
line(v1(:,1),v1(:,2),'Color','red');
figure;
line(v2(:,1),v2(:,2),'Color','blue');

인용 양식

Paul (2024). Polycut2 (https://www.mathworks.com/matlabcentral/fileexchange/53469-polycut2), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2015a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Vector Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Fixed case with degenerate holes (< 2 vertices)

1.0.0.0