[Paraview] How to set ScalarOpacityFunction in ParaViewWeb

Yu Yu jtxqhao at gmail.com
Thu Nov 28 05:11:26 EST 2013


Hi,

I have this object in ParaViewWeb,



I attempted to use the following codes to set the ScalarOpacityFunction,
    myLK = simple._GetLUTReaderInstance()
    srcObj = simple.GetActiveSource()
    myarray = srcObj.PointData.GetArray('scalars')
    mylut = myLK.GetLUT(myarray,'Brewer Diverging Spectral (11)')
    rep.LookupTable = mylut

    sofPoints =[0.0, 0.0, 0.3, 0.5, 0.6, 0.8, 1.0, 1.0, 1.0]
    sof = simple.CreatePiecewiseFunction()
    sof.Points = sofPoints

    rep.LookupTable.EnableOpacityMapping = 1
    rep.LookupTable.ScalarOpacityFunction = sof

    simple.Render()

And the above codes produce this in ParaViewWeb:



This is how it show in ParaView, which is what I try to achieve:


Can I know where have I done wrong ? Thanks for any help.

Best Regards,
Yu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20131128/f121c32e/attachment-0001.htm>


More information about the ParaView mailing list