Calculation of the surface area of a generic solid

조회 수: 17 (최근 30일)
Lorenzo Marta
Lorenzo Marta 2022년 6월 16일
편집: Matt J 2022년 6월 17일
Hello, everyone,
I am having problems calculating the surface of a generic 3d solid in stl format. How can I do this? (For the volume I am using these commands:
-mesh = generateMesh(model);
-mv = volume(mesh))

답변 (1개)

Matt J
Matt J 2022년 6월 16일
One way might be to read the stl file into a triangulation object using stlread. With the triangulation object, you can use freeBoundary to obtain the surface facets of the mesh. It should then be a simple matter to compute the facet areas and add them up.
  댓글 수: 7
Matt J
Matt J 2022년 6월 16일
Yes.
Matt J
Matt J 2022년 6월 16일
편집: Matt J 2022년 6월 17일
You could probably vectorize the area calculation as well. For example, if there are N facets and you organize the triangle vertices into three 3xN arrays A,B,C the total area could be computed with,
Area=sum( vecnorm( cross(B-A,C-A) ,2,1) )/2;

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by