凸多角形の外周を一定距離で囲む凸多角形

2 visualizzazioni (ultimi 30 giorni)
YA
YA il 19 Ott 2022
Commentato: YA il 20 Ott 2022
MATLABに関する質問です。
任意の凸多角形の各辺から平行に一定距離wで囲む凸多角形の各頂点の座標を求めたいです。
元の任意の凸多角形の頂点の座標は既知です。
物理的な意味合いとしては、凸多角形の外周に一定距離の安全マージンを設けた少し大き目の凸多角形を作るということです。
できるだけ計算負荷の少ない求め方が希望です。
ご意見やアドバイスをお持ちでしたらよろしくお願いいたします。

Risposta accettata

Atsushi Ueno
Atsushi Ueno il 19 Ott 2022
polybuffer関数を使います。
なお事前にpolyshape関数でpolyshape オブジェクトを作成する必要があります。
% 元の任意の凸多角形の頂点の座標(既知)から polyshape オブジェクトを作成
polyin = polyshape([1 2 2 3 3 4 4],[1 3 4 4 2 2 1]);
% 凸多角形の外周を一定距離で囲む凸多角形の各頂点の座標を求める
polyout1 = polybuffer(polyin,0.5,'JointType','miter');
% 求めた凸多角形の各頂点の座標
polyout1.Vertices
ans = 7×2
4.5000 0.5000 0.1910 0.5000 1.5000 3.1180 1.5000 4.5000 3.5000 4.5000 3.5000 2.5000 4.5000 2.5000
plot(polyin);
hold on
plot(polyout1);
hold off
  1 Commento
YA
YA il 20 Ott 2022
ご回答ありがとうございます。
polybuffer関数というものがあったのですね。
非常に参考になりました。 ありがとうございました。

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 基本的な多角形 in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!