multirenderers.py 1.1 KB

12345678910111213141516171819202122232425
  1. """Manually define the number, shape and position
  2. of the renderers inside the rendering window"""
  3. from vedo import settings, ParametricShape, Text2D, Plotter
  4. settings.immediate_rendering = False # faster for multi-renderers
  5. # (0,0) is the bottom-left corner of the window, (1,1) the top-right
  6. # the order in the list defines the priority when overlapping
  7. custom_shape = [
  8. dict(bottomleft=(0.0,0.0), topright=(1.00,1.00), bg='wheat', bg2='w' ),# ren0
  9. dict(bottomleft=(0.0,0.0), topright=(0.40,0.30), bg='blue3', bg2='lb'),# ren1
  10. dict(bottomleft=(0.5,0.4), topright=(0.95,0.95), bg='green', bg2='lg'),# ren2
  11. dict(bottomleft=(0.7,0.2), topright=(0.90,0.50), bg='red', bg2='pink'),# ren3
  12. dict(bottomleft=(0.1,0.6), topright=(0.30,0.80), bg='violet', bg2='w'),# ren4
  13. ]
  14. plt = Plotter(shape=custom_shape, size=(1200,900))
  15. for i, cust in enumerate(custom_shape):
  16. s = ParametricShape(i).color(i).lighting('glossy')
  17. msg = 'Renderer nr.'+str(i)+'\n'+str(cust)+'\nShape = '+s.name
  18. plt.at(i).show(s, msg)
  19. plt.at(0).add(Text2D(__doc__, pos='bottom-right', font="Quikhand", s=1.5))
  20. plt.interactive().close()