[vtkusers] Contour of 3D Exodus Data

Berk Geveci berk.geveci at kitware.com
Fri Dec 4 14:57:12 EST 2015


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/3181cf5d/attachment.html>


More information about the vtkusers mailing list