3D Bounding Boxの可視化がしたい

18 visualizaciones (últimos 30 días)
尚輝 伊東
尚輝 伊東 el 6 de Oct. de 2021
Comentada: Kenta el 8 de Oct. de 2021
Bounding Boxの可視化を3次元で行いたいです。
例えば、次のような8頂点の座標が与えられているとします。
[array([-35.89922945, 197.26166974, 17.43749083]),
array([-37.55457094, 88.89204521, 20.0512217 ]),
array([ 61.77622177, 97.12136408, 424.16114286]),
array([ 63.43156326, 205.49098861, 421.54741199]),
array([148.03557994, 84.95884208, -25.48700505]),
array([149.69092143, 193.32846662, -28.10073593]),
array([249.02171414, 201.55778549, 376.00918523]),
array([247.36637265, 93.18816096, 378.62291611])]
この時、それぞれの点を頂点とする直方体を3次元空間で可視化したいです。
Bounding Boxなので、点と点を線で結んだような枠組みのみの直方体を可視化したいです。
よろしくお願いします。
  2 comentarios
Atsushi Ueno
Atsushi Ueno el 6 de Oct. de 2021
頂点だけでなく、面の定義をしないとこうなってしまいます。
「Bounding Boxを作った機能」側から「面を構成する頂点」の情報は得られないのでしょうか?
頂点の位置から面の構成を作るのは... (-公-;)チョットムズカシイ
bb=[array([-35.89922945, 197.26166974, 17.43749083]),
array([-37.55457094, 88.89204521, 20.0512217 ]),
array([ 61.77622177, 97.12136408, 424.16114286]),
array([ 63.43156326, 205.49098861, 421.54741199]),
array([148.03557994, 84.95884208, -25.48700505]),
array([149.69092143, 193.32846662, -28.10073593]),
array([249.02171414, 201.55778549, 376.00918523]),
array([247.36637265, 93.18816096, 378.62291611])];
plot3(bb(:,1),bb(:,2),bb(:,3)); hold on;
plot3(bb(:,1),bb(:,2),bb(:,3), '*');
function out = array(vertex)
out = vertex;
end
尚輝 伊東
尚輝 伊東 el 8 de Oct. de 2021
Ueno 様
ご回答ありがとうございます。
やはり今の条件だけでは厳しいようですね...
検討していただき、ありがとうございます。

Iniciar sesión para comentar.

Respuesta aceptada

Kenta
Kenta el 6 de Oct. de 2021
伊東さま、こんにちは、このようなイメージでしょうか?showshapeという関数で行えます。
またもう少しカスタマイズしたければ以下のファイルなどを参考に書き換えてみてもいいかもしれません。
https://jp.mathworks.com/matlabcentral/fileexchange/18264-minimal-bounding-box
pt=pcread('teapot.ply');
figure;pcshow(pt);hold on
pos = [0.3753 0 1.65 6 4 3 0 0 0];
showShape('cuboid',pos,'Color','green','Opacity',0.5)
  2 comentarios
尚輝 伊東
尚輝 伊東 el 8 de Oct. de 2021
Kenta 様
ご回答ありがとうございます。
まさにこのような処理がやりたかったです。
条件をもう少し工夫する必要がありますが、関数を教えていただきありがとうございます。
Kenta
Kenta el 8 de Oct. de 2021
@尚輝 伊東 さま、ご連絡ありがとうございます。よかったです。
なるほど、これからどんどんカスタマイズされるのですね、スムーズに実装できるといいですね!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!