VTK Implementation

This module provides VTK visualization implementation for NURBS-Python.

Class Reference

class geomdl.visualization.VisVTK.VisConfig(**kwargs)

Bases: geomdl.vis.VisConfigAbstract

Configuration class for VTK visualization module.

This class is only required when you would like to change the visual defaults of the plots and the figure.

The VisVTK module has the following configuration variables:

  • ctrlpts (bool): Control points polygon/grid visibility. Default: True
  • evalpts (bool): Curve/surface points visibility. Default: True
  • figure_size (list): Size of the figure in (x, y). Default: (800, 600)
  • line_width (int): Thickness of the lines on the figure. Default: 0.5
keypress_callback(obj, ev)

VTK callback for keypress events

class geomdl.visualization.VisVTK.VisCurve2D(config=<geomdl.visualization.VisVTK.VisConfig object>)

Bases: geomdl.vis.VisAbstract

add(ptsarr, plot_type, name='', color='')

Adds points sets to the visualization instance for plotting.

Parameters:
  • ptsarr (list, tuple) – control or evaluated points
  • plot_type (str) – type of the plot, e.g. ctrlpts, evalpts, bbox, etc.
  • name (str) – name of the plot displayed on the legend
  • color (str) – plot color
animate(**kwargs)

Generates animated plots (if supported).

If the implemented visualization module supports animations, this function will create an animated figure. Otherwise, it will call render() method by default.

clear()

Clears the points, colors and names lists.

ctrlpts_offset

Defines an offset value for the control points grid plots

Only makes sense to use with surfaces with dense control points grid.

Getter:Gets the offset value
Setter:Sets the offset value
Type:float
render(**kwargs)

Plots the curve and the control points polygon.

size(plot_type)

Returns the number of plots defined by the plot type.

Parameters:plot_type (str) – plot type
Returns:number of plots defined by the plot type
Return type:int
vconf

User configuration class for visualization

Getter:Gets the user configuration class
Type:vis.VisConfigAbstract
geomdl.visualization.VisVTK.VisCurve3D

alias of geomdl.visualization.VisVTK.VisCurve2D

class geomdl.visualization.VisVTK.VisSurface(config=<geomdl.visualization.VisVTK.VisConfig object>)

Bases: geomdl.vis.VisAbstract

VTK visualization module for surfaces.

add(ptsarr, plot_type, name='', color='')

Adds points sets to the visualization instance for plotting.

Parameters:
  • ptsarr (list, tuple) – control or evaluated points
  • plot_type (str) – type of the plot, e.g. ctrlpts, evalpts, bbox, etc.
  • name (str) – name of the plot displayed on the legend
  • color (str) – plot color
animate(**kwargs)

Generates animated plots (if supported).

If the implemented visualization module supports animations, this function will create an animated figure. Otherwise, it will call render() method by default.

clear()

Clears the points, colors and names lists.

ctrlpts_offset

Defines an offset value for the control points grid plots

Only makes sense to use with surfaces with dense control points grid.

Getter:Gets the offset value
Setter:Sets the offset value
Type:float
render(**kwargs)

Plots the surface and the control points grid.

size(plot_type)

Returns the number of plots defined by the plot type.

Parameters:plot_type (str) – plot type
Returns:number of plots defined by the plot type
Return type:int
vconf

User configuration class for visualization

Getter:Gets the user configuration class
Type:vis.VisConfigAbstract
class geomdl.visualization.VisVTK.VisVolume(config=<geomdl.visualization.VisVTK.VisConfig object>)

Bases: geomdl.vis.VisAbstract

VTK visualization module for volumes.

add(ptsarr, plot_type, name='', color='')

Adds points sets to the visualization instance for plotting.

Parameters:
  • ptsarr (list, tuple) – control or evaluated points
  • plot_type (str) – type of the plot, e.g. ctrlpts, evalpts, bbox, etc.
  • name (str) – name of the plot displayed on the legend
  • color (str) – plot color
animate(**kwargs)

Generates animated plots (if supported).

If the implemented visualization module supports animations, this function will create an animated figure. Otherwise, it will call render() method by default.

clear()

Clears the points, colors and names lists.

ctrlpts_offset

Defines an offset value for the control points grid plots

Only makes sense to use with surfaces with dense control points grid.

Getter:Gets the offset value
Setter:Sets the offset value
Type:float
render(**kwargs)

Plots the volume and the control points.

size(plot_type)

Returns the number of plots defined by the plot type.

Parameters:plot_type (str) – plot type
Returns:number of plots defined by the plot type
Return type:int
vconf

User configuration class for visualization

Getter:Gets the user configuration class
Type:vis.VisConfigAbstract