I need some help with calculating volume on MATLAB.

9 Ansichten (letzte 30 Tage)
jcn2912
jcn2912 am 4 Jan. 2018
Verschoben: DGM am 4 Apr. 2025
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?

Akzeptierte Antwort

Konrad
Konrad am 15 Sep. 2021
Verschoben: DGM am 4 Apr. 2025

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by