I noticed that the trimesh.section
method returns a Path3D
with the indices of the intersected faces stuck into the path's metadata['face_index']
. I also noticed that the number of face indices corresponds to the number of the path's entities' nodes:
paths = inner.section(plane_origin=origin, plane_normal=norm)
assert(len([node for path in paths.entities for node in path.nodes]) == len(paths.metadata['face_index']))
However, the face_index seems to be out-of-order with regard to the path's entities' nodes. Given a specific path entity, how can i find the faces on the mesh that the path entity lays upon?
I was able to find the faces to remove with a face_adjacency graph, but it seems like there must be a better way to do this, since the work has essentially already been done in the call to
section
: