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

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

 Akzeptierte Antwort

Atsushi Ueno
Atsushi Ueno am 19 Okt. 2022

2 Stimmen

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 Kommentar

YA
YA am 20 Okt. 2022
ご回答ありがとうございます。
polybuffer関数というものがあったのですね。
非常に参考になりました。 ありがとうございました。

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 基本的な多角形 finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022b

Gefragt:

YA
am 19 Okt. 2022

Kommentiert:

YA
am 20 Okt. 2022

Community Treasure Hunt

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

Start Hunting!