필터 지우기
필터 지우기

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')

답변 (0개)

카테고리

Help CenterFile Exchange에서 Triangulation Representation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by