vedo icon indicating copy to clipboard operation
vedo copied to clipboard

Bad point projection

Open gheylam opened this issue 2 years ago • 1 comments

Hello!

I've been using vedo frequently for plotting points and normal vectors on a laptop. When I switched to a desktop I find that the point projections are off.

I have made sure the following libraries were the same on both the laptop and the desktop: numpy==1.18.2 vedo==2021.0.3 vtk==9.0.1 vtkplotlib==1.4.0

Both images are from my desktop. The first image shows a point and a arrow that extends from the point. However, we can see the arrow and the point does not intersect (even though they have the same coordinate).

The code I am using:

from vedo import *
import numpy as np

n_pts = 3
pts_np = np.random.randint(0, 50, (n_pts, 3))
pts_np_2 = np.random.randint(0, 50, (n_pts, 3))
pts = pts_np
pts2 = pts_np_2
pts_vedo = Points(pts, r=1000, c="black")
pts_vedo_2 = Points(pts2, r=1000, c="red")

arrows = []
for pt_index in range(n_pts):
    pt1 = pts_np[pt_index, :]
    pt2 = pts_np_2[pt_index, :]
    pt_1_tup = (pt1[0], pt1[1], pt1[2])
    pt_2_tup = (pt2[0], pt2[1], pt2[2])
    arrow = shapes.Arrow(pt_1_tup, pt_2_tup, c="r4", s=0.001)
    arrows.append(arrow)

show(pts_vedo, pts_vedo_2, arrows, axes=4)

In the second image, I have zoomed in and the point and the arrow now intersect.

I have also found that changing the radius 'r' parameter of my point does not make much difference. Regardless of how large I made the radius of my points, the visualizer shows the point with little to no changes in radius.

vedo_misaligned_point

vedo_aligned_point

Are there any hardware drivers I should be cautious of? Or maybe there are other dependencies that is causing this to be a problem. Would appreciate any help.

gheylam avatar Oct 21 '21 11:10 gheylam

that is quite strange, unfortunately I'm unable to reproduce the issue :(( Yes, there must be some issue in the graphics part, but I'm afraid I'm unable to identify what the problem could be..

marcomusy avatar Oct 22 '21 21:10 marcomusy