メインコンテンツ

2 次元メッシュを変更した境界に変形

領域の境界線への変更を適用するために 2 次元領域のメッシュを変形します。

データを読み込みます。変形するメッシュは、面と頂点の形式の三角形分割 trifexfeyfe で定義されます。

load trimesh2d
clf
triplot(trife,xfe,yfe)
axis equal
axis([-10 310 -10 310])
axis equal
title("Initial Mesh")

Figure contains an axes object. The axes object with title Initial Mesh contains an object of type line.

背景の三角形分割 - メッシュの境界を表す点集合の制約付き Delaunay 三角形分割を作成します。メッシュの頂点ごとに、背景の三角形分割に対して位置を定義する記述子を計算します。記述子はその三角形に対して重心座標と共に囲まれた三角形を表します。

dt = delaunayTriangulation(x,y,Constraints);
clf
triplot(dt)
axis equal
axis([-10 310 -10 310])
axis equal
title("Background Triangulation")

Figure contains an axes object. The axes object with title Background Triangulation contains an object of type line.

descriptors.tri = pointLocation(dt,xfe,yfe);
descriptors.baryCoords = cartesianToBarycentric(dt,descriptors.tri,[xfe yfe]);

領域の境界線の変更を取り込むために、背景の三角形分割を編集します。

cc1 = [210 90];
circ1 = (143:180)';
x(circ1) = (x(circ1)-cc1(1))*0.6 + cc1(1);
y(circ1) = (y(circ1)-cc1(2))*0.6 + cc1(2);
tr = triangulation(dt(:,:),x,y);
clf
triplot(tr)
axis([-10 310 -10 310])
axis equal
title("Edited Background Triangulation - Hole Size Reduced")

Figure contains an axes object. The axes object with title Edited Background Triangulation - Hole Size Reduced contains an object of type line.

評価の根拠として、変形した背景の三角形分割を使用し、記述子を直交座標に戻します。

Xnew = barycentricToCartesian(tr,descriptors.tri,descriptors.baryCoords);
tr = triangulation(trife,Xnew);
clf
triplot(tr)
axis([-10 310 -10 310])
axis equal
title("Morphed Mesh")

Figure contains an axes object. The axes object with title Morphed Mesh contains an object of type line.