addons

Additional objects like axes, legends etc..

addButton

vedo.addons.addButton(fnc, states='On', 'Off', c='w', 'w', bc='dg', 'dr', pos=20, 40, size=24, font='arial', bold=False, italic=False, alpha=1, angle=0)[source]

Add a button to the renderer window.

Parameters
  • states (list) – a list of possible states [‘On’, ‘Off’]

  • c – a list of colors for each state

  • bc – a list of background colors for each state

  • pos – 2D position in pixels from left-bottom corner

  • size – size of button font

  • font (str) – font type (arial, courier, times)

  • bold (bool) – bold face (False)

  • italic (bool) – italic face (False)

  • alpha (float) – opacity level

  • angle (float) – anticlockwise rotation in degrees

buttons.py buttons.py

addCutterTool

vedo.addons.addCutterTool(mesh)[source]

Create handles to cut away parts of a mesh.

cutter.py cutter.py

addIcon

vedo.addons.addIcon(mesh, pos=3, size=0.08)[source]

Add an inset icon mesh into the renderer.

Parameters
  • pos – icon position in the range [1-4] indicating one of the 4 corners, or it can be a tuple (x,y) as a fraction of the renderer size.

  • size (float) – size of the icon space.

icon icon.py

addLegend

vedo.addons.addLegend()[source]

addLight

vedo.addons.addLight(pos, focalPoint=0, 0, 0, deg=180, c='white', intensity=0.4, removeOthers=False, showsource=False)[source]

Generate a source of light placed at pos, directed to focal point. Returns a vtkLight object.

Parameters
  • focalPoint – focal point, if this is a vtkActor use its position.

  • deg – aperture angle of the light source

  • c – set light color

  • intensity (float) – intensity between 0 and 1.

  • removeOthers (bool) – remove all other lights in the scene

  • showsource (bool) – if True, will show a representation of the source of light as an extra Mesh

Hint

lights.py

addScalarBar

vedo.addons.addScalarBar(obj, pos=0.8, 0.05, title='', titleXOffset=0, titleYOffset=15, titleFontSize=12, nlabels=None, c=None, horizontal=False, useAlpha=True)[source]

Add a 2D scalar bar for the specified obj.

addScalarBar3D

vedo.addons.addScalarBar3D(obj, pos=None, sx=None, sy=None, title='', titleXOffset=- 1.5, titleYOffset=0.0, titleSize=1.5, titleRotation=0.0, nlabels=9, labelOffset=0.375, italic=0, c=None, useAlpha=True, drawBox=True)[source]

Draw a 3D scalar bar.

obj input can be:
  • a list of numbers,

  • a list of two numbers in the form (min, max),

  • a Mesh already containing a set of scalars associated to vertices or cells,

  • if None the last object in the list of actors will be used.

Parameters
  • sx (float) – thickness of scalarbar

  • sy (float) – length of scalarbar

  • title (str) – scalar bar title

  • titleXOffset (float) – horizontal space btw title and color scalarbar

  • titleYOffset (float) – vertical space offset

  • titleSize (float) – size of title wrt numeric labels

  • titleRotation (float) – title rotation in degrees

  • nlabels (int) – number of numeric labels

  • labelOffset (float) – space btw numeric labels and scale

  • useAlpha (bool) – render transparency of the color bar, otherwise ignore

  • drawBox (bool) – draw a box around the colorbar (useful with useAlpha=True)

addSlider2D

vedo.addons.addSlider2D(sliderfunc, xmin, xmax, value=None, pos=4, title='', font='arial', titleSize=1, c=None, showValue=True)[source]

Add a slider widget which can call an external custom function.

Parameters
  • sliderfunc – external function to be called by the widget

  • xmin (float) – lower value

  • xmax (float) – upper value

  • value (float) – current value

  • pos (list) – position corner number: horizontal [1-5] or vertical [11-15] it can also be specified by corners coordinates [(x1,y1), (x2,y2)]

  • title (str) – title text

  • font (str) – title font [arial, courier]

  • titleSize (float) – title text scale [1.0]

  • showValue (bool) – if true current value is shown

sliders.py sliders.py

addSlider3D

vedo.addons.addSlider3D(sliderfunc, pos1, pos2, xmin, xmax, value=None, s=0.03, t=1, title='', rotation=0, c=None, showValue=True)[source]

Add a 3D slider widget which can call an external custom function.

Parameters
  • sliderfunc – external function to be called by the widget

  • pos1 (list) – first position coordinates

  • pos2 (list) – second position coordinates

  • xmin (float) – lower value

  • xmax (float) – upper value

  • value (float) – initial value

  • s (float) – label scaling factor

  • t (float) – tube scaling factor

  • title (str) – title text

  • c – slider color

  • rotation (float) – title rotation around slider axis

  • showValue (bool) – if True current value is shown

sliders3d.py sliders3d.py