주요 콘텐츠

지형도로 만드는 제약 조건이 적용되는 들로네 삼각분할

R2026b

미국의 외곽 경계를 나타내는 지도를 사용하여 제약 조건이 적용된 들로네 삼각분할을 만듭니다.

국경이 표시된 미국 지도를 불러옵니다.

load usapolygon

다각형 경계를 구성하는 두 개의 연속된 점 사이의 모서리 제약 조건을 정의하고 들로네 삼각분할을 생성합니다. 이 삼각분할은 점 집합에 대한 컨벡스 헐(Convex Hull)에 의해 경계가 지정된 영역에 걸쳐 있습니다. 데이터 세트에는 중복된 데이터 점이 포함되어 있습니다. 즉, 위치가 동일한 데이터 점이 두 개 이상 있습니다. 중복된 점은 거부되고 delaunayTriangulation은 이에 따라 제약 조건의 형식을 다시 지정합니다.

nump = numel(uslon);
C = [(1:(nump-1))' (2:nump)'; nump 1];
dt = delaunayTriangulation(uslon,uslat,C);
Warning: Duplicate data points have been detected and removed.
 The Triangulation indices and constraints are defined with respect to the unique set of points in delaunayTriangulation.
Warning: Intersecting edge constraints have been split, this may have added new points into the triangulation.

다각형의 영역 내에 있는 삼각형을 필터링한 후 플로팅합니다.

io = isInterior(dt);
patch(Faces=dt(io,:),Vertices=dt.Points,FaceColor="r")
axis equal
axis([-130 -60 20 55])
title("Constrained Delaunay Triangulation of usapolygon")

Constrained Delaunay triangulation of the perimeter of the United States, filled in red with black triangle edges