Is there a way to have a 3D plot on say and clearly see the bounded region?

4 件のコメント

Walter Roberson
Walter Roberson 2021 年 12 月 26 日
Is it a solid or a surface ?
When you say "clearly see" do you mean you want the bounding planes drawn in?
Hmm!
Hmm! 2021 年 12 月 26 日
I am expecting to see all eight extreme points on the polyhedron. According to the reference text, there are 8 extreme points but whenever I plot I see 4.
John D'Errico
John D'Errico 2021 年 12 月 26 日
Um, unless you make the polyhedron translucent, do you expect to see those in the back?
Hmm!
Hmm! 2021 年 12 月 26 日
Just anything that gets the job done!

サインインしてコメントする。

 採用された回答

John D'Errico
John D'Errico 2021 年 12 月 26 日
編集済み: John D'Errico 2021 年 12 月 26 日

0 投票

Easy peasy.
lb = [1 1 1];
ub = [2 2 2];
plotregion([],[],lb,ub)
view(29,30)
grid on
box on
plotregion can be found on the file exchange for free download.

3 件のコメント

Hmm!
Hmm! 2021 年 12 月 26 日
It gets the job done. Can we also draw this manually "by hand" assuming no resources like matlab to aid us? I tried it several times on a paper with a 3-axis to represent the 3D and I can't visualize it to get all the extreme points. Generally, is there any trick or hint?
Walter Roberson
Walter Roberson 2021 年 12 月 27 日
Or you could refer to https://www.mathworks.com/matlabcentral/answers/1447449-how-to-draw-a-volxe-size#comment_1728709 where I posted code that voxelizes a volume. In particular the rV array gives corner coordinates (vertices) and the rF array gives the indices into the vertices array needed to create the faces. When I built that code, I made sure to use the consistent "counter-clockwise" ordering of vertices in building the faces, so that lighting would work correctly.
John D'Errico
John D'Errico 2022 年 1 月 17 日
Could this have been done in another way? Yes, Of course. That the tool I show does what it does using MATLAB itself proves that it can be done. In fact, I can think of at least 2 or 3 easy ways you could do this using other tools.
Could you have used tools like patch to plot those facets? OF COURSE. Trivially so. If you cannot see all 8 vertices, then you need to remember to make the facets of the surface translucent, otherwise you cannot see through the front facets to see those that are hidden.
But the solution I showed does exactly what you asked to do.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2021b

質問済み:

2021 年 12 月 26 日

コメント済み:

2022 年 1 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by