trimesh
trimesh copied to clipboard
Display only path3D
Hi all, I am trying to plot the 3D path without the mesh, but it cannot show the plot as I expected. Here I run another small example to test the issue, it still gives me blank plot.
import trimesh as tm
import numpy as np
vertices = np.array([[0, 0, 0], [1,1,1]])
lines = [tm.path.entities.Line([0, 1])]
p = tm.path.Path3D(entities=lines, vertices=vertices, process=False)
sc = tm.Scene(p)
sc.show()
The result is shown below:
No matter how I zoom in, out and rotate, it is always a blank plot. The version of trimesh is
trimesh==3.10.7
Try to add colors in the path definition. The behaviour depends on the viewer backend "gl"
or "notebook"
.
import trimesh as tm
import numpy as np
vertices = np.array([[0, 0, 0], [1, 1, 1], [-1, 1, 1]])
lines = [tm.path.entities.Line([0, 1]),
tm.path.entities.Line([1, 2]),
tm.path.entities.Line([2, 0])]
# per entity RGB or RGBA colors, alpha is ignored in "notebook" viewer
colors = [(255, 0, 0, 255),(0, 255, 0, 127),(0, 0, 255, 32)]
p = tm.path.Path3D(entities=lines, vertices=vertices, process=False, colors=colors)
sc = tm.Scene(p)
sc.show()