メインコンテンツ

地図の制約付き Delaunay 三角形分割

米国の周辺部の地図を使用して、制約付き Delaunay 三角形分割を作成します。

隣接する米国の周辺部の地図を読み込みます。

load usapolygon

ポリゴナル境界を構成する連続する 2 点間のエッジ制約を定義し、Delaunay 三角形分割を作成します。この三角形分割は、点集合の凸包で囲まれた領域にまたがります。データ セットは重複するデータ点を含んでいます。すなわち、2 つ以上のデータ点が同じ位置にあります。重複する点は除外され、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")

Figure contains an axes object. The axes object with title Constrained Delaunay Triangulation of usapolygon contains an object of type patch.