issue_893.py 966 B

123456789101112131415161718192021222324252627282930313233
  1. import numpy as np
  2. import vedo
  3. N = np.arange(24).reshape([2, 3, 4])
  4. cubes = []
  5. texts = []
  6. positions = []
  7. xs, ys, zs = N.shape
  8. for x in range(xs):
  9. for y in range(ys):
  10. for z in range(zs):
  11. pos = (x, y, z)
  12. val = N[x, y, z]
  13. cubes.append(vedo.Cube(pos=pos, side=0.6, alpha=0.1))
  14. positions.append(pos)
  15. pts = vedo.Points(positions)
  16. labs= pts.labels2d(font='Quikhand', scale=2, justify="top-center", c="red4")
  17. vedo.show(cubes, labs, axes=4).close()
  18. ################################################################### (BUG)
  19. texts = []
  20. xs, ys, zs = [2, 1, 2]
  21. for x in range(xs):
  22. for y in range(ys):
  23. for z in range(zs):
  24. pos = (x, y, z)
  25. txt = vedo.Text3D(f"{pos}", pos, s=0.05, justify='centered', c='r5')
  26. txt.rotate_x(0.00001)
  27. txt.shift(0.00001, 0.00001, 0.00001) # same as rotate_x
  28. texts.append(txt.follow_camera())
  29. vedo.show(texts, axes=1)