[vtkusers] Contour of 3D Exodus Data

Slaughter, Andrew E andrew.slaughter at inl.gov
Fri Dec 4 16:12:31 EST 2015


Thanks for the suggestion, I have a question regarding
vtk.vtkExtractBlock(). What index does the AddIndex method refer to?

I can't seem to understand the relationship of reader MultiBlock data set
and these indices. (i.e., I can use AddIndex(0) and/or AndIndex(1) and see
the contours on the complete geometry).

I am trying to write a code that, by default, contours all blocks, but the
user can also select to limit the contours to certain blocks. Thus, I am
trying to related the "block" names shown in the reader and the indices
used by vtkExtractBlock.

Thanks again,
Andrew

On Fri, Dec 4, 2015 at 12:57 PM, Berk Geveci <berk.geveci at kitware.com>
wrote:

> By the way, if you want to contour all of the blocks, the following is the
> simple way to go:
>
> # Read Exodus Data
> reader = vtk.vtkExodusIIReader()
> reader.SetFileName('cube_out.e')
> reader.UpdateInformation()
> reader.SetTimeStep(0)
> reader.SetAllArrayStatus(vtk.vtkExodusIIReader.NODAL, 1)
>
> # Contours (these do not show up in my rendered image)
> contours = vtk.vtkContourFilter()
> contours.SetInputConnection(reader.GetOutputPort())
> contours.SetInputArrayToProcess(0, 0, 0, 0, "u")
> contours.SetNumberOfContours(1)
> contours.SetValue(0, 0.5)
>
> contMapper = vtk.vtkCompositePolyDataMapper2()
> contMapper.SetInputConnection(contours.GetOutputPort())
> contMapper.SetScalarVisibility(False) # colored contours
> contMapper.SetScalarRange(scalar_range)
>
> # actor, renderer etc. here
>
> Note the use of the vtkCompositePolyDataMapper2 instead of the regular
> vtkPolyDataMapper.
>
> Best,
> -berk
>
> On Mon, Nov 30, 2015 at 2:22 PM, Slaughter, Andrew E <
> andrew.slaughter at inl.gov> wrote:
>
>> I am unable to have contours of 3D data show up using Python bindings
>> (VTK 6.3) on OSX. I attached an example exodus file and script and would
>> appreciate any help to get contours working.
>>
>> I also include a screenshot from Paraview of what I am expecting the
>> output of my script to resemble.
>>
>> Thanks,
>> Andrew
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151204/13712154/attachment.html>


More information about the vtkusers mailing list