In [ ]:
import trimesh

In [ ]:
from trimesh.integrate import symbolic_barycentric

In [ ]:
mesh = trimesh.load('../models/featuretype.STL')

In [ ]:
integrator, expr = symbolic_barycentric('x**2 + y**2 + z**2')

In [ ]:
expr

In [ ]:
# the integrator will quickly evaluate the surface integral for each triangle in the mesh
result = integrator(mesh)

In [ ]:
result

In [ ]:
result.shape, mesh.faces.shape

In [ ]:
result.sum()