Skip to content

polydata

PolydataObject

Bases: SceneObject

Class-wrapper around the vtkPolyData object.

actor = vtkActor() instance-attribute

backface_color property writable

cell_color_scalar_name property writable

color property writable

color_scalar_name property writable

input_data property writable

lookup_table property writable

mapper = vtkPolyDataMapper() instance-attribute

mapper_input_connection property writable

mapper_input_data property writable

opacity property writable

__init__()

scale_coords(scale_factor)

Scale the object's coordinates around center of mass.

Parameters:

Name Type Description Default
scale_factor float

Scale factor for polydata object

required

set_cmap(scalar_min, scalar_max, cmap='hsv', number_of_colors=256)

Create lookup table.

Parameters:

Name Type Description Default
scalar_min float

min value for coloring array.

required
scalar_max float

max value for coloring array.

required
cmap str

name of the cmap.

'hsv'

set_opacity(opacity)

set_origin(coord)

write(file_name=None)

Write vtk polydata object to file.

Parameters:

Name Type Description Default
file_name str

Name of the file with vtk polydata object. If None class name will be used

None

SilhouetteObject

Bases: PolydataObject

camera property writable

color = color instance-attribute

input_data property writable

line_width property writable

mapper_input_connection = self.silhouette.GetOutputPort() instance-attribute

silhouette = vtkPolyDataSilhouette() instance-attribute

__init__(color='red', line_width=5)

write()