フィルターのクリア

How to calculate the volume of a facet using convhulln() function?

2 ビュー (過去 30 日間)
Abdul Suleman
Abdul Suleman 2016 年 12 月 18 日
回答済み: Abdul Suleman 2016 年 12 月 22 日
I am getting an error to calculate the volume of the square [0 0 0; 1 0 0; 1 1 0; 0 1 0], using convhulln, coming from qhullmx. Can you please help me on this? Thanks.
  3 件のコメント
Image Analyst
Image Analyst 2016 年 12 月 18 日
What cube John? It looks just like a square in the z=0 plane. So it's not even really a 3-D volume. Even if it were tilted it would not enclose a 3D volume - it would still be a planar object - so using convhulln() is not appropriate.
Anyway, the answer is trivial = the volume is zero, and the surface area is 1 if you count one planar side of the square and 2 if you count the area "on top" of the square and "on bottom" of the square separately.
John D'Errico
John D'Errico 2016 年 12 月 18 日
oops. Not even a cube. Still asleep I guess. Yes, the enclosed volume is zero.
The issue is if the OP is looking to compute a 2-d "volume" of this object, in the plane of the square, thus the area. We don't really know what they are looking to get here.

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

採用された回答

Image Analyst
Image Analyst 2016 年 12 月 22 日
A facet does not have a volume. It will have an area. Perhaps you mean how to get the area. Try using polyarea() though be sure to have your vertices go in a sorted order around the perimeter or else you could get a negative area. (polyarea tells you that the area of a figure eight or bowtie is zero believe it or not.)

その他の回答 (2 件)

Soumya Saxena
Soumya Saxena 2016 年 12 月 21 日
I understand that you are getting an error with the "qhullmx" function while calling the "convhulln" function. You are defining 4 points in a 3D space as follows:
X= [0 0 0; 1 0 0; 1 1 0; 0 1 0]
However, all inputs have the 3rd dimension as 0. The z coordinate is 0. So,these become 4 points in the X-Y plane. This would represent a plane, not a 3D surface. If you put a non zero value in the in one of the 3rd dimension coordinates, the call should be error free. For example:
X= [0 0 0; 1 0 0; 1 1 0; 0 1 1]
convhulln(X)
The output should be:
2 3 1
4 2 1
3 4 1
4 3 2

Abdul Suleman
Abdul Suleman 2016 年 12 月 22 日
I thank Soumya Saxena and Image Analyst for their cooperative attitude. Indeed, I need to calculate the "area" of all facets of a given polytope. As far as I understand, polyarea() works for polygons only. Best, Abdul.

カテゴリ

Help Center および File ExchangeBounding Regions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by