Open CalebDmArcher opened 4 months ago
I just tried the code below to calculate the total surface area. Seems like it is correct. Not sure why the top surface area is wrong.
exterior_faces = mesh.exteriorFaces
exterior_areas = mesh._faceAreas[exterior_faces]
total_exterior_area = sum(exterior_areas)
print(f"Total exterior surface area is {total_exterior_area} m^2")
The above code returns the result 0.0076 for the two-layer case. (I thought it would return 0.0096 as it would count all outer surfaces including the overlapped face between the two layers, but it did not.)
I think you want mesh.facesFront
or mesh.facesBack
. Your boxes are stacked along the z direction. mesh.facesTop
returns the faces with centers that maximize y.
I am trying to only get the top surface of the entire structure by using
mesh.facesTop
but it returns the top surface of all layers. As shown below, it is a two-layer structure and the top surface area should be 0.001 but it returns 0.002.So I modified the mesh part to 1 layer and it returns 0.001:
I also tried 3 layer which returns 0.003. Since I need to mask only the top surface to do some calculations, may I know what is the proper way to only get the top surface? (I also need to mask only the outer surfaces of the entire structure. I haven't tested yet, but I am afraid I might get the outer surfaces of all layers as well. )