trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Display only path3D

Open mikami520 opened this issue 2 years ago • 1 comments

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: Screen Shot 2022-04-03 at 16 53 24 No matter how I zoom in, out and rotate, it is always a blank plot. The version of trimesh is trimesh==3.10.7

mikami520 avatar Apr 03 '22 20:04 mikami520

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()

pelayogmp avatar Apr 06 '22 18:04 pelayogmp