trimesh
trimesh copied to clipboard
face_colors not updated when triangulating quad mesh
If you create a Trimesh object using quad faces and also pass in per-face colors, the faces are automatically triangulated, but the per-face colors array is not updated to reflect the new triangulation. To reproduce:
V = np.array([
[0.,0],
[1,0],
[1,1],
[0,1]
])
F = np.array([[0,1,2,3]])
C = np.array([[255,0,0]])
mesh = trimesh.Trimesh(vertices=V, faces=F, face_colors=C)
print(mesh.faces)
print(mesh.visual.face_colors)
Output:
[[0 1 3]
[3 2 0]]
[[255 0 0 255]]
Expected Output:
[[0 1 3]
[3 2 0]]
[[255 0 0 255]
[255 0 0 255]]
Hey, yeah this isn't implemented, you probably are best off triangulating the faces and stacking the colors yourself. PR's welcome!