I need some help with calculating volume on MATLAB.

조회 수: 6 (최근 30일)
jcn2912
jcn2912 2018년 1월 4일
이동: DGM 2025년 4월 4일
Hello, I'm trying to write a code that calculates the volume of any given STL file on MATLAB.
If you don't know what STL files are: https://all3dp.com/what-is-stl-file-format-extension-3d-printing/
The code should be able to calculate the volume of a simple cube, or a complex shape with lots of uneven round edges. I was thinking since STL format divides the SURFACE to micro triangles (these triangles are all equal to each other and the total number of triangles is present in the STL file), I could change those triangles to be tetrahedrons, (find the volume of 1 micro tetrahedron), multiply it by the total number of triangles to find the total volume.
I am not very skilled in MATLAB, so I'm having trouble with the coding part. After getting the STL file to work on MATLAB, what should be the next step? I'm assuming it will come in a matrix form. What will multiplying this matrix with the volume of a single tetrahedron give me? If it gives me the total volume, it will still be in a matrix form. How do I change it to a single value? Normally, it would not be a problem for me to solve this but I have to do this calculation on MATLAB and I'm not really familiar with it. Can you please point me in the right direction or give me some advice on how to do it?

채택된 답변

Konrad
Konrad 2021년 9월 15일
이동: DGM 2025년 4월 4일

추가 답변 (0개)

카테고리

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