1. About
  2. Features
  3. Explore

Please, how do I compute the surface & volume of a large amount of STL files ?

I have over 3000 STL files, and I want to know their respective volumes and surfaces. I will use this data to be able to identify the biggest part, the one with the biggest surface, etc.

I found that the fine Admesh (included in openscad, as far as I know) software that can compute the volume via command-line (powershell) and with some text editing I can get the volumes for all of these parts (needing some patience), but I didn't find any similar tool for the surface.

The best tool would output such thing as:

input.stl - 75.554mm2 - 45.547mm3

I'm not sure this post is adequate in here, but anyway, thanks.

1 Answer 1

You could use the Python console of FreeCAD. Issuing the following commands

FreeCAD.ActiveDocument.ActiveObject.Shape.Area FreeCAD.ActiveDocument.ActiveObject.Shape.Volume 

will output the area and the volume of the object, respectively.

I don't know how to access the console output from outside FreeCAD, but there is an option in FreeCAD called Redirect internal Python output to report view which I think is what you are looking for.

You might want to look into the Scripting documentation of FreeCAD for further instructions.

Using the Python console of FreeCAD to calcaulate area and volume of an object