Closed vivek4890 closed 6 years ago
This is not a numpy-stl issue, but basic calculus.
If I am correct, @WoLpH added a property to each polygon containing its area, which you can then just sum:
myMesh.areas.sum()
or calculate it by hand by doing a vector cross product
v0 = myMesh.data['vectors'][:, 0]
v1 = myMesh.data['vectors'][:, 1]
v2 = myMesh.data['vectors'][:, 2]
normals = 0,5*numpy.cross(v1 - v0, v2 - v0) # half the surface area of the parallelogram spanned by the vectors
Before myMesh.areas
is available you'll need to call the update_areas()
method. But after that it should work as @Uvar suggested :)
Hello,
I want to calculate surface area for stl file, is there any method I can use to get surface area like "get_mass_properties()", I used it to calculate volume. I'm new in Python please suggest how can I get the surface area for any .stl file.
thanks !