1

i want to use the vtkplotlib library to display different 3d models and i want to set the opacity in the background of the widget to 0. I just know how to set the normal background color with the method:

ModelViewer.background_color = [255,0,0]

Maybe somebody can help me. Below are some links for the vtkplotlib library.

Github: https://github.com/bwoodsend/vtkplotlib

Pypi: https://pypi.org/project/vtkplotlib/

documentation: https://vtkplotlib.readthedocs.io/en/latest/

Here is a little example:

import vtkplotlib as vpl

# ModelViewer
ModelViewer = vpl.QtFigure2(name="Model viewer")
ModelViewer.add_screenshot_button(pixels=1080)
ModelViewer.add_preset_views()
ModelViewer.add_cursor_tracker()

# set background color
ModelViewer.background_color = [255,0,0]

# add model
plot = vpl.mesh_plot(vpl.data.get_rabbit_stl(), color=[0,100,0], fig=ModelViewer, opacity=0.1)
plot.name = "rabbit"
#plot.opacity(100)

ModelViewer.show()
marxcell
  • 69
  • 6

0 Answers0