Effacer les filtres
Effacer les filtres

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

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

Réponse acceptée

Atsushi Ueno
Atsushi Ueno le 19 Oct 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 commentaire
YA
YA le 20 Oct 2022
ご回答ありがとうございます。
polybuffer関数というものがあったのですね。
非常に参考になりました。 ありがとうございました。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 基本的な多角形 dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!