[vtkusers] Tubes with independently varying radius and color in tcl

Mario Rodriguez biomates at telefonica.net
Fri Mar 18 16:48:18 EDT 2011


Hello,

I need to plot a tube with independently varying radius and color in
Tcl.

As far as I understand the description of the POLYDATA vtk format, I
need to define two scalars. Is the following syntax correct? 

POINT_DATA 29
SCALARS escalar1 float 2
LOOKUP_TABLE default
RADIUS 29 float
2.0 3.8 ...............
COLOR 29 float
0.1 0.5 ...............



My relevant tcl code (which works with only one scalar, but with radius
and colors varying together) is:

vtkTubeFilter tubes
    tubes SetInputConnection [filter1 GetOutputPort]
    tubes SetRadius 1
    tubes SetNumberOfSides 6
    tubes SetVaryRadiusToVaryRadiusByScalar
vtkPolyDataMapper mapEdges
    mapEdges SetInputConnection [tubes GetOutputPort]
    mapEdges ScalarVisibilityOn
    mapEdges SetLookupTable lut1
vtkActor edgeActor
    edgeActor SetMapper mapEdges
    [edgeActor GetProperty] SetColor 1 0 0
    [edgeActor GetProperty] SetOpacity 0.7
    [edgeActor GetProperty] SetLineWidth 3


I can't figure out how to introduce both scalars in the vtk code and
associate them to the radius and to the levels for the lookup table
separately.

A simple example would be of great help.

Thanks in advance.

--
Mario





More information about the vtkusers mailing list