How to acquire the surface mesh area

Hi, dear developers, I got a problem to acquire the area of the curved polygon (picture as shown below) . I just want to get the are of the part circled by the brush. However, it seems that ovito outputs area as the whole area of the mesh. So I wonder is there a way to get this circled area? Thanks a lot!

Hi,

Right, Ovito always calculates the total area of the surface. There currently isn’t an option to restrict the calculation to a subset or region of the surface.

However, it should be not too difficult to write a custom Python function that calculates the sum of the area of all triangular surface elements that are inside the circular target region. In Python, you can access the list of mesh triangle elements through the ovito.data.SurfaceMesh class.

If you have licensed OVITO Pro, I can actively help you with working out the details of the surface area calculation.

Thanks very much!

It looks like the surface is flat outside the circle for which you want to calculate the surface area.
So in this case, you could subtract the surface area of a flat square of the same size as your curved surface. This will give you an excess surface area. If you then add the surface area of the circle for which you want the surface area, you should get the total surface area of the circular area.

Thanks very much.
Actually, the problem is that I can’t determine the area I’ve circled. The circle in the picture above is painted roughly by me.