trimesh
trimesh copied to clipboard
Converting edges to faces
Hi,
My graph dataset does not have face information, and it has edges and x,y,z coordinates at nodes.
For example, vertex_numbers = [1, 2, 3, 4, 5, 6]
edges = [
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(2, 3),
(3, 4),
(4, 5),
(5, 2),
(2, 6),
(3, 6),
(4, 6),
(5, 6)
]
Assuming that I'm only using triangular mesh, how could I create faces from edges?
Hey, it's going to be breathtakingly slow on larger values but you could use networkx.from_edgelist + networkx.simple_cycles. There's probably a faster way to do it with scipy.csgraph or perhaps a simple lookup.