For this sample torus mesh in trimesh
, I've managed to plot the normals to facets:
import numpy as npimport trimeshmesh = trimesh.creation.torus(9, 3)# adapted from https://github.com/mikedh/trimesh/issues/549vec = np.column_stack((mesh.facets_origin, mesh.facets_origin + (mesh.facets_normal * mesh.scale * .05)))path = trimesh.load_path(vec.reshape((-1, 2, 3)))trimesh.Scene([mesh, path]).show(smooth=False)
but as you can see, the origin of the facets is simply one of the vertices. How can the center of the facet be used as an origin for normals instead? I see mesh.triangles_center
but there's not such luxury defined for facets it seems.