"""Example of drawing objects on different windowsand/or subwindows within the same window.We split the main window in many subwindows and drawsomethingon specific windows numbers.Then open an independent window and draw a shape on it."""print(__doc__)from vtkplotter import *########################################################################### this is one instance of the class Plotter with 5 raws and 5 columnsvp1 = Plotter(shape=(5,5), axes=0, bg="white")# set a different background color for a specific subwindow (the last one)vp1.renderers[24].SetBackground(0.8, 0.9, 0.9) # use vtk method SetBackground()# load the actors and give them a namea = vp1.load(datadir+"airboat.vtk")b = vp1.load(datadir+"cessna.vtk", c="red")c = vp1.load(datadir+"atc.ply")# show a text in each rendererfor i in range(25):txt = Text("renderer\nnr."+str(i), c='k', font='arial', s=1)vp1.show(txt, at=i)vp1.show(a, at= 6)vp1.show(b, at=23)vp1.show(c, at=24)########################################################################### declare a second independent instance of the class Plotter# shape can also be given as a string, e.g.:# shape="2/6" means 2 renderers above and 6 below# shape="3|1" means 3 renderers on the left and one on the rights = load(datadir+'pumpkin.vtk')# Set the position of the horizontal of vertical splitting [0,1]:#settings.windowSplittingPosition = 0.5vp2 = Plotter(pos=(500, 250), shape='2/6')for i in range(len(vp2.renderers)):s2 = s.clone().color(i)txt = Text('renderer #'+str(i))vp2.show(s2, txt, at=i)interactive()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。