Getting Surface Area of different face normal directions from PolyData

Hi all,

I am creating meshes for 3D crystalline shapes to get an understanding of the surface area covered by each face normal direction. This will allow me to make surface energy predictions.

However, whilst I am able to get the surface mesh I am unable to get the surface area and normal of each face. How can I access the face objects from the PolyData object?

And is there a pre-existing way to do something like this? I know this isn’t the forum for it, but just so people know what I’ve done, I’m using PyVista and this is my code:

array = grain.steps[0].atom_data.values[:, 2:5]
cloud = pv.PolyData(array)
volume = cloud.delaunay_3d(alpha=2.)
shell = volume.extract_geometry()
print(shell.face_normals, shell.area, shell.faces)
shell.plot()

I am assuming there is a reasonable amount of continuity between pyvista and VTK, however I accept this may not be helpful! If it’s not please disregard it, I would be just as happy to know how to do it in VTK!

Thanks for any help you can give me.

It is typically not robust to use surface normals for extracting regions, because normals can be noisy and it is hard to find good angles and tolerance values.

Instead, drawing a closed curve on the surface and extract the enclosed region usually works better. You can try this with a graphical user interface in 3D Slicer and if it works well for you then automate it using Python scripting.

If you show a few screenshots of your meshes and describe what parts you want to extract then we may be able to give more specific advice.