In mayavi, Gael taught me how to change the radius of a cylinder by storing
a scalar value, and varying the radius by that scalar.  However, the
coloring is likewise based on the scalars.  I was wondering if there were
any way that I could vary the color by another value, such as my "data"
array in this example script:

## Tom Foutz
>
## Example using both diameters and data
> from numpy import array, vstack
> from enthought.mayavi.mlab import *
> x=array([0,-1,2,-3,4,-5,6])
> y=array([0,-3,-5,1,2,4,2])
> z=array([0,0,-1,1,-2,2,3])
> d=array([3,2,1,3,2,1,3])
> data=array([0.1,0.3,0.5,0.7,0.1,0.15,0.9])
> edges=vstack([[0,1],[0,2],[0,3],[0,4],[0,5],[0,6]])
>
> pts = pipeline.scalar_scatter(x,y,z,d)
> pts.mlab_source.dataset.lines = edges
> stripper = pipeline.stripper(pts)
> tube = pipeline.tube(stripper,
>                      tube_sides=7,
>                      tube_radius=0.01,
>                      name='Cell_%d' % (0))
> tube.filter.vary_radius = 'vary_radius_by_scalar'
>
> tube.filter.capping = True
> tube.filter.use_default_normal = True
> lines = pipeline.surface(tube)
> lines.module_manager.scalar_lut_manager.use_default_range = False
> myvi_tube = lines
>

Thanks!
--Tom
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to