PyVista Scale Bar to show object size

510 Views Asked by At

I want to add a scale bar to show the 3D object size scales the same way with the object, when the user zooms in/out. However the default scale bar of pyvista sticks to the screen that won't move (which is indeed a color bar). I dug somewhere else this, but it seems nobody answered. I tried drawing a 3D line as below, so that its size won't change, but this line behaves weirdly (moving not the same angular velocity when rotating the camera):

from pyvista import examples
plane = examples.load_airplane()
plotter = pv.Plotter(notebook=False)
line = pv.Line((0, 0, 0), (0, 0, 20))  # serves as a scale bar with fixed length for object size calibration
plotter.add_mesh(line)
plotter.add_mesh(plane)
plotter.show()
0

There are 0 best solutions below