I was trying to convert a torch_geometric Data object in Trimesh, but I wasn't able to properly colour the vertices I wanted. Apparently Trimesh re-orders the vertices during the conversion.
Comparing torch_geom_obj.pos with torch_geom_obj_2.pos you will notice that they are different.
Expected behavior
In my opinion torch_geom_obj.pos and torch_geom_obj_2.pos should be the same, this would ease the display of information on the mesh through Trimesh (e.g. it would allow to colour vertices given indices or vertex-wise colours obtained in pytorch geometric).
This behaviour is actually trvial to fix. It is just a matter of changing the returned object of the following function
🐛 Bug
Hi,
First of all, thanks for this amazing library.
I was trying to convert a torch_geometric Data object in Trimesh, but I wasn't able to properly colour the vertices I wanted. Apparently Trimesh re-orders the vertices during the conversion.
To Reproduce
Steps to reproduce the behavior:
torch_geom_obj.pos
withtorch_geom_obj_2.pos
you will notice that they are different.Expected behavior
In my opinion
torch_geom_obj.pos
andtorch_geom_obj_2.pos
should be the same, this would ease the display of information on the mesh through Trimesh (e.g. it would allow to colour vertices given indices or vertex-wise colours obtained in pytorch geometric).This behaviour is actually trvial to fix. It is just a matter of changing the returned object of the following function
https://github.com/rusty1s/pytorch_geometric/blob/35003e272c723187d2cb5be51bcf04861db12518/torch_geometric/utils/convert.py#L116-L128
with: