フィルターのクリア

Robust way to calculate volume of a 3D polygon given a triangulation

16 ビュー (過去 30 日間)
David Winthrop
David Winthrop 2020 年 1 月 31 日
コメント済み: KSSV 2020 年 2 月 1 日
I am looking for a way to calculate the volume of this shape. I export this shape to a professional finite element software which gives the volume as 4.0821e-8 so that is the number I am looking for. I currently use the following:
i1 = tri(:,1);
i2 = tri(:,2);
i3 = tri(:,3);
% vectors of triangle base
v1 = [p2(i1,1)-p2(i2,1) p2(i1,2)-p2(i2,2) p2(i1,3)-p2(i2,3)];
v2 = [p2(i1,1)-p2(i3,1) p2(i1,2)-p2(i3,2) p2(i1,3)-p2(i3,3)];
A = 1/2*cross(v1,v2,2); % surface of a triangle
V = 1/3*dot(A,[x(i1) y(i1) z(i1)],2); % volume of a triangle
V = sum(abs(V))
But it gives a different value. How can I find the volume robustly? I have attached a mat file with the variables tri and p2 such that ths plots the shape:
trisurf(tri,p2(:,1),p2(:,2),p2(:,3),'facecolor','c','edgecolor','b')
  1 件のコメント
KSSV
KSSV 2020 年 2 月 1 日
Try:
dt = delaunayTriangulation(x,y,z) ;
[C,v] = convexHull(dt);
v

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeTriangulation Representation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by